diff options
author | Tom de Vries <tdevries@suse.de> | 2024-09-14 14:09:35 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2024-09-14 14:09:35 +0200 |
commit | 93a20d956e633cc1a87e68d88d2fc51adc787857 (patch) | |
tree | 4c8e4a31768b5865dfbecaf603bc96d215d209b9 /gdb/testsuite/gdb.python/py-strfns.c | |
parent | 2693187cc58db107db4255756aa5dbbe090f3b6e (diff) | |
download | binutils-93a20d956e633cc1a87e68d88d2fc51adc787857.zip binutils-93a20d956e633cc1a87e68d88d2fc51adc787857.tar.gz binutils-93a20d956e633cc1a87e68d88d2fc51adc787857.tar.bz2 |
[gdb/testsuite] Add regression test for PR32158
Consider test-case:
...
namespace ns {
enum class ec {
val2 = 2
};
}
int main () {
return (int)ns::ec::val2;
}
...
compiled with debug info:
...
$ g++ test.c -g
...
When looking at the cooked index entry for val2 using "maint print objfiles",
we get:
...
[7] ((cooked_index_entry *) 0x7f8ecc002ef0)
name: val2
canonical: val2
qualified: ns::val2
DWARF tag: DW_TAG_enumerator
flags: 0x0 []
DIE offset: 0xe9
parent: ((cooked_index_entry *) 0x7f8ecc002e90) [ns]
...
which is wrong, there is no source level entity ns::val2.
This is PR symtab/32158.
This is a regression since commit 4e417d7bb1c ("Change handling of
DW_TAG_enumeration_type in DWARF scanner").
Reverting the commit on current trunk fixes the problem, and gets us instead:
...
[7] ((cooked_index_entry *) 0x7fba70002ef0)
name: val2
canonical: val2
qualified: ns::ec::val2
DWARF tag: DW_TAG_enumerator
flags: 0x0 []
DIE offset: 0xe9
parent: ((cooked_index_entry *) 0x7fba70002ec0) [ec]
...
Add a regression test for this PR in test-case gdb.dwarf2/enum-type-c++.exp.
Tested on x86_64-linux.
Approved-By: Tom Tromey <tom@tromey.com>
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32158
Diffstat (limited to 'gdb/testsuite/gdb.python/py-strfns.c')
0 files changed, 0 insertions, 0 deletions