]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
[gdb/cli] Show LOC_CONST_BYTES var for info locals
authorTom de Vries <tdevries@suse.de>
Mon, 6 Jan 2025 17:48:58 +0000 (18:48 +0100)
committerTom de Vries <tdevries@suse.de>
Mon, 6 Jan 2025 17:48:58 +0000 (18:48 +0100)
commit91f95754097398fdfa076f5f1cf46f1e2ebc6b38
treeaacda86c6c49d941775d033d3a1e2c2969eed6f4
parentf25d22bad46b5914e4ac18362442237757f1eb89
[gdb/cli] Show LOC_CONST_BYTES var for info locals

PR cli/32525 reports that a variable with this DWARF:
..
<2><423>: Abbrev Number: 14 (DW_TAG_variable)
    <424>   DW_AT_name        : var1867
    <42a>   DW_AT_type        : <0x2f8>
    <42e>   DW_AT_const_value : 8 byte block: 0 0 0 0 0 0 0 0
...
is not shown by info locals.

Fix this by handling LOC_CONST_BYTES in iterate_over_block_locals.

Tested on x86_64-linux.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32525

Approved-By: Tom Tromey <tom@tromey.com>
gdb/stack.c
gdb/testsuite/gdb.dwarf2/info-locals-optimized-out.exp