This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: how to source level debug if I cannot see source embedded in elf file


Hi:
thanks for your reply :)
2009/11/23 Simon Richter <Simon.Richter@hogyros.de>:
> Hi,
>
> On Mon, Nov 23, 2009 at 01:03:36AM +0800, loody wrote:
>
>> If my tool chain cannot generate elf file without source embedded even
>> I compile them with "-g", can I do the source level debugging?
>
> That assembler dump appears to be from a fully linked file, so I'd
> suspect the debug info is stripped at link time. Have you passed the -g
> option to the link step as well?
first of all, I have to apologize that I have not described my
environment more detail.

I separate the compile process as first build the obj files, then link
them together. Since my program separates at different directories and
I need to build them each and finally link them together.

I am not quite understand the "passed the -g option to the link step as well".
I find the option described in ld document about "-g" below:
-g
    Ignored. Provided for compatibility with other tools.

Should I link them with "-g" as  well?
appreciate your help,
miloody

PS:
below is my compile and link commands:
/*my commands that I can see source */
mipsel-unknown-elf-gcc  -g -G 0 -mips32r2 -fno-omit-frame-pointer
-fno-optimize-sibling-calls -I./include -I./device/display
-I./device/fatfs -I./device/misc -I./device/ntstrg -I./device/ntuart
-I./device/ntxsub -I./device/vpu
-I/media/sdb1/newlib-1.17.0/build/mipsel/include -D_ASSEMBLER_  -c
init.S
mipsel-unknown-elf-gcc  -g -G 0 -mips32r2 -fno-omit-frame-pointer
-fno-optimize-sibling-calls -I./include -I./device/display
-I./device/fatfs -I./device/misc -I./device/ntstrg -I./device/ntuart
-I./device/ntxsub -I./device/vpu
-I/media/sdb1/newlib-1.17.0/build/mipsel/include -D_ASSEMBLER_  -c
reset.S
mipsel-unknown-elf-gcc  -g -G 0 -mips32r2 -fno-omit-frame-pointer
-fno-optimize-sibling-calls -I./include -I./device/display
-I./device/fatfs -I./device/misc -I./device/ntstrg -I./device/ntuart
-I./device/ntxsub -I./device/vpu
-I/media/sdb1/newlib-1.17.0/build/mipsel/include -c atexit.c
mipsel-unknown-elf-gcc  -g -G 0 -mips32r2 -fno-omit-frame-pointer
-fno-optimize-sibling-calls -I./include -I./device/display
-I./device/fatfs -I./device/misc -I./device/ntstrg -I./device/ntuart
-I./device/ntxsub -I./device/vpu
-I/media/sdb1/newlib-1.17.0/build/mipsel/include -c main.c
mipsel-unknown-elf-ld -T ./link.xn -o TestCode.elf -Map TestCode.map
--oformat elf32-littlemips  init.o reset.o atexit.o main.o -static
-nostdlib -L/media/sdb1/newlib-1.17.0/build/mipsel/lib
-L/root/bare_metal/x-tools/mipsel-unknown-elf/lib/gcc/mipsel-unknown-elf/4.2.4
 -lc -lnullmon -lgcc
rm -f TestCode.dla
rm -f TestCode.dnm


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]