[PATCH][gdb/symtab] Handle .gdb_index in ada language mode
Tom de Vries
tdevries@suse.de
Wed May 20 09:40:21 GMT 2020
On 19-05-2020 22:32, Tom Tromey wrote:
>>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
>
> Tom> Fix the inconsistency by completing implementation of
> Tom> dw2_map_matching_symbols.
>
> Thanks for doing this.
>
> Tom> Tested on x86_64-linux, both with native and target board
> Tom> cc-with-debug-index.
>
> Tom> Any comments?
>
> This may be the only barrier to supporting Ada in .gdb_index.
> So, it seems like the Ada check in dwarf2/index-write.c should probably
> be removed as well...?
>
> I'm not 100% sure whether it will work or not.
Using this patch, I managed to get it working.
The patch does the following:
- enable ada .gdb_index by removing the ada check in write_psymbols
- copy some ada-specific code from debug_names::insert to
write_psymbols
- disable a workaround for gold/15646 in dw2_expand_marked_cus
As for the disabled workaround, I ran into trouble in
gdb.ada/access_tagged_param.exp, where setting a breakpoint on foo failed.
The index shows that there are two entries for foo, one variable, one
function:
...
[3733] foo:
3 [global, variable]
5 [global, function]
...
The workaround skips the function, so disabling the workaround allows
the test to pass (my guess atm is that the workaround is not precise
enough).
FWIW, if I use .debug_names instead, I see the same pattern:
...
[445] #0b887389 foo:
<6> DW_TAG_subprogram DW_IDX_compile_unit=5 DW_IDX_GNU_external=1
<2> DW_TAG_variable DW_IDX_compile_unit=3 DW_IDX_GNU_external=1
...
Thanks,
- Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-try.patch
Type: text/x-patch
Size: 3472 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/gdb-patches/attachments/20200520/45c11696/attachment.bin>
More information about the Gdb-patches
mailing list