diff options
author | Tom de Vries <tdevries@suse.de> | 2024-10-29 10:08:04 +0100 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2024-10-29 10:08:04 +0100 |
commit | 80ac47851105702689004e07952ab6a4c04062b0 (patch) | |
tree | 1746aa8c0b6ff18e7c2ba45cb37a62ccf5521847 /gdb/python/py-finishbreakpoint.c | |
parent | b0fdcd470653d10612aad561cc06098d3fa5ba17 (diff) | |
download | gdb-80ac47851105702689004e07952ab6a4c04062b0.zip gdb-80ac47851105702689004e07952ab6a4c04062b0.tar.gz gdb-80ac47851105702689004e07952ab6a4c04062b0.tar.bz2 |
[gdb/symtab] Handle multiple .debug_info sections
When compiling dw2-multiple-debug-info.c using -gdwarf-5
-fdebug-types-section, we end with two .debug_info sections in the object
file:
...
$ g++ gdb.dwarf2/dw2-multiple-debug-info.c -c -g \
-gdwarf-5 \
-fdebug-types-section
$ readelf -WS dw2-multiple-debug-info.o | grep -v RELA | grep .debug_info
[10] .debug_info PROGBITS 0 000128 0000cd 00 GC 0 0 8
[12] .debug_info PROGBITS 0 0001f8 0000ad 00 C 0 0 8
...
One of them contains the CU for dw2-multiple-debug-info.c, the other contains
the TU for the type of variable a.
When trying to print the type of variable a, we get:
...
$ gdb -q -batch dw2-multiple-debug-info.o -ex "ptype a"
'a' has unknown type; cast it to its declared type
...
because the TU hasn't been read.
Fix this by adding support for reading multiple .debug_info sections, similar
to how that is done for multiple .debug_types sections, getting us instead:
...
$ gdb -q -batch dw2-multiple-debug-info.o -ex "ptype a"
type = class sp1::A {
...
}
...
Tested on x86_64-linux.
PR symtab/32223
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32223
Diffstat (limited to 'gdb/python/py-finishbreakpoint.c')
0 files changed, 0 insertions, 0 deletions