This is the mail archive of the mailing list for the GCC 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: asm debug problem

Hi Andrew,

Sorry for not clarifying the problem clearly. Both the rtos and the application are compiled using gcc.

The rtos and application code seems work ok. The only problem is that I can't debug the assembly written HAL part of the rtos.

I don't know whether my platform support DWARF debuginfo or not. How can I find out? The toolchain I use is a bare c sparc-elf toolchain.

Following is the command I use for compile, assemble and link:

Thanks for your reply.

sparc-elf-gcc -c -o astest1.o -I/ecos/osek/dtimer2_install/include -msoft-float -O2 -g -Wall -Q -msoft-float -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority astest1.c

sparc-elf-gcc -c -o uivsr.o -I/ecos/osek/dtimer2_install/include -msoft-float -O2 -g -Wall -Q -msoft-float -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority uivsr.S

sparc-elf-gcc -L/ecos/osek/dtimer2_install/lib -Ttarget.ld -nostdlib -g -Wl,--gc-sections -Wl,-static -Q -msoft-float -g -nostdlib -fvtable-gc -Wl,--gc-sections -Wl,-static -o astest1 astest1.o uivsr.o

----- Original Message ----- From: "Andrew Haley" <aph-gcc@littlepinkcloud.COM>
To: "Yi Tang" <>
Cc: "GCC-HELP" <>
Sent: Friday, November 09, 2007 7:16 PM
Subject: Re: asm debug problem

Yi Tang writes:
> Hello maintainter,
> I have got some trouble using gdb for my assemble source code. It seems > like
> some gcc link problem.
> My code, written in asm and compiled by gcc, should be attached to an > rtos
> library (ecos) to perform some test. However, I found it is not > possible to
> debug the assemble source code under gdb. My assemble code, to build the
> function (usr_interrupt_vsr()), is in a separate file called uivsr.S. > And it
> is linked to the OS through a head file. However, when I run the gdb, it
> goes to some other file in OS kernel, the clock.cxx (also wrong line > num,
> I'm pretty sure no such function in this file). And the language is set > to
> C++. I also tried gas as assembler, same situation.
> Following is the snapshot, hope you guys can give me some hints.

You haven't really given us enough information.

Firstly, does debugging usually work on your platform?

Does your platform use DWARF debuginfo? What does

objdump -W <file>.o


What *exactly* was the command you used to assumble your file?


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