This is the mail archive of the gdb@sourceware.cygnus.com mailing list for the GDB project. See the GDB home page for more information.


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

Re: gdb-4.16.85 fails for sh-elf


Aaron Passey wrote:

>         gdb-4.16.85 core dumps when trying to do almost anything when
> compiled with sh-elf as a target.  I am able to set the target to remote
> and download my program to my board and even run it (and have it work) but
> setting breakpoints, listing the source, getting a backtrace, etc all cause
> gdb to core dump.  They even cause a core dump when the target is set to the
> simulator, so it's not my debugging stub.

I experienced the same, when my linker script contained invalid addresses for
gdb's stab sections but the shelf.x linker script from egcs worked for me).

IMHO, the simulator's memory management is rather unusable. Gdb's sh simulator
assumes consecutive memory and doesn't honour memory shadowing, SH's
8-bit/16-bit memory access or access to memory having bits > 24 set (e.g.
having memory in other but area 0). If your programs are designed to run on a
SH7032, which have on-chip memory in area 7, gdb's simulator  starts up and
reports a SIGBUS.

>         I also tried gdb-980122 and gdb-4.16.  980122 had exactly the same

No, gdb-980122/sh-elf worked for me except of not being able to debug
relocatible/partial linked object files.

I had reported this problem several times before, but nobody has replied until
now. Therefore I can't withstand the impression that sh-elf support currently
has one of the lowest priorities at cygnus (Who cares about embedded systems
? ;-).

> problem and 4.16 doesn't recognize my binary as a valid one.

Hm, I wasn't trapped by this -- But I am using a one-tree build picking up
underlaying libraries from newest packages I can get (I.e. perhaps using a
newer libbfd for building gdb-4.16 might help).

But I experienced gcc-2.7.3/sh-elf to be completely non-functional, IMO.

>         Has anyone else run into this?
>
> % cat config.status
> ../gdb-4.16.85/configure --host=i586-pc-linux-gnu --prefix=/hotard
> --target=sh-elf --with-newlib --verbose --norecursion
>
>         I am using the current egcs from the CVS repository (retrieved
> 2/7/98), binutils-2.8.1.0.20, and newlib-1.8.0.  All of them were compiled
> with the same configure options as gdb.  My host machine is a PC running
> Linux (Redhat 5.0).  You've gotta love living on the bleeding edge.

My setup is very similar to yours: i586-pc-linux-gnulibc1/binutils-2.8.1.0.19
or gas-snapshots/newlib-1.8.0 + patches/egcs-980205

Which sh do you use? There is a bug in the original newlib-1.8.0 causing all
sh1 code to break.

>         I just joined this mailing list and I don't know if it's active or
> what.  I also couldn't find an archive anywhere.  If this is not active,
> could someone point me to the right place to send this.  Thanks.
>
> Aaron

BTW, due to the debugging bug with regard to relocatible object files, I gave
up using sh-elf and switched back to sh-coff

Ralf.