[PATCH] Fix dwarf-lineinfo inconsistency of inlined subroutines

Alexandre Oliva oliva@gnu.org
Tue Nov 19 02:08:00 GMT 2019


Hello, Bernd,

Apologies for taking so long to respond.  I had not noticed your patch
before being explicitly copied on it.

IIUC you're describing a problem in GDB, that could be summed up as its
not paying attention to is_stmt and being unaware of location views, and
you appear to be proposing to work around that by changing what AFAICT
is a correct line number program into one that, though incorrect, will
get more desirable behavior out of current GDB.

If that is so, I'm inclined to disagree that this is a desirable change.
We should strive to generate correct, rather than incorrect debug
information.  It was foreseen and expected that statement frontiers and
location views would introduce occasional behavior regressions in
debuggers unable to consume this information; what was not expected was
that debuggers would lack support for it for so long.

I'd much rather make debug info incorrect, and instead introduce support
for the extended debug info in consumers.  I realize it would take a lot
more work to implement a proper fix there, however.  Unfortunately, I
don't know of anyone currently working on that counterpart
implementation, so the best recommendation I can offer to avoid this
problem is to disable statement frontiers (-gno-statement-frontiers) and
location views (-gno-variable-location-views).  This will get you line
number programs and location lists that do not exercise features that
GDB is not aware of.

Perhaps we should change our defaults, if the situation with GDB does
not change :-(

-- 
Alexandre Oliva, freedom fighter   he/him   https://FSFLA.org/blogs/lxo
Free Software Evangelist           Stallman was right, but he's left :(
GNU Toolchain Engineer    FSMatrix: It was he who freed the first of us
FSF & FSFLA board member                The Savior shall return (true);



More information about the Gcc-patches mailing list