From: Joel Brobecker <brobecker@adacore.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch/rfc] Recognize non-DW_AT_location <value optimized out> symbols
Date: Fri, 20 Mar 2009 18:39:00 -0000 [thread overview]
Message-ID: <20090320182215.GC12530@adacore.com> (raw)
In-Reply-To: <20090320150248.GA12530@adacore.com>
[-- Attachment #1: Type: text/plain, Size: 2382 bytes --]
> > * zero-length DW_AT_location should be the same as missing DW_AT_location.
> > https://fedorahosted.org/pipermail/elfutils-devel/2009-March/000180.html
Here a few thoughts after looking more closely at this. After reproducing
the problem thanks to your testsuite patch, I initially did the same thing
as you did, which was to add the symbol for local symbols as well.
But that caused the regressions you mentioned in one of the C++ testcases.
It's about a variable that's declared inside an anonymous namespaces.
I think that our mistake was to add all non-external variables without
checking that they were "complete" yet. Thus, I changed the patch to
the attached. Basically, if it is a non-external symbol but at the same
time a "declaration", then we should wait for the "defining" declaration
before adding it to the current local scope.
That fixes the C++ problem, and I was fairly confident about it but
a testcase run seems to indicate the following regressions:
+------------+------------+----------------------------------------------------+
| PASS | FAIL | callfuncs.exp: gdb function calls preserve reg ... |
| | | ... ister contents |
| PASS | FAIL | callfuncs.exp: continue after stop in call dum ... |
| | | ... my preserves register contents |
| PASS | FAIL | callfuncs.exp: finish after stop in call dummy ... |
| | | ... preserves register contents |
| PASS | FAIL | callfuncs.exp: return after stop in call dummy ... |
| | | ... preserves register contents |
| PASS | FAIL | callfuncs.exp: nested call dummies preserve re ... |
| | | ... gister contents |
+------------+------------+----------------------------------------------------+
I'm a little surprised at these regressions, as I don't see how
the dwarf2read change we're making can have an impact on this.
It's particularly more puzzling that I did a diff of the exact
output of before and after taken from the gdb.log file, and diff
said there was no difference. I'm rerunning the testsuite now,
to see if it might be transient, but I'm wondering if I'm looking
at the right reference output....
--
Joel
[-- Attachment #2: loc.diff --]
[-- Type: text/x-diff, Size: 666 bytes --]
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index feb57b0..cba9d75 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -7658,6 +7658,12 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
SYMBOL_CLASS (sym) = LOC_UNRESOLVED;
add_symbol_to_list (sym, &global_symbols);
}
+ else if (!die_is_declaration (die, cu))
+ {
+ /* Use the default LOC_OPTIMIZED_OUT class. */
+ gdb_assert (SYMBOL_CLASS (sym) == LOC_OPTIMIZED_OUT);
+ add_symbol_to_list (sym, cu->list_in_scope);
+ }
}
break;
case DW_TAG_formal_parameter:
next prev parent reply other threads:[~2009-03-20 18:22 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-16 21:15 Jan Kratochvil
2009-03-20 15:17 ` Joel Brobecker
2009-03-20 15:51 ` Joel Brobecker
2009-03-20 18:22 ` Jan Kratochvil
2009-03-20 18:39 ` Joel Brobecker [this message]
2009-03-20 18:51 ` [patch] Racy FAIL: gdb.base/auxv.exp + gdb.base/callfuncs.exp [Re: [patch/rfc] Recognize non-DW_AT_location <value optimized out> symbols] Jan Kratochvil
2009-03-20 19:54 ` Joel Brobecker
2009-03-20 21:54 ` Daniel Jacobowitz
2009-03-23 17:36 ` Joel Brobecker
2009-03-23 17:45 ` Jan Kratochvil
2009-03-23 22:52 ` Joel Brobecker
2009-03-24 23:50 ` [patch/rfc] Recognize non-DW_AT_location <value optimized out> symbols [Re: [patch] Racy FAIL: gdb.base/auxv.exp + gdb.base/callfuncs.exp] Jan Kratochvil
2009-03-25 10:03 ` [patch/rfc] Recognize non-DW_AT_location <value optimized out> symbols Jan Kratochvil
2009-03-26 0:38 ` Joel Brobecker
2009-03-26 17:02 ` Jan Kratochvil
2009-03-20 19:18 ` Joel Brobecker
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=20090320182215.GC12530@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@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