From: Daniel Jacobowitz <drow@mvista.com>
To: Michal Ludvig <mludvig@suse.cz>
Cc: GDB Patches <gdb-patches@sources.redhat.com>
Subject: Re: [RFA] Location list support
Date: Fri, 21 Feb 2003 17:11:00 -0000 [thread overview]
Message-ID: <20030221171139.GA14877@nevyn.them.org> (raw)
In-Reply-To: <3E560801.6080703@suse.cz>
On Fri, Feb 21, 2003 at 12:05:37PM +0100, Michal Ludvig wrote:
> Hi,
> attached is a patch that adds support for .debug_loc sections as
> generated by newer versions of GCC (eg. from rtlopt-branch).
>
> It works in this way:
> - Parse .debug_loc into a list of new internal structures (struct
> loclist_master, struct loclist_block). Each loclist_master belongs to
> one variable and contains a pointer to a chain of loclist_blocks that
> represent different locations where the given variable can be found
> during it's life.
> - Next the .debug_info is parsed and when a new symbol is being added,
> the function new_symbol() first checks, if it's location is described by
> a location list or not. If not, then the old method is used. If there is
> a location list (in loclist_master) found for this variable, each one of
> its loclist_blocks is parsed and added to symbol.loclist chain. The
> structure symbol itself is filled up with the first loclist entry found
> for this symbol (ie with the values for the lowest PC where the symbol
> is valid).
> - When the variable's value is to be read (in read_var_value()), it's
> first checked if there is a non-null loclist pointer in variable's
> 'symbol' structure. If not, everything continued like it did until now.
> If there is a loclist it's searched for a block valid for the actual PC
> and if found, the variable is updated with description found there. If a
> valid block is not found, it's assumed that a variable was already
> optimized out on this PC and again the symbol structure is updated in an
> appropriate way.
>
> Comments? Approvals?
Let me try saying this again... Michal, are you watching GDB HEAD
development? Have you been following my discussions with Jim about how
DW_AT_location should be supported? I didn't just ask you to wait for
the LOC_COMPUTED patch out of sheer pique. If you're not using that
mechanism, then you're defeating the whole purpose it was implemented
for.
For instance, a good sized chunk of code you delete in the patch below
is no longer there. Be careful updating, since you copied that deleted
code to new functions; it shouldn't be there either.
Basically, location lists should be represented as LOC_COMPUTED
symbols; the LOC_COMPUTED lookup mechanism should be updated to accept
a PC when computing the location. The entire thing will be worlds
simpler than all the work you did below, and a heck of a lot less
fragile. You just need to parse the location lists, store them in the
location baton, and select a list to evaluate in dwarf2loc.c. If
there's no list entry for $pc, that's where you return optimized-out;
it might take another little change to accept an optimized-out result
there. If there is a list entry you evaluate it just like presently.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2003-02-21 17:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-21 11:06 Michal Ludvig
2003-02-21 17:11 ` Daniel Jacobowitz [this message]
2003-02-21 23:09 ` Michal Ludvig
2003-02-21 17:47 ` Keith Walker
2003-02-21 18:02 ` Daniel Jacobowitz
-- strict thread matches above, loose matches on Subject: below --
2003-02-01 7:50 Michal Ludvig
2003-02-01 16:57 ` 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=20030221171139.GA14877@nevyn.them.org \
--to=drow@mvista.com \
--cc=gdb-patches@sources.redhat.com \
--cc=mludvig@suse.cz \
/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