I have participated in some problems debugging multi-threaded process using GDB. I have a multi-threaded process that sprayed in several (8 or 9) separate threads, and I'm trying to determine what is the contents of the variable when the XML_File_Data is called a consultant for a class though, I encountered a problem where, after I apply the correct function breakpoint for all the thread and this is getting a hit from the break point of the thread (the program temporarily stops the execution) I am not able to determine the thread that hit the breakpoint
command (gdb) threads apply to all < / pre> giving me too much useless information like this:
# 0 0x004ab410 in __kernel_vsyscall () # 1 (in 0x05268996 nanosleep) /lib/libc.so.6 # 3 0x082ee313 Frem_clok of frame_clock_frame_end (clock = 0xb4bfd2f8) in 2 0x052a215c (in /lib/libc.so.6 # usleep). c: 143 # 4 in 0x003a34 9 a ?? () # Start_thread thread_proxy (in) /cets_development_libraries/install/lib/libboost_thread-gcc41-mt-1_38.so.1.38.0 # 6 0x02c1f5ab 5 0x00b5cfde (/lib/libpthread.so.0 #) from 9 to 7 0x052a8cfe Out of the processes, 7 or so, I'm almost giving that output, and the information about the last 2 is not really I / O more useful (the actions of the call stack are recognizable names, but anyhow # 0- # 4 tasks have not been identified in the same). This is what I have done so far:
(GDB) GDB (GDB) GDB attached and lieutenant; Prosid & gt; (Gdb) thread XML_File_Data :: XML_File_Data ('All applicable') all and (after the breakpoint is killed)
(gdb) thread applied Where
Any experienced debugger can offer some signals on me whether I am doing wrong or which is normally done in this situation?
Cheers, Charlie
Edit: Fortunately, I was able to figure out that the reason being "to be adapted to the code being run through the debugger In addition to running a debugger in the directory of the executable file, there is still no success with debugging.
To find the current thread number after thread or info thread breakpoint hit
(gdb) thread [current Thread is 1 (Thread 0xb790d6c0 (LWP 2519)]] (gdb) Information thread 17 Thread 0xb789cb90 (LWP 2536) 0xb7fc6402 () 16 thread 0xb769bb90 (LWP 2537) in __kernel_vsyscall __kernel_vsyscall 0xb7fc6402 () 15th Red 0xb749ab90 (LWP 2543) 0xb7fc6402 (in __kernel_vsyscall) 14 Thread 0xb7282b90 (LWP 2544) in 0xb7fc6402 __kernel_vsyscall () 13 Thread 0xb5827b90 (LWP 2707) 0xb7fc6402 (in __kernel_vsyscall) 12 Thread 0xb5626b90 (LWP 2708) (0xb7fc6402 in __kernel_vsyscall) 11 Thread 0xb5425b90 (LWP 2709) 0xb7fc6402 (in __kernel_vsyscall) 10 thread 0xb5161b90 (LWP 2713) 0xb7fc6402 in __kernel_vsyscall () 9 thread 0xb4ef9b90 (Eldblupi 2715) __kernel_vsyscall (in 0xb7fc6402) 8 thread 0x b4af7b90 (LWP 2717) 0xb7fc6402 (in __kernel_vsyscall) 7 thread 0xb46ffb90 ( LWP 2718) 0xb7fc6402 () 6 thread 0xb44feb90 (LWP 2726) in __kernel_vsyscall 0xb7fc6402 () 5 thread 0xb42fdb90 (LWP 2847) in __kernel_vsyscall 0xb7fc6402 () 4 thread 0xb40fcb90 (__kernel_vsyscall in __kernel_vsyscall in __kernel_vsyscall Call __kernel_vsyscall in __kernel_vsyscall in LWP 2848) 0xb7fc6402 () 3 thread 0xb3efbb90 (LWP 2849) 0xb7fc6402 () 2 thread 0xb3cfab90 (LWP 2850) 0xb7fc6402 () * 1 thread 0xb790d6c0 (LWP 2519) 0xb7fc6402 () (gdb) An Asterisk '*' indicates the current thread on the left side of the GDB thread number.
Comments
Post a Comment