From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16976 invoked by alias); 9 Jun 2005 13:17:33 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 16950 invoked by uid 22791); 9 Jun 2005 13:17:24 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Thu, 09 Jun 2005 13:17:24 +0000 Received: from drow by nevyn.them.org with local (Exim 4.50) id 1DgMuQ-0000HQ-LY; Thu, 09 Jun 2005 09:17:22 -0400 Date: Thu, 09 Jun 2005 13:17:00 -0000 From: Daniel Jacobowitz To: Eli Zaretskii Cc: gdb-patches@sourceware.org Subject: Re: RFC: Improve support for "debugging" unlinked objects Message-ID: <20050609131722.GA965@nevyn.them.org> Mail-Followup-To: Eli Zaretskii , gdb-patches@sourceware.org References: <20050608214956.GA10586@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i X-SW-Source: 2005-06/txt/msg00076.txt.bz2 On Thu, Jun 09, 2005 at 06:44:05AM +0300, Eli Zaretskii wrote: > > Date: Wed, 8 Jun 2005 17:49:56 -0400 > > From: Daniel Jacobowitz > > > > If you compile a file containing both code and initialized data, and load > > the unlinked object (.o) file using GDB, "print Variable" won't work. > > In what situations would such a method (loading an unlinked object > file) be useful? I don't see it documented anywhere in the manual, so > I'd like to consider saying a few words about when and how to do that. It's useful for examination: you can disassemble functions and inspect variables. Also, with a fix that I'm going to commit to bfd soon, you can use "gdb -write" to patch an object file. Note that it's not _very_ useful, because gdb can neither interpret nor modify relocations. So branches and some initialized variables will appear to go to the wrong place. But it's still handy from time to time. -- Daniel Jacobowitz CodeSourcery, LLC