LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-15-2011, 02:45 AM   #1
sree_ec
Member
 
Registered: Sep 2010
Location: world
Distribution: Ubuntu 12.04LTS
Posts: 76

Rep: Reputation: 5
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,
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 03-16-2011, 12:01 AM   #2
cbh2000
LQ Newbie
 
Registered: Sep 2010
Distribution: openSUSE 11.3
Posts: 14

Rep: Reputation: 0
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?

Last edited by cbh2000; 03-16-2011 at 12:18 AM.
 
Old 03-16-2011, 12:36 AM   #3
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
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
 
2 members found this post helpful.
Old 03-16-2011, 01:35 AM   #4
sree_ec
Member
 
Registered: Sep 2010
Location: world
Distribution: Ubuntu 12.04LTS
Posts: 76

Original Poster
Rep: Reputation: 5
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
gdb - Cannot find new threads: generic error tashtego Programming 3 10-27-2010 07:05 PM
How to find what task is running on a particular cpu core ? summer_intern Linux - General 2 09-17-2010 10:29 PM
how to find thread name using gdb venkat_k Linux - General 0 04-10-2009 02:37 AM
C++: use gdb to find where segfault happens Ephracis Programming 10 03-09-2009 08:42 PM
gdb breakpoints cant find source file AM1SHFURN1TURE Programming 4 01-14-2006 02:10 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration