From: Tom Tromey <tromey@redhat.com>
To: Doug Evans <dje@google.com>
Cc: gdb-patches@sourceware.org
Subject: Re: FYI: fix latent bug in dw2_find_symbol_file
Date: Fri, 15 Jun 2012 16:17:00 -0000 [thread overview]
Message-ID: <87sjdwsg79.fsf@fleche.redhat.com> (raw)
In-Reply-To: <CADPb22RUC-_nQfiVFtkjBAEJjadqYnUXC0nj0z6+6Rs4eQKbKQ@mail.gmail.com> (Doug Evans's message of "Mon, 11 Jun 2012 13:49:54 -0700")
>>>>> "Doug" == Doug Evans <dje@google.com> writes:
Doug> You need to call init_cutu_and_read_dies in both debug-types and
Doug> non-debug-types cases.
Here's the patch I'm checking in.
Doug patiently walked me through the setup. Thanks, Doug.
For the record, you must:
* Build the google/gcc-4_6 branch of gcc
* Build CVS HEAD binutils and arrange for gold to be built and be
the installed 'ld'
* Run the test suite like so:
runtest {C,CXX}FLAGS_FOR_TARGET='-g -gdwarf-4 -gfission -Wl,--gdb-index' GDB='../gdb --use-deprecated-index-sections'
Even with this I couldn't see a regression, I think because I forgot to
build the Objective C compiler (for the dwz branch, the failure that
motivated the initial patch came from the gdb.objc).
Doug showed me a simple reproducer, though, and I've incorporated this
into the patch.
Built and regtested on x86-64 Fedora 16.
Tom
2012-06-15 Tom Tromey <tromey@redhat.com>
* dwarf2read.c (dw2_find_symbol_file): Unconditionally use
init_cutu_and_read_dies.
2012-06-15 Tom Tromey <tromey@redhat.com>
* gdb.cp/namespace.exp: Add "show lang" test.
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 1fdd819..a8cd158 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -2906,12 +2906,8 @@ dw2_find_symbol_file (struct objfile *objfile, const char *name)
if (per_cu->v.quick->symtab != NULL)
return per_cu->v.quick->symtab->filename;
- if (per_cu->is_debug_types)
- init_cutu_and_read_dies (per_cu, 0, 0, dw2_get_primary_filename_reader,
- &filename);
- else
- init_cutu_and_read_dies_simple (per_cu, dw2_get_primary_filename_reader,
- &filename);
+ init_cutu_and_read_dies (per_cu, 0, 0, dw2_get_primary_filename_reader,
+ &filename);
return filename;
}
diff --git a/gdb/testsuite/gdb.cp/namespace.exp b/gdb/testsuite/gdb.cp/namespace.exp
index cf5a858..82018c6 100644
--- a/gdb/testsuite/gdb.cp/namespace.exp
+++ b/gdb/testsuite/gdb.cp/namespace.exp
@@ -66,6 +66,7 @@ gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
+gdb_test "show lang" "auto; currently c\\+\\+.*"
#
# set it up at a breakpoint so we can play with the variable values
prev parent reply other threads:[~2012-06-15 16:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-11 18:42 Tom Tromey
2012-06-11 20:50 ` Doug Evans
2012-06-11 20:57 ` Tom Tromey
2012-06-11 21:08 ` Doug Evans
2012-06-11 21:26 ` Doug Evans
2012-06-13 22:10 ` Cary Coutant
2012-06-13 23:00 ` Tom Tromey
2012-06-12 15:40 ` Tom Tromey
2012-06-15 16:17 ` Tom Tromey [this message]
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=87sjdwsg79.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=dje@google.com \
--cc=gdb-patches@sourceware.org \
/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