Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Thread Names in debugger

Hi,

For some operating systems, the GDB "info threads" command will show extra information about the threads, e.g. name and ID. If that is the case, there is a hook in CDT for collecting that extra information and provide it to CDT. This hook is described in CDT feature request #69711 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=69711) and has been implemented in CDT since CDT 2.0. We use it in our Eclipse/CDT based product.

This issue was discussed several years ago on the CDT mailing list:
http://dev.eclipse.org/mhonarc/lists/cdt-debug-dev/msg00462.html
http://dev.eclipse.org/mhonarc/lists/cdt-debug-dev/msg00463.html

If the native Linux GDB back-end does not provide extra information about thread names in the "info threads" command, this solution won't help you. Maybe that kind of functionality could be added to the native Linux GDB back-end?

I realize that if you just want to use Eclipse/CDT/GDB for debugging multi-threaded Linux programs you would want this feature out-of-the-box; you're not interested in extending CDT and possibly GDB to get this working. But if GDB can provide the required information, you could be a hero and contribute the required parts to get it working in CDT as well :-)

Regards,
Stefan

Alena Laskavaia wrote:
Depends on your debugger. I don't think gdb shows thread names itself.
You can try "info threads" command from gdb console to see what info
is shown there

On Thu, Aug 13, 2009 at 5:31 AM, Christoph Mathys<eraserix@xxxxxxxxx> wrote:
Hello

I wondered if there is some way of naming threads and see those names
in the debugger. I found some old discussions about this, but they
have not been of much help.

I'm using cdt 6 on Ubuntu 8.04.

To name the threads, I use prctl(PR_SET_NAME, "asdf"). This works on a
thread base as I can see using top -p PID and then the command 'H'.
Sadly, I've no idea how I can this name using gdb or the eclipse
debugger. Any hints?

Christoph
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev


--
---------------------------------
Stefan Bylund
Senior Software Engineer
Enea
Skalholtsgatan 9,
Box 1033, SE-164 21 Kista, Sweden
Direct: +46 8 50 71 43 25
Mobile: +46 709 71 43 25
stefan.bylund@xxxxxxxx
www.enea.com
---------------------------------
Enea - Embedded for Leaders
---------------------------------



Back to the top