From patchwork Thu Apr 28 21:03:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Gardiner X-Patchwork-Id: 93330 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id E0E7EB6FBC for ; Fri, 29 Apr 2011 07:03:56 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7EBE5280A4; Thu, 28 Apr 2011 23:03:53 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PU7JSK-9HQ+j; Thu, 28 Apr 2011 23:03:53 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 33609280A6; Thu, 28 Apr 2011 23:03:44 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D49302808A for ; Thu, 28 Apr 2011 23:03:34 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id N8Mj6QORd76U for ; Thu, 28 Apr 2011 23:03:31 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from na3sys009aog114.obsmtp.com (na3sys009aog114.obsmtp.com [74.125.149.211]) by theia.denx.de (Postfix) with ESMTPS id 067452808B for ; Thu, 28 Apr 2011 23:03:29 +0200 (CEST) Received: from mail-yx0-f173.google.com ([209.85.213.173]) (using TLSv1) by na3sys009aob114.postini.com ([74.125.148.12]) with SMTP ID DSNKTbnWH2BWw0uqEvsvidAEye71MtD3Nqlt@postini.com; Thu, 28 Apr 2011 14:03:31 PDT Received: by yxk8 with SMTP id 8so1233771yxk.18 for ; Thu, 28 Apr 2011 14:03:27 -0700 (PDT) Received: by 10.236.165.101 with SMTP id d65mr4071421yhl.175.1304024607234; Thu, 28 Apr 2011 14:03:27 -0700 (PDT) Received: from localhost.localdomain ([206.191.47.130]) by mx.google.com with ESMTPS id 13sm1049207yhl.72.2011.04.28.14.03.25 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 28 Apr 2011 14:03:26 -0700 (PDT) From: Ben Gardiner To: albert.u.boot@aribaud.net, u-boot@lists.denx.de Date: Thu, 28 Apr 2011 17:03:21 -0400 Message-Id: <7ed11e02b0db005231f5c6baa299761f3aa04f6f.1304024417.git.bengardiner@nanometrics.ca> X-Mailer: git-send-email 1.7.1 In-Reply-To: References: Cc: Heiko Schocher Subject: [U-Boot] [PATCH v3 2/2] README.arm-relocation: get relocated address in gdb X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de When your emulator is connected at reset (or is used to load u-boot) it is possible to get the relocation address from the gd->relocaddr since gd is always in r8 (on ARM) it is addressable before the gdb has remapped symbols. Document this alternate method in-line with the original method written by Heiko Schocher. Signed-off-by: Ben Gardiner CC: Heiko Schocher CC: Wolfgang Denk Acked-by: Heiko Schocher --- Changes since V2: * add gd->relocaddr as a secondary method of obtaining the symbol-file gdb argument Changes since V1: * update to reflect proposed changes to existing debug instructions: renumber steps, remove note about -DDEBUG --- doc/README.arm-relocation | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/doc/README.arm-relocation b/doc/README.arm-relocation index 8bfb500..45f5ea7 100644 --- a/doc/README.arm-relocation +++ b/doc/README.arm-relocation @@ -164,6 +164,7 @@ Program received signal SIGSTOP, Stopped (signal). add-symbol-file u-boot 0x8ff08000 ^^^^^^^^^^ get this address from u-boot bdinfo command + or get it from gd->relocaddr in gdb => bdinfo rch_number = XXXXXXXXXX @@ -182,4 +183,11 @@ irq_sp = XXXXXXXXXX sp start = XXXXXXXXXX FB base = XXXXXXXXXX +or interrupt execution by any means and re-load the symbols at the location +specified by gd->relocaddr -- this is only valid after board_init_f. + +(gdb) set $s = gd->relocaddr +(gdb) symbol-file +(gdb) add-symbol-file u-boot $s + Now you can use gdb as usual :-)