Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: loody <miloody@gmail.com>
To: Simon Richter <Simon.Richter@hogyros.de>
Cc: gdb@sourceware.org
Subject: Re: how to source level debug if I cannot see source embedded in elf  	file
Date: Mon, 23 Nov 2009 14:31:00 -0000	[thread overview]
Message-ID: <3a665c760911221602y6ff771bdlbccdd27dc9fc0012@mail.gmail.com> (raw)
In-Reply-To: <20091122171617.GL18195@honey.hogyros.de>

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


  reply	other threads:[~2009-11-23  0:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-23  0:04 loody
2009-11-23 12:43 ` Simon Richter
2009-11-23 14:31   ` loody [this message]
2009-11-24 19:10     ` Dave Korn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3a665c760911221602y6ff771bdlbccdd27dc9fc0012@mail.gmail.com \
    --to=miloody@gmail.com \
    --cc=Simon.Richter@hogyros.de \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox