From: "Elmenthaler, Jens" <JENS.ELMENTHALER@advantest.com>
To: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: gdb bug or corrupt dwarf info?
Date: Thu, 28 Mar 2013 11:40:00 -0000 [thread overview]
Message-ID: <CEA8125BCE884349929B204B961E547128E06D8F@DEBOSVPEX001.ent.rt.verigy.net> (raw)
Hi,
I'm currently investigation why gdb is only showing 'i' as local variable in the following loop body, and not also 'text':
for (int i = 0; i < 5; i++) {
const char *text = "sabel";
cerr << "text=" << text << endl; // Suspended here
}
The corresponding output of objdump -W yields the following:
<2><74105>: Abbrev Number: 264 (DW_TAG_lexical_block)
DW_AT_sibling : <7411e>
DW_AT_ranges : 0
<3><7410f>: Abbrev Number: 235 (DW_TAG_variable)
DW_AT_name : i
DW_AT_decl_file : 1
DW_AT_decl_line : 6962
DW_AT_type : <23cd>
DW_AT_location : 2 byte block: 91 68 (DW_OP_fbreg: -24)
<2><7411e>: Abbrev Number: 245 (DW_TAG_lexical_block)
DW_AT_low_pc : 0x7b108
DW_AT_high_pc : 0x7b14c
<3><74128>: Abbrev Number: 235 (DW_TAG_variable)
DW_AT_name : text
DW_AT_decl_file : 1
DW_AT_decl_line : 6963
DW_AT_type : <11f85>
DW_AT_location : 2 byte block: 91 6c (DW_OP_fbreg: -20)
Contents of the .debug_ranges section:
Offset Begin End
00000000 0007b0dd 0007b0f2
00000000 0007b108 0007b156
00000000 <End of list>
So my question now is, whether this is a gdb bug which I possibly could fix, or whether the debug info is broken.
In my opinion it looks suspicious that the lexical block containing 'text' is not a child of the lexical block containing 'i', but a sibling.
Can someone provide a hint?
Greetings, Jens.
next reply other threads:[~2013-03-28 11:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-28 11:40 Elmenthaler, Jens [this message]
2013-03-28 20:46 ` Tom Tromey
2013-04-18 11:47 ` Elmenthaler, Jens
2013-04-23 18:08 ` 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=CEA8125BCE884349929B204B961E547128E06D8F@DEBOSVPEX001.ent.rt.verigy.net \
--to=jens.elmenthaler@advantest.com \
--cc=gdb@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