public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* gdb for egcs/sh-elf
@ 1998-01-14  8:42 Ralf Corsepius
  1998-01-15 16:30 ` amylaar
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Ralf Corsepius @ 1998-01-14  8:42 UTC (permalink / raw)
  To: egcs

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.



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1998-01-16  1:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-01-14  8:42 gdb for egcs/sh-elf Ralf Corsepius
1998-01-15 16:30 ` amylaar
1998-01-15 16:30 ` Jeffrey A Law
1998-01-15 16:30 ` Stephen Williams
1998-01-16  1:51 ` Robert Lipe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).