[commited] Detect bad debug info

Daniel Jacobowitz drow@false.org
Mon Sep 22 12:50:00 GMT 2008

On Mon, Sep 22, 2008 at 10:41:29AM +0100, Andrew Stubbs wrote:
> Mark Kettenis wrote:
>> Would it be possible to add some detail about this?  "a particular
>> falvour of bad debug info" is pretty non-informative.
> Sorry, you've caught me out. :)
> I don't really know in what way the debug info was bad. I only have a bad 
> binary (no source code, no compiler). I suspect that it had marked an a 
> array as being in registers, rather than a pointer to the array, but it 
> doesn't really matter. What I do know is that the effect was that the 
> debugger was attempting to read an impossibly large quantity of data from 
> the register file. The result was a assertion failure and a bad user 
> experience.

You are correct.  Something was confused by the automatic decay of
arrays to pointers, and there was a DW_OP_reg0 instead of DW_OP_breg0
because of that.

> The patch ensures that the debugger never attempts to read beyond the end 
> of the register file.

Could you explain this in the code?  I think it's more enlightening
than "bad debug info".

Daniel Jacobowitz

More information about the Gdb mailing list