[Gllug] My and my malloc() problems....

Nix nix at esperi.demon.co.uk
Sun Dec 30 16:34:51 UTC 2001


On Fri, 28 Dec 2001, Vincent AE Scott moaned:
> compiling -g often increase the size of the program in memory, code
> which is not necessarily used while executing your program ( debug stuff
> ).

No. Regardless of the debugging format used (DWARF, DWARF2 or the
horrible stabs that is used on Linux by default), ELF executables and
shared libraries with debugging have their debugging symbols in a
different section (e.g. .stabs), which is not loaded. It is only
referenced by the debugger.

>    if memory corruption is occuring it can happen in the debug part of
> the program, the part of the program that doesnt effect the actual

If there is a debugging mode in the program, then yes, bugs definitely
can occur in it, and indeed are likely to, because the debugging code
will eb relatively lightly tested; just as with error paths, bugs will
cluster there.

But merely compiling with -g should not change the generated code at
all, not one whit, not an iota. (Well, at least, not if GCC is doing the
compilation.)

-- 
`Mmm... Maybe I just like strong women that can hurt me?'
     --- Vadik, on female throat-cutting doctors

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list