https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101598

--- Comment #6 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
(In reply to Tom de Vries from comment #4)
> (In reply to Bernd Edlinger from comment #2)
> > Yes, but it wont fix dwarf-4 and also not the case
> > when this is not the first function. then we'll
> > have the .loc from the previous function extend to this one.
> 
> I just tried out:
> - dwarf-4
> - manually changing order of defs__f1 and defs__struct1IP in .s file
> 
> The result look fine to me.  So please show a concrete example where this
> produces wrong results.


I did the same.
The effect I meant is the following which is basically PR97937
The line number from the previous function defs__f1 extends to
defs__structIP.

So when I debug this I see the following:
Reading symbols from ./formatted_ref...
(gdb) b defs__struct1IP 
Breakpoint 1 at 0x402faa: file defs.adb, line 21.
(gdb) r
Starting program:
/home/ed/gnu/binutils-gdb/gdb/testsuite/gdb.ada/formatted_ref/formatted_ref 

Breakpoint 1, 0x0000000000402faa in defs__struct1IP () at defs.adb:21
21         end F1;


This here the line number is totally misleading.
So to me it appears, that PR101575 is just the evil
twin brother of PR97937.

And indeed the fix for PR97937 - excluding the really
not debuggable funtions from the debug ranges -
is not sufficient to get rid of the bogus line table
entries from PR101575.

So I start to think that emitting a dummy .file table entry
as you suggest is the way to go, but I would like not to
break the fix for PR97937 at the same time.

Reply via email to