diff options
author | Tom de Vries <tdevries@suse.de> | 2024-10-18 00:15:57 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2024-10-18 00:15:57 +0200 |
commit | 3e0c29b24a9adfbbce211c81b3748c197661a63f (patch) | |
tree | 28b4d40ff4f5d182a94c0fa336c0613d85a5c41d /gdb/python | |
parent | aaa4688f9dbbfb0ff887a15703a657180924334d (diff) | |
download | binutils-3e0c29b24a9adfbbce211c81b3748c197661a63f.zip binutils-3e0c29b24a9adfbbce211c81b3748c197661a63f.tar.gz binutils-3e0c29b24a9adfbbce211c81b3748c197661a63f.tar.bz2 |
[gdb/symtab] Fix qualified name for cooked index dump
While looking at the cooked index entry for local variable l4 of function test
in test-case gdb.fortran/logical.exp:
...
$ gdb -q -batch outputs/gdb.fortran/logical/logical \
-ex "maint print objfiles"
...
[9] ((cooked_index_entry *) 0x7fc6e0003010)
name: l4
canonical: l4
qualified: l4
DWARF tag: DW_TAG_variable
flags: 0x2 [IS_STATIC]
DIE offset: 0x17c
parent: ((cooked_index_entry *) 0x7fc6e0002f20) [test]
...
I noticed that while the entry does have a parent, that's not reflected in the
qualified name.
This makes it harder to write test-cases that check the parent of a cooked
index entry.
This is due to the implementation of full_name, which skips printing
parents if the language does not specify an appropriate separator.
Fix this by using "::" as default separator, getting us instead:
...
[9] ((cooked_index_entry *) 0x7f94ec0040c0)
name: l4
canonical: l4
qualified: test::l4
DWARF tag: DW_TAG_variable
flags: 0x2 [IS_STATIC]
DIE offset: 0x17c
parent: ((cooked_index_entry *) 0x7f94ec003fd0) [test]
...
Tested on x86_64-linux.
Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/python')
0 files changed, 0 insertions, 0 deletions