Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: "Jirka Koutný" <koutnji2@gmail.com>
Cc: gdb@gnu.org
Subject: Re: question about why gdb needs executable's binary
Date: Tue, 19 Mar 2019 15:42:00 -0000	[thread overview]
Message-ID: <20190319154144.GA3509809@host1.jankratochvil.net> (raw)
In-Reply-To: <CAH5nFm9Jn5VReNZEQe6UHKjPtd8KfL3mpM4hqxjoU1N+jff2wg@mail.gmail.com>

On Tue, 19 Mar 2019 16:25:30 +0100, Jirka Koutný wrote:
> I see, just to make sure - DT_DEBUG gets dumped into the corefile, is that
> correct?

The PT_DYNAMIC segment containing the DT_DEBUG pointer (pointing to
r_debug/_r_debug) normally gets dumped into the core file. The problem is that
without having the main executable one cannot much find where is the DT_DEBUG
pointer located in the core file. Core file has for example NT_AUXV where is
AT_PHDR and from program headers one could find PT_DYNAMIC where is DT_DEBUG.
But core file does not have to contain the program headers as those may be in
a read-only page of the main executable. Nowadays with dumping of the first
page of any ELF (even if it is read-only, for its NT_GNU_BUILD_ID) one can
probably find the program headers there. But then one can also just read
NT_FILE nowadays.


Jan


  reply	other threads:[~2019-03-19 15:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-13 14:25 Jirka Koutný
2019-03-13 14:34 ` Andreas Schwab
2019-03-13 15:41   ` Jirka Koutný
2019-03-13 16:22     ` John Baldwin
2019-03-14 21:51 ` Jan Kratochvil
2019-03-19 14:25   ` Jirka Koutný
2019-03-19 14:35     ` Jan Kratochvil
2019-03-19 15:25       ` Jirka Koutný
2019-03-19 15:42         ` Jan Kratochvil [this message]
2019-03-19 15:47           ` Jirka Koutný

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=20190319154144.GA3509809@host1.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb@gnu.org \
    --cc=koutnji2@gmail.com \
    /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