D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] gnu compiler experts anywhere?

 

On 3 November 2010 12:38, tom <tompotts@xxxxxxxxxxxxxxxxxxxxxx> wrote:
> I should have added that compiling for debugging makes the damn thing work.
> If I could work out what was happening in the program I'd write some unit
> tests...

Oh I recall those sort of bugs. Python rocks. Usually either stack use
as debug puts in probes and guards, or free heap for similar reasons.
Look for dodgy pointer derefs or assumptions about array sizes that
are wrong (1 past end etc). Rarely optimisations expose a latent bug
by reorganising code. Have you tried a debug malloc or some such?

> It should be possible to generate a separate symbol file that the debugger
> can use to follow the code after a segfault rather than adding it to the
> executable.

You'd also need to ensure the only difference is the symbols (and you
used to use 'strip' to take them out for release) . It's likely the
build turns on other options or you have conditional code on DEBUG.

Steve

-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq