Simon Biber wrote:
jacob navia wrote:
Davy wrote:
Hi all,
I use VC and gcc/gdb to compile and debug C/C++ files. But I found some
of the debug version of the compiled files are too large to be run in a
small RAM. Can I compile C/C++ Debug partially?
Something like:
fileA.c fileB.c
And I can compile fileA.c with debug info and compile fileB.c without
debug info?
Any suggestions will be appreciated!
Best regards,
Davy
You are probably not aware that debug information
will NOT be loaded into RAM unless a debugger is
present.
That's quite a strong statement! Are you sure that it's true of all C
implementations on all platforms? Or just your own lcc-win32?
For the Visual C compiler of Microsoft the debug info is not even
in the executable but in the program database (.pdb files). So it
would be VERY surprising that it would be loaded into memory.
Normally under windows, the debug info is described in the debug
section of the data directory of the executable, and not in a section
that should be loaded by the program loader.
Most OSses will not map the debug info if no debugger is present.
Another possibility is that debug executables without any optimizations
are bigger than optimized programs, and in that case it would make
a small difference.
Files with or without debug info can be mixed freely in most
implementations that I know of, so the question of the memory
used by a program makes even less sense. If you just want to debug
module X you can eliminate all debug info from all other modules
and only compile with debug info for module X. The linker should
accept that anyway, and most debuggers will work in such a setting.
jacob