Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: jmf list <jmf.list@gmail.com>
To: gdb@sourceware.org
Subject: siginfo and core files
Date: Fri, 25 May 2012 13:53:00 -0000	[thread overview]
Message-ID: <CALuSdM9fTir4su5HpqYqRbOdG0aMf6Kvq83=qua39Jdo96Mvzg@mail.gmail.com> (raw)

Hello,

Is it possible to access the si_addr and si_signo siginfo fields from
a core dump in GDB? When debugging a live process I access these
values via the $_siginfo convenience var. I am not sure if both of
these values are normally stored in a core dump, or if they are
accessible via GDB.

I noticed that the signal number is printed to the console when I load
a core file, so I started reading the GDB source around the string
"Program terminated with signal" and found that the signal number is
read from the core file via gdb/corelow.c::core_open and
bfd/corefile.c::bfd_core_fail_failing_signal. It isn't apparent to me
that any of the other siginfo is stored or read, however.

I would like to access these values via the GDB Python API for both
live processes and core files. As it stands, I could potentially parse
'info target' to determine the target type, and respectively use
"$_siginfo" to get both si_signo and si_addr if my script is running
on a live process, or use "target core <corefile>" to get just the
signal number (and let the tool degrade gracefully for lack of
si_addr) if my script is running on a core file. That solution is a
bit of a kludge though, and I would like to access si_addr in the core
file if possible.

I am running GDB 7.4 in FC16 on x86_64 for this analysis.

Thanks. Any help would be appreciated,
J


             reply	other threads:[~2012-05-25 13:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-25 13:53 jmf list [this message]
2012-05-25 14:22 ` Pedro Alves

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='CALuSdM9fTir4su5HpqYqRbOdG0aMf6Kvq83=qua39Jdo96Mvzg@mail.gmail.com' \
    --to=jmf.list@gmail.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