D&C GLug - Home Page

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

Re: [LUG] gnu compiler experts anywhere?

 

On 04/11/10 09:23, Steve Lee wrote:
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

Ah Ha! Thanks for that - I've just realised the script given in the link Simon Williams gave (http://www.bytetalk.net/2010/07/how-to-generate-seperate-g-symbol-file.html) does strip out the debug info so that should hopefully achieve what I was looking for!
Tom te tom te tom

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