This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gdb for egcs/sh-elf
- To: corsepiu at faw dot uni-ulm dot de
- Subject: Re: gdb for egcs/sh-elf
- From: Robert Lipe <robertl at dgii dot com>
- Date: Thu, 15 Jan 1998 10:35:05 -0600
- Cc: egcs at cygnus dot com
- References: <34BCDD3E.85DA8B14@faw.uni-ulm.de>
> I am having trouble to remotely debug egcs-applications for an embedded
> sh-elf target.
I don't know if egcs or the gdb list is really the best place for this.
> But if trying to debug things are going to be strange: gdb doesn't seem
> to find the correct location of functions.
Here are some helpful hints for finding it:
gdb foo.out
target sim
load
info addr main
info line main
Compare the outputs of those last two lines with what you think is
happening. It's not impossible at all for the debugging information
to get hosed in zero or more of the compiler, assembler, linker, linker
scripts, and debugger. Of course, if your code is relocating itself
in the target, then you have that whole offset query thing to deal with.
Walk down the food chain and manually check one known address. Do a
gcc -S. Look at the assembler output. Do the line numbers make
sense? Depending on the debug format you use, reading the debug
varies in ease. If the compiler output looks right, do an objdump
--disassemble --debugging --line-numbers on the .o and see if the
assembler's line number information looks right. Keep walking down
the line of tools and generated/grokked files.
> I am using gdb-4.16/gdb-971127, egcs-1.0.1, binutils-2.8.1.0.18,
> newlib-1.8.0;
Welcome to the bleeding edge. :-)
--
Robert Lipe http://www.dgii.com/people/robertl robertl@dgii.com