LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Is there anyway to find the task switches from gdb coredump? (https://www.linuxquestions.org/questions/programming-9/is-there-anyway-to-find-the-task-switches-from-gdb-coredump-868637/)

sree_ec 03-15-2011 01:45 AM

Is there anyway to find the task switches from gdb coredump?
 
I have a coredump file which gives stacktrace. But I dont know which thread executed or any task switches happened before a crash happened from a given thread. is there anyway to find out

thanks,

cbh2000 03-15-2011 11:01 PM

gdb is capable of debugging a core dump with this command:
Code:

gdb testit <core-dump.file>
(source: http://cs.baylor.edu/~donahoo/tools/gdb/tutorial.html)

First result on Google for "gdb coredump"! ;)

Happy debugging!

EDIT: Oh... I see your problem... Do either "gdb testit <dump>" or "gdb --core <dump>" print the backtrace for multiple threads?

paulsm4 03-15-2011 11:36 PM

A coredump is a snapshot, taken at some point in time (specifically, at the moment the fatal exception occurred).

Yes, you can see what each of the threads was doing at the moment the core dump was taken:
Quote:

http://www.yolinux.com/TUTORIALS/GDB-Commands.html

info threads

thread apply all bt
No, there's no magic "what task switches occurred before the core dump". You'll have to infer that by analyzing the stack traces.

'Hope that helps .. PSM

sree_ec 03-16-2011 12:35 AM

Thanks for the answers although it does not solve my Issue. I was aware of these commands but as paulsm4 said, I was looking for a magic command ;) . Anyway I will continue using these


All times are GMT -5. The time now is 09:38 PM.