From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1816 invoked by alias); 15 May 2008 00:37:05 -0000 Received: (qmail 1807 invoked by uid 22791); 15 May 2008 00:37:04 -0000 X-Spam-Check-By: sourceware.org Received: from bluesmobile.specifix.com (HELO bluesmobile.specifix.com) (216.129.118.140) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 15 May 2008 00:36:47 +0000 Received: from [127.0.0.1] (bluesmobile.specifix.com [216.129.118.140]) by bluesmobile.specifix.com (Postfix) with ESMTP id 7E1303B933; Wed, 14 May 2008 17:36:45 -0700 (PDT) Subject: Re: gdb for AT91SAM7 From: Michael Snyder To: Roman Mashak Cc: gdb-patches@sources.redhat.com In-Reply-To: <40a670230805141712n3afdf48dladfa89d669d2aeaa@mail.gmail.com> References: <40a670230805140042m311ccf04xb948628d0fa4532c@mail.gmail.com> <1210788778.4615.590.camel@localhost.localdomain> <40a670230805141712n3afdf48dladfa89d669d2aeaa@mail.gmail.com> Content-Type: text/plain Date: Thu, 15 May 2008 12:09:00 -0000 Message-Id: <1210811805.4615.602.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 (2.10.3-7.fc7) Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-05/txt/msg00456.txt.bz2 On Wed, 2008-05-14 at 17:12 -0700, Roman Mashak wrote: > Hello, > > 2008/5/14 Michael Snyder : > > 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.