This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gdb for AT91SAM7


On Wed, 2008-05-14 at 17:12 -0700, Roman Mashak wrote:
> Hello,
> 
> 2008/5/14 Michael Snyder <msnyder@specifix.com>:
> > When you say the application is linked to 0x100000,
> > do you mean that that is the start address?
> 
> I mean, this is the address specified in the linker script and by
> which the image is burnt in flash.

Specified as what?  The base load address?  Or the start
of execution address?  They're not the same, you know.

I'm developing a hunch that perhaps your linker script
does not specify a start-of-execution address.

> 
> > Before you say "continue", or "jump *0x100000", if you
> > ask gdb for the current instruction pointer (presumably
> > "info reg pc"), what does it say?
> 
> This is the strange point. The first time I run it says "pc =
> 0x100496", any other run gets PC equal to 0x0. Moreover ALL registers
> are set to 0x0.
> 
> I guess there is something wrong with the initialization of JTAG in
> .gdbinit. T

Could very well be.  If the PC contains some random address
(eg. zero) and you say "continue", gdb is just going to let
the target start executing code at that random address.

Elf files can have a start-of-execution address specified, 
though.  When you use gdb to load the file, gdb should
set the pc to that address.



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