From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27516 invoked by alias); 4 May 2011 12:55:52 -0000 Received: (qmail 27507 invoked by uid 22791); 4 May 2011 12:55:51 -0000 X-SWARE-Spam-Status: No, hits=-6.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 04 May 2011 12:55:35 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p44CtZ4F032560 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 4 May 2011 08:55:35 -0400 Received: from host1.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p44CtXBc011608 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 4 May 2011 08:55:35 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p44CtXWg013461; Wed, 4 May 2011 14:55:33 +0200 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p44CtWQX013458; Wed, 4 May 2011 14:55:32 +0200 Date: Wed, 04 May 2011 12:55:00 -0000 From: Jan Kratochvil To: Paolo Pisati Cc: gdb@sourceware.org Subject: Re: Tracing code memcpy()-ied to a new location Message-ID: <20110504125532.GA13331@host1.jankratochvil.net> References: <4DC02372.6040409@gmail.com> <4DC026CF.6020709@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4DC026CF.6020709@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2011-05/txt/msg00023.txt.bz2 On Tue, 03 May 2011 18:01:19 +0200, Paolo Pisati wrote: > So here is the question: since i know there is relocate_new_kernel() in > that location, is there a way to tell gdb to "remap" the > symbols/environment/$whatever of that routine in that location so i can > keep debugging it? (gdb) help add-symbol-file Load symbols from FILE, assuming FILE has been dynamically loaded. Usage: add-symbol-file FILE ADDR [-s -s ...] ADDR is the starting address of the file's text. The optional arguments are section-name section-address pairs and should be specified if the data and bss segments are not contiguous with the text. SECT is a section name to be loaded at SECT_ADDR. So ADDR is not the starting address (reboot_code_buffer) but you must also add to it the VMA of the .text section of FILE (see `readelf -WS FILE'). Regards, Jan