Friday, February 17, 2006

CDT : How to create Thread ?

CDT : How to get thread id?

gdb/mi thread-list-ids does not show any newly created thread. The work around is using the
(gdb) info threads
3 Thread 48 (PPU_SLEEP) 0x0001da54 in sys_lwmutex_lock ()
2 Thread 50 (PPU_STOP) write (fd=0, buf=0x200002d0, nbytes=1)
at /home/fs_posix_api.c:163
* 1 Thread 49 (PPU_STOP) print_string (straddr=3489730048) at ppu_thr_simple.c:118

In MI interpreter mode, the output is:
(gdb)
info thread
&"info thread\n"
~" 2 Thread 40 (PPU_STOP) "
~"* 1 Thread 41 (PPU_STOP) "
^done,frame={func="write",args=[{name="fd",value="0"},{name="buf",value="0x200002d0"},{name="nbytes",value="31"}],file="/home/fs_posix_api.c",line="163"},frame={func="print_string",args=[{name="straddr",value="3489730048"}],file="ppu_thr_simple.c",line="118"}

The org.eclipse.cdt.debug.mi.core.cdi.ThreadManager.java:getCThreads(Target process) shows howto use info threads to get the thread ids.

The org.eclipse.cdt.debug.mi.core.command.CLIInfoThreads.java:getMIInfo() shows how to create a CLIInfoThreads from the MIOutput.

The org.eclipse.cdt.debug.mi.core.output.CLINifoThreadsInfo.java:parse() shows how to parse the above information.

The only defect is the CLIInfoThreadsInfo command does not return the real thread id, it returns the id GDB assigned to each thread.

Tuesday, February 14, 2006

Blog about Eclipse/CDT

From CDT group lead:
Doug Schaefer
Mike Milinkovich(ED):
Life at Eclipse