From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ralf Corsepius To: egcs@cygnus.com Subject: gdb for egcs/sh-elf Date: Wed, 14 Jan 1998 08:42:00 -0000 Message-id: <34BCDD3E.85DA8B14@faw.uni-ulm.de> X-SW-Source: 1998-01/msg00418.html Hi, I am having trouble to remotely debug egcs-applications for an embedded sh-elf target. The symtoms are: I can compile/link the application and successfully download it to the target. But if trying to debug things are going to be strange: gdb doesn't seem to find the correct location of functions. Here is only an excerpt of some observations during a debug session: 1) Setting a break point > (gdb) >br bsp_start > Breakpoint 1 at 0xa0484ea According to the disassembled code this isn't the address of the function but at some small offset close beside it. > 0a0484e8 <_bsp_start>: > a0484e8: 2f 86 mov.l r8,@-r15 > a0484ea: d1 34 mov.l a0485bc <_bsp_start+0xd4>,r1 ! 0xa04 > a0484ec: 2f 96 mov.l r9,@-r15 2) Setting another break point: > (gdb) br bsp_cleanup > Breakpoint 2 at 0xa0484b0:file /users/corsepiu/src/rtems/corsepiu/rtems/c/src/lib/libbsp/sh/amos/startup/../../shared/main.c, line 42. This time this is a complete false location, not even related to this function. > 0a0484b0 <_set_vector>: > a0484b0: 62 43 mov r4,r2 > a0484b2: 2f e6 mov.l r14,@-r15 > a0484b4: 64 53 mov r5,r4 3) After starting the program anything crashes and no breakpoint was trapped. > (gdb) c > Continuing. > > Program received signal SIGEMT, Emulation trap. > 0xffffffff in ?? () I am completely unsure where to start to search for the cause of my problems. Is it my linker script, the debugging stub on the target, binutils, egcs or gdb ? Any help appreciated. Ralf. PS.: I am using gdb-4.16/gdb-971127, egcs-1.0.1, binutils-2.8.1.0.18, newlib-1.8.0; The application is pure c, no c++ involved.