From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Lipe To: corsepiu@faw.uni-ulm.de Cc: egcs@cygnus.com Subject: Re: gdb for egcs/sh-elf Date: Fri, 16 Jan 1998 01:51:00 -0000 Message-id: <19980115103505.08713@dgii.com> References: <34BCDD3E.85DA8B14@faw.uni-ulm.de> X-SW-Source: 1998-01/msg00514.html > 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