From: Daniel Jacobowitz <drow@mvista.com>
To: gdb-patches@sources.redhat.com
Subject: Re: RFC: partial symbol table address range generalization
Date: Tue, 23 Oct 2001 16:54:00 -0000 [thread overview]
Message-ID: <20011023195430.A15242@nevyn.them.org> (raw)
In-Reply-To: <20011023233450.09F855E9D8@zwingli.cygnus.com>
On Tue, Oct 23, 2001 at 06:34:50PM -0500, Jim Blandy wrote:
> At the moment, GDB's partial symbol table structures assume that each
> compilation unit's text occupies a single contiguous range of
> addresses. If a given address falls between a `struct partial_symtab'
> structure's `texthigh' and `textlow' addresses, then GDB assumes that
> reading that partial symbol table's debugging info will provide
> complete information about that address.
>
> However, this assumption isn't true. A given .o file's code can
> actually appear in any number of distinct regions, separated by code
> from other .o files. This can happen when we compile and link a C++
> program, like the below (from GCC's test suite):
I'd like to point you at my thoughts from the first time I noticed this
behavior:
< http://sources.redhat.com/ml/gdb/2001-08/msg00161.html >
When I looked at this problem in August, I wasn't brave enough to
suggest the solution you're proposing (which I completely agree with).
However...
> There is some logic in GDB's lookup functions to cope with overlapping
> partial symtabs, and they've been working pretty well on our behalf.
> However, they're fragile, and do break in everyday use. For example,
> in the executable produced from the source file above, if you try to
> set a breakpoint on a library routine compiled without debug
> information, GDB will set the breakpoint in `main' instead. (On some
> platforms, `_exit' is such a function.)
This particular problem should be avoidable anyway. I would appreciate
it if you would look at:
< http://sources.redhat.com/ml/gdb/2001-09/msg00068.html >
As far as getting this information from the stabs reader, we should be
able to do it if we know separate "possible" and "definite" ranges, I
think. I'm not sure if we have enough information to do this. We
don't for the general case, but we should generally have one "definite"
range per file (corresponding to the main .text segment). It would be
nice to at least take this region out of any symtabs that seem to
encompass it, so that if the main program is built without
-ffunction-sections, we will behave sanely in the presence of (say)
libstdc++.a.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2001-10-23 16:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-10-23 16:33 Jim Blandy
2001-10-23 16:54 ` Daniel Jacobowitz [this message]
[not found] ` <npsnc965cl.fsf@zwingli.cygnus.com>
2001-10-23 21:42 ` Daniel Jacobowitz
2001-10-24 17:08 ` Jim Blandy
2001-10-24 17:39 ` Daniel Jacobowitz
2001-10-24 1:52 ` Eli Zaretskii
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=20011023195430.A15242@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