public inbox for gdb-prs@sourceware.org help / color / mirror / Atom feed
From: "ssbssa at sourceware dot org" <sourceware-bugzilla@sourceware.org> To: gdb-prs@sourceware.org Subject: [Bug gdb/30315] GDB not showing variable that is supposed to be there Date: Sat, 20 Jan 2024 16:19:39 +0000 [thread overview] Message-ID: <bug-30315-4717-psG4kSoDyc@http.sourceware.org/bugzilla/> (raw) In-Reply-To: <bug-30315-4717@http.sourceware.org/bugzilla/> https://sourceware.org/bugzilla/show_bug.cgi?id=30315 Hannes Domani <ssbssa at sourceware dot org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ssbssa at sourceware dot org --- Comment #2 from Hannes Domani <ssbssa at sourceware dot org> --- I've debugged it to this location of read_lexical_block_scope in dwarf2/read.c: ``` case PC_BOUNDS_NOT_PRESENT: /* DW_TAG_lexical_block has no attributes, process its children as if there was no wrapping by that DW_TAG_lexical_block. GCC does no longer produces such DWARF since GCC r224161. */ ``` The inner { int i; } block is optimized away, and apparently gcc produces this kind of block here in this case. Which means gdb moves up the i variable to the for{} block, and that's why it's found by print. As a test I've just put a return in this case block, then gdb found the correct i also in this location: ``` (gdb) n 12 b = 0; (gdb) p i $2 = 4 (gdb) info addr i Symbol "i" is multi-location: Base address 0x140001609 Range 0x13f2e1609-0x13f2e1609: the constant 0 Range 0x13f2e1609-0x13f2e1609: the constant 1 Range 0x13f2e1609-0x13f2e1609: the constant 2 Range 0x13f2e1609-0x13f2e1609: the constant 3 Range 0x13f2e1609-0x13f2e161c: the constant 4 ``` I'm not sure what the correct solution here is. -- You are receiving this mail because: You are on the CC list for the bug.
next prev parent reply other threads:[~2024-01-20 16:19 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-04-05 13:39 [Bug gdb/30315] New: " hluaw at connect dot ust.hk 2023-04-05 14:36 ` [Bug gdb/30315] " tromey at sourceware dot org 2024-01-20 16:19 ` ssbssa at sourceware dot org [this message] 2024-01-20 16:34 ` ssbssa at sourceware dot org
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=bug-30315-4717-psG4kSoDyc@http.sourceware.org/bugzilla/ \ --to=sourceware-bugzilla@sourceware.org \ --cc=gdb-prs@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: linkBe 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; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).