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]

asm debug problem

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.

Thanks Regards,

Current language:  auto; currently c++
Loading section .rom_vectors, size 0x1390 lma 0x40000000
Loading section .text, size 0x54b8 lma 0x40001390
Loading section .rodata, size 0x218 lma 0x40006848
Loading section .data, size 0x354 lma 0x40006a60
Start address 0x40001208, load size 28084
Transfer rate: 532398 bits/sec, 275 bytes/write.

Breakpoint 1, cyg_user_start () at astest.c:10
Current language:  auto; currently c
0x400013a0 in usr_interrupt_vsr () at
Current language:  auto; currently c++

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 ecos 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

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