This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Debug threads


hce wrote:
Hi,

I am debug a problem on CentOS 5, the problem used %100 CPU and there
are 9 threads running. Which gdb command can I find out which thread
is current running and  hooked %100 CPU?

If you can attach with gdb, then there is a high probability that the "current" thread is the one that is eating up all the CPU.

Do "info threads", and look for the thread that has an asterisk
("*") in the left hand column.

If you do "continue" and then control-c and repeat the info threads
command, it is likely that the busy thread will remain as the
"current" thread each time (or the majority of times).

Otherwise, gdb does not have a formal way of showing you which
thread is the most busy.

Michael


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]