From: "H. J. Lu" <hjl@lucon.org>
To: GDB <gdb@sources.redhat.com>
Subject: A hack for DW_FORM_ref_addr
Date: Thu, 31 Jul 2003 16:16:00 -0000 [thread overview]
Message-ID: <20030731161619.GA12251@lucon.org> (raw)
In-Reply-To: <20030731051653.GB1170@lucon.org>
On Wed, Jul 30, 2003 at 10:16:53PM -0700, H. J. Lu wrote:
> > >
> > > While waiting for your new DWARF reader, I will see how my hack
> > > goes :-(.
> >
> > Since the die table is hashed by offset (isn't it?), presumably very
> > badly.
>
> It is OK for different compilation units within the same .debug_info
> section.
>
>
FYI, this is the hack I am going to try.
H.J.
----
2003-07-31 H.J. Lu <hongjiu.lu@intel.com>
* dwarf2read.c (dwarf2_build_psymtabs_hard): Read in all
compilation units.
(read_comp_unit): Don't reset die reference table if abfd
is not changed.
--- gdb/dwarf2read.c.ref 2003-07-30 09:43:51.000000000 -0700
+++ gdb/dwarf2read.c 2003-07-31 08:11:23.000000000 -0700
@@ -1195,6 +1195,7 @@ dwarf2_build_psymtabs_hard (struct objfi
struct partial_symtab *pst;
struct cleanup *back_to;
CORE_ADDR lowpc, highpc;
+ struct die_info *dies;
info_ptr = dwarf_info_buffer;
abbrev_ptr = dwarf_abbrev_buffer;
@@ -1280,6 +1281,8 @@ dwarf2_build_psymtabs_hard (struct objfi
dwarf2_read_abbrevs (abfd, &cu_header);
make_cleanup (dwarf2_empty_abbrev_table, cu_header.dwarf2_abbrevs);
+ dies = read_comp_unit (info_ptr, abfd, &cu_header);
+
/* Read the compilation unit die */
info_ptr = read_partial_die (&comp_unit_die, abfd, info_ptr,
&cu_header);
@@ -3653,10 +3656,17 @@ read_comp_unit (char *info_ptr, bfd *abf
struct die_info *first_die, *last_die, *die;
char *cur_ptr;
int nesting_level;
+ static bfd *bfd_die_ref_table;
+
+ if (!bfd_die_ref_table)
+ bfd_die_ref_table = abfd;
- /* Reset die reference table; we are
- building new ones now. */
- dwarf2_empty_hash_tables ();
+ if (bfd_die_ref_table != abfd)
+ {
+ bfd_die_ref_table = abfd;
+ /* Reset die reference table; we are building new ones now. */
+ dwarf2_empty_hash_tables ();
+ }
cur_ptr = info_ptr;
nesting_level = 0;
next prev parent reply other threads:[~2003-07-31 16:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-30 21:42 DW_FORM_ref_addr dosn't work H. J. Lu
2003-07-30 21:45 ` Daniel Jacobowitz
2003-07-30 21:52 ` H. J. Lu
2003-07-30 21:55 ` Daniel Jacobowitz
2003-07-30 22:01 ` H. J. Lu
2003-07-31 5:16 ` H. J. Lu
2003-07-31 16:16 ` H. J. Lu [this message]
2003-07-31 18:22 ` A hack for DW_FORM_ref_addr Daniel Jacobowitz
2003-07-31 18:29 ` H. J. Lu
2003-07-31 22:33 ` Daniel Berlin
2003-07-31 21:21 ` H. J. Lu
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=20030731161619.GA12251@lucon.org \
--to=hjl@lucon.org \
--cc=gdb@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