From: Tom Tromey <tromey@redhat.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: Joel Brobecker <brobecker@adacore.com>, gdb-patches@sourceware.org
Subject: Re: Regression for gdb.base/sigstep.exp with .debug_types
Date: Fri, 09 Dec 2011 20:50:00 -0000 [thread overview]
Message-ID: <m3wra5ebvq.fsf@fleche.redhat.com> (raw)
In-Reply-To: <20111209171937.GA30594@host2.jankratochvil.net> (Jan Kratochvil's message of "Fri, 9 Dec 2011 18:19:37 +0100")
>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:
Jan> list static-method.cc:xxx::(anonymous namespace)::A::func
Jan> -26 static int func (void) { return 0; } // xxx::A::func
Jan> -(gdb) PASS: gdb.cp/static-method.exp: list
Jan> static-method.cc:xxx::(anonymous namespace)::A::func
Jan> +Function "xxx::(anonymous namespace)::A::func" not defined in
Jan> "static-method.cc".
Jan> +(gdb) FAIL: gdb.cp/static-method.exp: list
Jan> static-method.cc:xxx::(anonymous namespace)::A::func
I am not completely sure this is a bug.
In this case, g++ puts the class "A" into a .debug_types TU.
There is no link from the .debug_info CU to this TU -- the first thing I
don't understand, I would have expected something.
Second, the CU looks like this:
<2><38>: Abbrev Number: 10 (DW_TAG_namespace)
<39> DW_AT_sibling : <0x49>
[...]
<1><51>: Abbrev Number: 13 (DW_TAG_class_type)
<52> DW_AT_name : A
<54> DW_AT_declaration : 1
<54> DW_AT_sibling : <0x65>
<2><58>: Abbrev Number: 6 (DW_TAG_subprogram)
<59> DW_AT_name : (indirect string, offset: 0x0): func
<5d> DW_AT_decl_file : 1
<5e> DW_AT_decl_line : 26
<5f> DW_AT_type : <0x65>
<63> DW_AT_accessibility: 1 (public)
<64> DW_AT_declaration : 1
Here, "A" is a declaration without a size, so it is ignored by
process_structure_scope.
Now consider the linespec:
static-method.cc:xxx::(anonymous namespace)::A::func
This means to find definitions of "xxx::(anonymous namespace)::A::func"
defined in static-method.cc.
There are two definitions of this function in the debuginfo.
One is in the CU, but it is ignored when reading debuginfo because class
A is dropped.
One is in the TU, but it is ignored because TUs do not have line
headers, and so the symtab is anonymous -- and so doesn't match
"static-method.cc".
So, what to do?
Perhaps g++ is wrong not to emit some CU->TU linkage. If this existed
then maybe we could make a symbol in the CU pointing to the type,
presumably making this test work.
Perhaps the DW_AT_declaration treatment in process_structure_scope is a
bug -- but I would be cautious about changing this before a release.
Let me know what you think.
Tom
next prev parent reply other threads:[~2011-12-09 20:20 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-05 8:19 creating the gdb-7.4 branch tomorrow (?) Joel Brobecker
2011-12-06 18:45 ` Tom Tromey
2011-12-06 18:53 ` Tom Tromey
2011-12-06 18:54 ` Tom Tromey
2011-12-06 19:05 ` Tom Tromey
2011-12-06 19:05 ` Tom Tromey
2011-12-06 19:07 ` Tom Tromey
2011-12-06 19:10 ` Tom Tromey
2011-12-07 4:09 ` Hui Zhu
2011-12-07 9:54 ` Joel Brobecker
2011-12-07 16:24 ` Stan Shebs
2011-12-07 23:50 ` Stan Shebs
2011-12-08 8:22 ` Joel Brobecker
2011-12-07 9:11 ` Jan Kratochvil
2011-12-07 10:01 ` Joel Brobecker
2011-12-08 15:33 ` FYI: fixlet in ovsrch.exp (Was: creating the gdb-7.4 branch tomorrow (?)) Tom Tromey
2011-12-09 17:17 ` Regression for gdb.base/sigstep.exp with .debug_types [Re: creating the gdb-7.4 branch tomorrow (?)] Jan Kratochvil
2011-12-09 17:26 ` Regression for gdb.base/sigstep.exp with .debug_types Jan Kratochvil
2011-12-09 20:50 ` Tom Tromey [this message]
2011-12-09 21:55 ` Jan Kratochvil
2011-12-10 9:46 ` Tom Tromey
2011-12-10 19:27 ` [commit] testsuite: KFAIL gdb.cp/static-method.exp [Re: Regression for gdb.base/sigstep.exp with .debug_types] Jan Kratochvil
2011-12-11 9:26 ` Joel Brobecker
2011-12-11 12:42 ` Jan Kratochvil
2011-12-11 12:46 ` Joel Brobecker
2011-12-14 19:02 ` [patch] gcc KFAILs to XFAILs [Re: [commit] testsuite: KFAIL gdb.cp/static-method.exp] Jan Kratochvil
2011-12-14 19:43 ` Doug Evans
2011-12-14 19:51 ` [doc patch] gdbint: XFAIL vs. KFAIL [Re: [patch] gcc KFAILs to XFAILs] Jan Kratochvil
2011-12-15 5:33 ` Eli Zaretskii
2011-12-19 11:16 ` Jan Kratochvil
2011-12-19 13:41 ` Eli Zaretskii
2011-12-19 13:42 ` [commit] " Jan Kratochvil
2011-12-19 13:43 ` [commit] [patch] gcc KFAILs to XFAILs [Re: [commit] testsuite: KFAIL gdb.cp/static-method.exp] Jan Kratochvil
2011-12-09 20:17 ` Regression for gdb.base/sigstep.exp with .debug_types [Re: creating the gdb-7.4 branch tomorrow (?)] Tom Tromey
2011-12-09 20:20 ` Jan Kratochvil
2011-12-09 17:17 ` Crash regression for gdb.base/ending-run.exp " Jan Kratochvil
2011-12-09 19:05 ` Tom Tromey
2011-12-09 21:00 ` Jan Kratochvil
2011-12-14 11:52 ` creating the gdb-7.4 branch tomorrow (?) Andreas Schwab
2011-12-14 13:20 ` Joel Brobecker
2011-12-14 13:34 ` Andreas Schwab
2011-12-14 19:28 ` Joel Brobecker
2011-12-14 21:16 ` Andreas Schwab
2011-12-14 21:31 ` Joel Brobecker
2011-12-14 22:06 ` Andreas Schwab
2011-12-15 17:43 ` Tom Tromey
2012-07-22 19:41 ` Andreas Schwab
2012-08-15 19:34 ` Tom Tromey
2012-08-22 14:23 ` Tom Tromey
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=m3wra5ebvq.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=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