asm debug problem

Yi Tang yitang@itee.uq.edu.au
Wed Nov 7 02:33:00 GMT 2007


Yes, I think it got the -g option for gcc and gstab for gas. Following is my 
gcc build options

For the rtos global cflags:
cflags 
= -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual
-g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc 
 -finit-priority

For the rtos global link flags:
ldflags 
= -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual
 -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc 
 -finit-priority

For my asm code
cflags = -I$(INSTALL_DIR)/include -msoft-float -O2 -g -Wall -Q
ldflags 
= -L$(INSTALL_DIR)/lib -Ttarget.ld -nostdlib -g -Wl,--gc-sections -Wl,-static 
 -Q

Plus my platform is gcc 3.2.3 and gdb 6.4 on cygwin

Thanks for your reply.

Regards,
Tony

----- Original Message ----- 
From: "Daniel Jacobowitz" <drow@false.org>
To: "Yi Tang" <yitang@itee.uq.edu.au>
Cc: <gdb@sourceware.org>
Sent: Wednesday, November 07, 2007 12:02 AM
Subject: Re: asm debug problem


> On Tue, Nov 06, 2007 at 11:48:59PM +1000, Yi Tang wrote:
>> Hello maintainer,
>>
>> I have got some trouble using gdb for my source code.
>>
>> My code, written in asm and compiled by gcc, should be attached to an 
>> rtos
>> library (ecos) to perform some test. I found it is not possible to debug 
>> the
>> assemble source code. 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.
>
> Did you assemble the file with -g to gcc, or --gdwarf2 to gas?
>
> -- 
> Daniel Jacobowitz
> CodeSourcery
> 




More information about the Gdb mailing list