This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: gdb for AT91SAM7
- From: Michael Snyder <msnyder at specifix dot com>
- To: Roman Mashak <romez777 at gmail dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Wed, 14 May 2008 17:36:45 -0700
- Subject: Re: gdb for AT91SAM7
- References: <40a670230805140042m311ccf04xb948628d0fa4532c@mail.gmail.com> <1210788778.4615.590.camel@localhost.localdomain> <40a670230805141712n3afdf48dladfa89d669d2aeaa@mail.gmail.com>
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.