I am using top to see the thread wise cpu usage using
top -H -p `pgrep app.out`
It is showing some pid for each thread like
4015
4016
I had attached gdb to the application using gdb attach command.
Now I want to switch to thread 4015 which is showing inside top o/p.
How can I do that ?
If I fire thread 4015 it is showing no thread . as I need to give thread id in gdb.
So how can I map top thread id to gdb thread id ?
You should be able to match the
LWPdisplayed in GDB with thetopinformation:according to my quick tests with Firefox, you can see that in your
top -H -p:and that in GDB
info threads:EDIT: just for you in exclusivity, here is a brand new commands for gdb:
lwp_to_id <lwp>:(working at least on the
trunkversion of GDB, not sure about the official releases !