Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jim Blandy <jimb@redhat.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [rfa/dwarf] Support for attributes pointing to a different CU
Date: Thu, 23 Sep 2004 22:19:00 -0000	[thread overview]
Message-ID: <vt2u0tobpf1.fsf@zenia.home> (raw)
In-Reply-To: <20040923045723.GA11871@nevyn.them.org>


Daniel Jacobowitz <drow@false.org> writes:
> This is the last logical piece I could break out of the intercu support. 
> We're almost there.  Only things left after this are dependence tracking
> and the queueing of multiple full CUs - 400 lines or so.
> 
> The core change of this patch is in follow_die_ref.  Instead of taking an
> offset and returning a DIE, it now takes an attribute and the CU in which
> the attribute was found, and returns a DIE and the CU in which the DIE
> was found.
> 
> The bulky text change of this patch is in dwarf2_attr.  It divides into two
> interfaces: anywhere that we are prepared to find a reference to another
> DIE, we need to call dwarf2_attr_with_cu instead.  Then, any further
> operations on the returned reference need to be sure to use the returned CU.
> The reason for this is a little subtle - we're returning a reference.  If
> the reference is, for example, DW_FORM_ref4, then it's an offset within some
> particular CU.  If the attribute containing this reference was found by
> chasing DW_AT_specification, and DW_AT_specification was DW_FORM_ref_addr,
> then the return value of dwarf2_attr_with_cu is a relative offset to a
> different CU than the caller passed in.  So if we are going to follow the
> reference, we need to know the compilation unit in which it resides.

I may be missing something, but it seems to me some of this effort is
necessary because we hold some die references as CU-relative, and
others as .debug_info relative, depending on the form the attribute
happened to use.  Wouldn't it be a simplification to have
read_attribute_value always store all DW_FORM_ref* attributes as
DW_ADDR offsets from the beginning of .debug_info?  Then dwarf2_attr's
interface could remain unchanged, and we could drop all the spec_cu
variables carrying the CU to the next call to
dwarf2_get_ref_die_offset.  Then, dwarf2_get_ref_die_offset could be
deleted altogether, and its calls replaced with uses of DW_ADDR.

(This change wasn't possible in the past because we didn't pass a CU
to dwarf2_attr.)


  reply	other threads:[~2004-09-23 22:19 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-23  4:57 Daniel Jacobowitz
2004-09-23 22:19 ` Jim Blandy [this message]
2004-09-23 22:33   ` Daniel Jacobowitz
2004-09-24  0:34   ` Daniel Jacobowitz
2004-09-28 22:43     ` Jim Blandy
2004-09-28 22:51       ` Jim Blandy
2004-09-28 22:57       ` Jim Blandy
2004-10-04  0:41       ` Daniel Jacobowitz
2004-10-04 22:12         ` Jim Blandy
2004-10-04 23:35           ` Daniel Jacobowitz
2004-10-05  5:13             ` Jim Blandy
2004-09-28 23:07     ` Jim Blandy
2004-10-03 16:28       ` Daniel Jacobowitz
2004-09-29 17:52     ` Jim Blandy
2004-10-03 16:12       ` Daniel Jacobowitz
2004-10-04 21:17         ` Jim Blandy
2004-10-04 21:22           ` Daniel Jacobowitz
2004-10-05  5:07             ` Jim Blandy
2004-10-05 13:48               ` Daniel Jacobowitz
2004-10-05 16:13                 ` Jim Blandy
2004-10-05 16:11               ` Jim Blandy
2004-10-05 18:01                 ` Daniel Jacobowitz
2004-10-05 19:24                   ` Jim Blandy
2004-09-29 17:54     ` Jim Blandy
2004-09-29 19:53     ` Jim Blandy
2004-10-03 16:16       ` Daniel Jacobowitz
2004-09-29 20:19     ` Jim Blandy

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=vt2u0tobpf1.fsf@zenia.home \
    --to=jimb@redhat.com \
    --cc=drow@false.org \
    --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