This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


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

Re: MIPS GDB Problems


Colin Spier wrote:
> 
> Hi,
> 
> I'm trying to use eCos with a slightly unusual MIPS chip (I'm compiling
> with -mcpu=r4000 -mips2).  I'm using a GNU toolchain (binutils 2.10.1, gcc
> 2.95.2 and insight 5.0) built for mips-elf (I had to make some slight
> changes to the gcc makefile so that I can use -mips2)
> 
> I've built with '-g' and located my code at 0x80000000.  It runs OK, but GDB
> can't find the code...
> 
> If I try 'list main' then it lists the 'abort' code.  Similarly, if I try
> 'list breakpoint' it also lists the 'abort' code!  If I single step
> assembler instructions then gdb complains, e.g. "Warning: GDB can't find the
> start of the function at 0x8003c50c"
> 
> I wonder if this is because the address has been sign extended.
> mips-elf-objdump shows the code starting at 0xffffffff80000000.  Similarly,
> if I have a 'main' function at 0x80028644 then if I try to 'disassemble
> 0x80028644' gdb says "No function contains specified address".  However, if
> I 'disassemble 0xffffffff80028644' then this shows the assembly code for my
> main function.
> 
> All suggestions as to how I can get gdb to see my source are welcome!

It sounds like one of two problems: 

- either GDB does not think it is working with a 32-bit target (i.e. as per
-mips2). Try using "set archdebug 1" at the start of your GDB session to
see what GDB really thinks.

- The alternative is that you haven't set your stub code up quite right.
You will need to be using anon cvs for a start. Then in
hal/mips/arch/current/include/mips-stub.h you need to ensure that
REGSIZE(X) is 8, target_register_t is unsigned long, and
CYGARC_SIGN_EXTEND_REGISTERS is set.

Jifl
-- 
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS  Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow."  ||  These opinions are all my own fault

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