From: Daniel Jacobowitz <drow@false.org>
To: Bryce McKinlay <mckinlay@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: Patch: DWARF2 location lists vs. shared libraries
Date: Wed, 05 May 2004 04:03:00 -0000 [thread overview]
Message-ID: <20040505040344.GA28793@nevyn.them.org> (raw)
In-Reply-To: <40983940.3050003@redhat.com>
On Tue, May 04, 2004 at 08:45:52PM -0400, Bryce McKinlay wrote:
> 2004-05-04 Bryce McKinlay <mckinlay@redhat.com>
>
> * dwarf2read.c (dwarf2_symbol_mark_computed): Use ANOFFSET to
> adjust baton's base_address for shared libraries.
I spoke briefly to Bryce about this (on IRC).
I think the right thing to do would be to add the offset when
searching, rather than when saving. This will help us with relocating
objfiles, which I think would be good to support - that way we can
cache debug info for unchanged shared libraries across runs.
Does this make sense to others? I'll try to write the patch tomorrow
or Thursday.
>
> Index: dwarf2read.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/dwarf2read.c,v
> retrieving revision 1.150
> diff -u -r1.150 dwarf2read.c
> --- dwarf2read.c 4 May 2004 00:11:25 -0000 1.150
> +++ dwarf2read.c 5 May 2004 00:41:00 -0000
> @@ -8662,6 +8662,7 @@
> if (attr->form == DW_FORM_data4 || attr->form == DW_FORM_data8)
> {
> struct dwarf2_loclist_baton *baton;
> + CORE_ADDR base_offset;
>
> baton = obstack_alloc (&cu->objfile->objfile_obstack,
> sizeof (struct dwarf2_loclist_baton));
> @@ -8671,7 +8672,10 @@
> don't run off the edge of the section. */
> baton->size = dwarf2_per_objfile->loc_size - DW_UNSND (attr);
> baton->data = dwarf2_per_objfile->loc_buffer + DW_UNSND (attr);
> - baton->base_address = cu->header.base_address;
> + /* Set base_address, adjusting for shared libraries. */
> + base_offset = ANOFFSET (cu->objfile->section_offsets,
> + SECT_OFF_TEXT (cu->objfile));
> + baton->base_address = cu->header.base_address + base_offset;
> if (cu->header.base_known == 0)
> complaint (&symfile_complaints,
> "Location list used without specifying the CU base address.");
--
Daniel Jacobowitz
next prev parent reply other threads:[~2004-05-05 4:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-05 0:45 Bryce McKinlay
2004-05-05 4:03 ` Daniel Jacobowitz [this message]
2004-05-05 5:59 ` Jim Blandy
2004-05-07 23:31 ` Bryce McKinlay
2004-05-12 1:34 ` Daniel Jacobowitz
2004-05-12 22:03 ` Jim Blandy
2004-05-12 23:35 ` Bryce McKinlay
[not found] ` <40A3B128.5040309@redhat.com>
2004-05-13 17:37 ` Patch: [commited] " Daniel Jacobowitz
2004-05-14 1:42 ` Bryce McKinlay
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=20040505040344.GA28793@nevyn.them.org \
--to=drow@false.org \
--cc=gdb-patches@sources.redhat.com \
--cc=mckinlay@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