From: Daniel Jacobowitz <drow@mvista.com>
To: gdb-patches@sources.redhat.com
Subject: Re: unwind support for Linux 2.6 vsyscall DSO
Date: Tue, 07 Oct 2003 00:17:00 -0000 [thread overview]
Message-ID: <20031007001755.GB16602@nevyn.them.org> (raw)
In-Reply-To: <200310062359.h96Nxqgt032566@magilla.sf.frob.com>
On Mon, Oct 06, 2003 at 04:59:52PM -0700, Roland McGrath wrote:
> > There should be an iterator over the entries in the /proc/pid/auxv
> > file with a callback that processes each entry. So that the iterator
> > could be used not just for finding the AT_SYSINFO_EHDR entry.
>
> Ok, an iterator interface is fine with me, just marginally less efficient
> than the searcher when only one tag is actually used (and more efficient if
> many tags are used). (I had not proposed any function that would be useful
> solely for AT_SYSINFO_EHDR, though that was one of Jim's early
> suggestions.) If others agree this is the right interface for a target_ops
> addition, I will write that patch.
>
> > I think the number of iterations would be your size_t above divided by
> > the size of an auxv_t or something similar.
>
> Indeed.
>
> > The first thing that happens is that the breakpoint inserted at the
> > dynamic linker is hit, at which point gdb gets to add the shlibs.
>
> Obviously that's not the first thing, since inserting the breakpoint in the
> dynamic linker happens before that. It's ideal to do the vsyscall DSO
> setup before letting the dynamic linker run at all. That way you have that
> information in case you get a signal in the early part of dynamic linker
> startup, or attach to a process that is for some reason blocked in a system
> call in that early stage, and want to see a backtrace to understand the
> state.
I agree that this would be nice. This'll require a new hook.
Preferably it should be done using the new observers mechanism.
> > enable_break: search for .interp in /scratch/ezannoni/pie-work/native/gdb/testsuite/gdb.base/break
> > enable_break: opening /lib/ld-linux.so.2
> > elf_locate_base: DT_DEBUG entry has value 0x0
> > svr4_current_sos: no DT_DEBUG found
>
> I don't see your debugging code in mainline gdb and so I can only guess
> what these messages mean in terms of the code.
>
> Are you sure this doesn't mean it looked at the sh process before it
> exec'd? It wouldn't find anything there because it would be looking for
> DT_DEBUG from the .dynamic address of the "break" binary and sh's layout is
> different (so it's reading arbitrary other data and not finding the tag).
>
> > Since we need the iterator method, this read/parse becomes a very
> > small piece and fits nicely in linux-proc.c in the live inferior
> > case. For the corefile/remote case, you would ask bfd for the .auxv
> > section of the core file and parse that in order to get an element of
> > the vector and this is also something that can be in gdb, unless you
> > want to reuse that in some other tool.
>
> We are all clear on the steps that need to be performed. The part that
> parses the format and deals with the target wordsize question and
> byteswapping, is common work between the live and core cases that might use
> a shared function rather than duplicative source code. That is what we
> have been discussing.
>
> You said "corefile/remote case", but looking for a .auxv section applies
> only to core files. I don't think we have discussed the remote case. It
> would require the remote stub reading the local /proc/PID/auxv file and
> giving the information back to gdb. I'm not aware of anything in the
> remote protocol to allow that.
No, but extending it to do so is easy (and vital). I'll do it later.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2003-10-07 0:17 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-03 8:27 Roland McGrath
2003-10-03 23:44 ` Jim Blandy
2003-10-04 0:10 ` Roland McGrath
2003-10-04 7:28 ` Jim Blandy
2003-10-04 20:27 ` Roland McGrath
2003-10-04 21:14 ` Daniel Jacobowitz
2003-10-04 22:01 ` Roland McGrath
2003-10-04 23:28 ` Daniel Jacobowitz
2003-10-06 17:14 ` Jim Blandy
2003-10-06 19:35 ` Elena Zannoni
2003-10-06 19:31 ` Elena Zannoni
2003-10-06 20:24 ` Roland McGrath
2003-10-06 21:48 ` Elena Zannoni
2003-10-06 23:59 ` Roland McGrath
2003-10-07 0:13 ` Roland McGrath
2003-10-07 2:30 ` Elena Zannoni
2003-10-07 2:40 ` Roland McGrath
2003-10-07 2:47 ` Roland McGrath
2003-10-07 3:53 ` Andrew Cagney
2003-10-07 4:07 ` Daniel Jacobowitz
2003-10-07 4:17 ` Andrew Cagney
2003-10-07 4:28 ` Roland McGrath
2003-10-08 0:02 ` Michael Snyder
2003-10-08 0:46 ` Roland McGrath
2003-10-08 18:27 ` Andrew Cagney
2003-10-08 21:00 ` Andrew Cagney
2003-10-08 21:47 ` Roland McGrath
2003-10-08 23:25 ` Elena Zannoni
2003-10-09 0:45 ` Roland McGrath
2003-10-08 23:10 ` Elena Zannoni
2003-10-09 0:50 ` Roland McGrath
2003-10-08 23:53 ` Daniel Jacobowitz
2003-10-07 0:17 ` Daniel Jacobowitz [this message]
2003-10-07 23:54 ` Michael Snyder
2003-10-08 0:07 ` Roland McGrath
2003-10-07 4:43 ` Jim Blandy
2003-10-07 4:45 ` Roland McGrath
2003-10-09 19:58 ` Kevin Buettner
2003-10-09 20:02 ` Daniel Jacobowitz
2003-10-09 20:10 ` Jim Blandy
2003-10-09 22:20 ` Roland McGrath
2003-10-09 22:49 ` Kevin Buettner
2003-10-10 0:12 ` Michael Snyder
2003-10-11 1:44 ` Roland McGrath
2003-10-09 23:04 ` Kevin Buettner
2003-10-11 1:47 ` Roland McGrath
2003-10-15 4:33 ` Kevin Buettner
2003-10-09 20:21 ` Kevin Buettner
2003-10-09 20:23 ` Daniel Jacobowitz
2003-10-09 20:46 ` Kevin Buettner
2003-10-09 22:32 ` Roland McGrath
2003-10-09 22:46 ` Kevin Buettner
2003-10-11 1:40 ` Roland McGrath
2003-10-09 22:07 ` Roland McGrath
2003-10-09 22:32 ` Kevin Buettner
2003-10-07 3:33 Roland McGrath
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=20031007001755.GB16602@nevyn.them.org \
--to=drow@mvista.com \
--cc=gdb-patches@sources.redhat.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