https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101575
--- Comment #5 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Bernd Edlinger from comment #4)
> Hi,
>
> I think my commit e69ac020372 ("Add line debug info for virtual thunks")
> has a mitigating effect on this test case:
> due to such functions have DECL_IGNORED_P
> they are excluded from the debug_range info,
> and therfore gdb should ignore the bogus line tables.
>
> However, I applied this only in the trunk, not the gcc-11 branch.
Thanks for mentioning this, that's very helpful.
I've:
- build gcc-11-branch
- reproduced the problem
- applied the patch (it applied cleanly)
- observed that the problem is gone.
More specifically, it's gone because we have:
...
$ more defs.s
.file "defs.adb"
.text
.Ltext0:
.align 2
.globl defs__struct1IP
.type defs__struct1IP, @function
defs__struct1IP:
.LFB2:
.cfi_startproc
.file 1 "defs.ads"
.loc 1 18 9
...