Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "Garrod, David" <dgarrod@enterasys.com>
To: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: How can I use the call command when analyzing a core
Date: Mon, 18 May 2009 21:27:00 -0000	[thread overview]
Message-ID: <B095CECB368F0946BF407966E809C35405F6FC29F1@MAEXCEVS2.ets.enterasys.com> (raw)

I have a core file for a very complex program that I'm trying to analyze using gdb. The program has lots of internal routines that if I were able to call them would print out all sorts of interesting information about internal data structures. These data structures are complex and more importantly complexly linked. Consequently it is not practicable to write gdb macros etc.

Yes I know the program should have been designed to call these dump routines before aborting. But in this case that would not have been easy because I'm analyzing a SEGV.

If I was doing live debugging I could of course do a:

call the_routine_that_dumps_all_the_interesting_structures()

but if I try that from debugging a core file I get:

(gdb) call a()
You can't do that without a process to debug.

Now of course I realize that if I was doing cross debugging to another architecture this wouldn't be feasible. But in my case I'm debugging a core file that was produced on exactly the same architecture as the one that cored. So I can't see why this is not possible in theory. I've searched the web and surprisingly I can't seem to find references to other people wanting to do this.

I've been browsing the gdb sources trying to get a feel as to how hard it would be to implement this and came to the conclusion that even if it was possible learning the internals of gdb is a massive task (even though I've dabbled in them a little before).

So in summary my questions from this post are:

1) Is there any chance at all of working out how to change gdb to do "call" when analyzing a core on the same
   architecture as the core was taken on?
2) If so how hard is it to do and could I get some pointers on where to start.

Thanks,

Dave Garrod
Enterasys Networks



             reply	other threads:[~2009-05-18 21:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-18 21:27 Garrod, David [this message]
2009-05-18 21:41 ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=B095CECB368F0946BF407966E809C35405F6FC29F1@MAEXCEVS2.ets.enterasys.com \
    --to=dgarrod@enterasys.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox