So, here is how I got my own thread names to show in qtcreator:
After having upgraded to a newer gdb (7.2 is required, upgrade from
7.1 was straightforward) I was able to hack the python code in
dumper.py to show my own thread names. Just look at the code of
ThreadNamesCommand in <INSTALLDIR>share/qtcreator/gdbmacros/dumper.py
to get an idea how it can be done. In our case, we have a common
thread class which contains the name of the thread as a member. All I
needed to do was walk up the thread stack to this class, read the
member and send it to qt-creator.

Now I wonder about several things:
- Is there any clean way of changing the way threadnames behaves?
Right now, I just hacked the code in dumper.py. With clean I mean a
proper way to distribute this functionality to coworkers.
- Is there a good way of changing how a command behaves for debugging
the scripts? E.g. some kind of "reload the script and recreate the
commands"? I had to restart gdb to accomplish this, an execfile
wouldn't do.
- Are there any hints on how to debug this gdb scripts? As long as
they are on their own (a file with some functions) it is simple. But
when I started to hack inside qtcreators python gdb code, I found it
rather difficult to debug my code. But this may just be because I
didn't hack where I was supposed to...

Christoph
_______________________________________________
Qt-creator mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt-creator

Reply via email to