Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Getting the IDE to display thread names?: (22 Items)
   
Getting the IDE to display thread names?  
Hi -  I've done some searching on the site and in forums, and can't seem to find an answer to my question, so here goes 
-

Why is it that the debugger perspective does not show thread names, rather it shows things like "Thread [1], Thread [2],
 etc"?  I saw a note that in 6.3.2 the debugger perspective in the IDE should display task names, it does not seem to be
 working for me in 6.4.1 (Momentics 4.6).

I feel like a total noob, but I didn't see anything about this anywhere on the qnx site...

M
Attachment: Image debugger.jpg 36.2 KB
Re: Getting the IDE to display thread names?  
No IDE never showed thread names in debugger, because gdb does not support it by default (since thread name was not a 
common concept across unixes). The only thing I can suggest that can help is to open another terminal to target using 
Terminal view
and do "pidin | grep your_process" to see what number matches what thread name.
Re: Getting the IDE to display thread names?  
Hmmm, OK.  That is a bummer.  BTW, you might want to have this removed from your website.

http://www.qnx.com/developers/articles/rel_2436_16.html#New_Momentics

About a quarter of the way down:

Threads
    Threads now have names, which can make debugging easier. (Ref# 27085)

    The following commands now support thread names:

        * pidin now displays the thread names
        * dumper maintains the thread-name information in core files
        * the IDE System Information view now shows the thread names
        * the IDE Debugger now reads the thread names
Re: Getting the IDE to display thread names?  
It should work in gdb. I believe we did have it working in 
the IDE.

Which exactly gdb are you using? You need fairly recent 
update of gdb 6.8. I am not sure which IDE version is needed 
with that.


---
Aleksandar
Re: Getting the IDE to display thread names?  
With one caveat - pthread_setname_np(tid,name) where tid is NOT the calling
tid, will not work while debugging, because it uses the debug interface, and
only one debugger can be attached at a time.

Aleksandar Ristovski wrote:
> It should work in gdb. I believe we did have it working in 
> the IDE.
> 
> Which exactly gdb are you using? You need fairly recent 
> update of gdb 6.8. I am not sure which IDE version is needed 
> with that.
> 
> 
> ---
> Aleksandar
> 
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post43551
> 

-- 
cburgess@qnx.com
Re: Getting the IDE to display thread names?  
I'm using whatever GDB you guys installed with my QNX distro.  How do I find out?  Is in the Help->About QNX Momentics..
. set of windows?
Re: Getting the IDE to display thread names?  
Mike Medved wrote:
> I'm using whatever GDB you guys installed with my QNX distro.  How do I find out?  Is in the Help->About QNX Momentics
... set of windows?

I think the easiest is in your IDE, when debugging session 
has started, click on "gdb.exe" and then in the console type

show version


It will tell you.


Another way is to open cmd.exe and do ntox86-gdb:

C:>ntox86-gdb
GNU gdb 6.8 qnx-nto (rev. 347)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>;
This is free software: you are free to change and 
redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type 
"show copying"
and "show warranty" for details.
This GDB was configured as "--host=i386-mingw32msvc 
--target=i386-pc-nto-qnx6.4.0".
(gdb)


The first line, GNU gdb 6.8 qnx-nto (rev. 347) tells which 
exactly version it is.


RE: Getting the IDE to display thread names?  
Actually, mine says exactly what you've pasted below.

M

-----Original Message-----
From: Aleksandar Ristovski [mailto:community-noreply@qnx.com] 
Sent: Thursday, December 10, 2009 2:22 PM
To: general-ide
Subject: Re: Getting the IDE to display thread names?

Mike Medved wrote:
> I'm using whatever GDB you guys installed with my QNX distro.  How do
I find out?  Is in the Help->About QNX Momentics... set of windows?

I think the easiest is in your IDE, when debugging session 
has started, click on "gdb.exe" and then in the console type

show version


It will tell you.


Another way is to open cmd.exe and do ntox86-gdb:

C:>ntox86-gdb
GNU gdb 6.8 qnx-nto (rev. 347)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>;
This is free software: you are free to change and 
redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type 
"show copying"
and "show warranty" for details.
This GDB was configured as "--host=i386-mingw32msvc 
--target=i386-pc-nto-qnx6.4.0".
(gdb)


The first line, GNU gdb 6.8 qnx-nto (rev. 347) tells which 
exactly version it is.






_______________________________________________

General
http://community.qnx.com/sf/go/post43558
Re: Getting the IDE to display thread names?  
I would suggest upgrading gdb by downloading from this link:

http://community.qnx.com/sf/frs/do/listReleases/projects.toolchain/frs.gdb


Re: Getting the IDE to display thread names?  
Done, same result.
Re: Getting the IDE to display thread names?  
Mike Medved wrote:
> Done, same result.

Assuming your program assigns thread names using 
pthread_setname_np(gettid(), ...) (see Colin's post about 
limitations), you can do this in your gdb console window:

show threads


It should print threads including their state and name.
Re: Getting the IDE to display thread names?  
Because IDE does not support this (I could be wrong but I have  never seen it implemented). Qnx gdb may have some sort 
of hack to show  it but it won't make IDE show thread names because it has to be explicitly programmed in IDE and it 
never was.
Re: Getting the IDE to display thread names?  
If that is true, then your application notes (cited above) are totally wrong.  It says this feature was added in 6.3.
RE: Getting the IDE to display thread names?  
I'm following this discussion, and I'll update the notes when I know the
outcome of it.


Steve Reid (stever@qnx.com)
Technical Editor
QNX Software Systems 
 

> -----Original Message-----
> From: Mike Medved [mailto:community-noreply@qnx.com] 
> Sent: Thursday, December 10, 2009 3:29 PM
> To: general-ide
> Subject: Re: Getting the IDE to display thread names?
> 
> If that is true, then your application notes (cited above) 
> are totally wrong.  It says this feature was added in 6.3.
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post43566
> 
> 
Re: Getting the IDE to display thread names?  
Mike, without going too far, the note you mention is still valid. The
only debating point is this sentence:

* the IDE Debugger now reads the thread names

As Elena mentioned, there is no code in IDE to "display" thread name in
the debug windows so the above sentence is not completely wrong.

The other three sentences are correct. You can use System Information
"Process Information" view to see the thread name and set the thread
name too.

HTH,
- Andy

-----Original Message-----
From: Mike Medved <community-noreply@qnx.com>
Reply-to: post43566@community.qnx.com
To: general-ide <post43566@community.qnx.com>
Subject: Re: Getting the IDE to display thread names?
Date: Thu, 10 Dec 2009 15:29:05 -0500 (EST)

If that is true, then your application notes (cited above) are totally wrong.  It says this feature was added in 6.3.



_______________________________________________

General
http://community.qnx.com/sf/go/post43566

Re: Getting the IDE to display thread names?  
I can't seem to get the system information -> process information do what you think it should do.  It barfs if you try 
to set the thread name, and it only displays IDs as well.

So in my view both of the last two lines are incorrect.  

Attachment: Image debuggeryuck.jpg 271.57 KB
Re: Getting the IDE to display thread names?  
Try devb-eide - it has names, according to pidin -Pdevb-eide threads

Mike Medved wrote:
> I can't seem to get the system information -> process information do what you think it should do.  It barfs if you try
 to set the thread name, and it only displays IDs as well.
> 
> So in my view both of the last two lines are incorrect.  
> 
> 
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post43571
> 
> 
> ------------------------------------------------------------------------
> 

-- 
cburgess@qnx.com
Re: Getting the IDE to display thread names?  
"Thread Name" is not shown by default in Process Information view, you
have to click the down-size angle at the upper hand side and select
"Configure", add "Thread Name" to the item to display.

-----Original Message-----
From: Mike Medved <community-noreply@qnx.com>
Reply-to: post43571@community.qnx.com
To: general-ide <post43571@community.qnx.com>
Subject: Re: Getting the IDE to display thread names?
Date: Thu, 10 Dec 2009 15:46:42 -0500 (EST)

I can't seem to get the system information -> process information do what you think it should do.  It barfs if you try 
to set the thread name, and it only displays IDs as well.

So in my view both of the last two lines are incorrect.  

Re: Getting the IDE to display thread names?  
So, yeah, you're right it was showing them for dev-eide.  I went back in my code and added a  pthread_setname_np() at a 
spot I knew it would work, and this did show up.

So it seems like the best option I've got is to display the process information next to the debug tab and I should be 
able to more easily correlate the two.

One bummer is this - why doesn't the name take when it is set via the other pthread functions?  I'm using the vx2qnx 
library, and when I do a taskSpawn() it boils down to a call to __vx2qnx_task, which has a parameter, reg.  There is 
code in the file (taskLib.c) to handle setting the name field in req, which ends up getting passed to pthread_create(). 
 Is the previous comment saying that this won't take, and that the user MUST call pthread_setname_np manually after the 
thread is created and starts running?  Yuck.
Re: Getting the IDE to display thread names?  
Also, as a side note, this is highly desirable capability.  Some of your competitors have had the ability to display 
thread names in their debugger IDEs for a long time.  Momentics should do this too.  If I'm using the IDE I don't want 
to have to go off and figure out what number corresponds to thread I care about.  What if I have a whole bunch?  It 
could become very inconvenient.
Re: Getting the IDE to display thread names?  
Right.  The IDE uses the Eclipse CDT debugging framework, which for
thread information tracks only a thread ID.  CDT doesn't provide the
means to track thread names.  Whether this is something that the
Momentics IDE could maintain and display for itself using its knowledge
of the capabilities of recent GDBs is an interesting question that would
take some offort to answer.

Cheers,

Christian
 


On Thu, 2009-12-10 at 15:27 -0500, Elena Laskavaia wrote:

> Because IDE does not support this (I could be wrong but I have  never seen it implemented). Qnx gdb may have some sort
 of hack to show  it but it won't make IDE show thread names because it has to be explicitly programmed in IDE and it 
never was.
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post43565
> 


Re: Getting the IDE to display thread names?  
Not knowing how the CDT framework is wired together, I don't know if this is possible/a good half-way house.

Currently the [Process Information] view is wired to trigger on selections from the [Target Naviagator]. 
If the CDT allowed it, a "[Debug Process Information]" view could be cloned from the [Process Information] view: this 
[Debug Process Information] would simply(?) be wired to trigger on selections from the [Debug] view rather than the 
[Process Information] view. 

It wouldn't be as neat as having the name information in the [Debug] view, but it might be an easier path than getting 
the Eclipse CDT Debug view implementation modified, and it has the benefit of reusing the existing [Process Information]
 view with presumably a simple modification (the trigger). In a way, it would be equivalent to adding  [Process View] + 
[Process Information] views to the Debug perspective, but 
 - would acheive the same with one view (less clutter)
 - it additionally would "automatically" update when the user clicked a different process in the debug view, rather than
 having to find it in the [Process Information] view (tighter integration)