This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
GCC generation of symbols for use with GDB
- From: "David Mc Kenna" <mckennad at esatclear dot ie>
- To: crossgcc at sources dot redhat dot com,gdb at sources dot redhat dot com
- Date: Tue, 2 Sep 2003 10:30:00 +0100
- Subject: GCC generation of symbols for use with GDB
- Reply-to: mckennad at esatclear dot ie
Hi Folks,
I have come across a problem when I am compiling multi files using gcc which
are then used for debugging with GDB.
I have two files, startup.s and interrupts.c. Startup.s is an initialization
file for use with an ARM7TDMi core and interrupts.c is my main file. When I
try to generate my ELF file using the following command:
arm-elf-gcc.exe \
/c/test/headers/gnu/startup.s $1.c /c/test/gcc/interrupts/irq.o -mthumb -mthumb-interwork
-mcpu=arm7tdmi\
-g -Wall -nostartfiles -mlittle-endian -save-temps -O$2 \
-o $1.elf 2> error.out
It generates the ELF file successfully. But when I launch GDB and do
target sim, load, b main, I get the following error:
Internal error: pc 0x0 in read in psymtab, but not in symtab.
Next I placed the startup.s code into an inline assembly command which is placed
at the top of the C file, all is well. GDB behaves normally.
Any ideas? My version of gcc is gcc version 3.3.2 20030825 (prerelease) and
gdb is GNU gdb 20030901
My startup.s code is :
b test_start @ SVC 0x00
b UDINST_Startup @ Undefined Instr.UND 0x04
b SWI_Startup @ SWI _Startup SVC 0x08
b PABORT_Startup @ Prefetch Abort ABORT 0x0C
b DABORT_Startup @ Data Abort ABORT 0x10
b RESERVED
b IRQ_Startup @ IRQ _Startup IRQ 0x18
b FIQ_Startup @ FIQ _Startup FIQ 0x1C
UDINST_Startup:
ldr pc, [pc, #20] @ Undefined Instruction _Startup UND 0x04
SWI_Startup:
b ADI_SWI_Interrupt_Setup @ SWI _Startup SVC 0x08
PABORT_Startup:
ldr pc, [pc, #20] @ Prefetch Abort ABORT 0x0C
DABORT_Startup:
ldr pc, [pc, #20] @ Data Abort ABORT 0x10
RESERVED:
ldr pc, [pc, #20]
IRQ_Startup:
b ADI_IRQ_Interrupt_Setup @ IRQ _Startup IRQ 0x18
FIQ_Startup:
b ADI_FIQ_Interrupt_Setup @ FIQ _Startup FIQ 0x1C
.global UDINSTVector
UDINSTVector:
.word .Int_Return
.global SWIVector
SWIVector:
.word .Int_Return
.global PABORTVector
PABORTVector:
.word .Int_Return
.global DABORTVector
DABORTVector:
.word .Int_Return
.global RESERVEDVector
RESERVEDVector:
.word .Int_Return
.global IRQVector
IRQVector:
.word .Int_Return
.global FIQVector
FIQVector:
.word .Int_Return
.global Int_Return
.Int_Return:
SUBS pc, lr, #4 @ return from interrupt
.global test_start
test_start:
Thanks in advance,
Dave Mc Kenna
--
http://www.iol.ie