blackberry / VSPlugin

Visual Studio Plugin for BlackBerry Native SDK
9 stars 15 forks source link

b67 - Debugging Multi-Thread application doesn't show thread name in Thread Window #145

Closed mattcostanzo closed 10 years ago

mattcostanzo commented 11 years ago

Giving a thread a name doesn't appear in the Threads Name Column.

  1. Give threads a name used this for reference: http://publib.boulder.ibm.com/infocenter/iseries/v7r1m0/index.jsp?topic=%2Fapis%2Fpthread_setname_np.htm

pthread_t producerThread; int rc1 = pthread_create(&producerThread, NULL, producer, NULL); if( 0 == rc1 ) { rc1 = pthread_setname_np(producerThread, "producerThread"); }

pthread_t consumerThread; int rc2 = pthread_create(&consumerThread, NULL, consumer, NULL); if( 0 == rc2 ) { rc2 = pthread_setname_np(consumerThread, "consumerThread"); }

1.Debug Multi-Threaded application 2.Hit a breakpoint in the thread Behaviour: No name appears in the thread window for that thread.

mattcostanzo commented 11 years ago

guarnold commented 3 months ago The command pthread_setname_np is not working properly. It should return 0 but it is returning 16. (http://developer.blackberry.com/native/documentation/playbook/com.qnx.doc.neutrino.lib_ref/topic/p/pthread_setname_np.html)

The problem is that the documentation doesn't tell the codes for each error, so I don't know at this moment what that number (16) means.

"Returns:

EOK Success.

E2BIG The name is too long.

EBUSY As described above, you're trying to name a thread other than the calling thread, and another program already has write access to /proc/ pid /as.

EPERM You don't have the appropriate permissions to set the name."

dbrgss commented 10 years ago

Estimate: 1 Day

guarnold commented 10 years ago

The plug-in was supporting thread names but GDB was not. Now it is and it is possible to see the name of the thread in the thread window.

srinivas4912 commented 10 years ago

Verified using VS2013/12 from build 2.0.0022 on Win8.1 and Win7 64 bit. it is possible to see the name of the thread in threads window after hit a breakpoint.