From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24467 invoked by alias); 6 Sep 2007 02:40:35 -0000 Received: (qmail 24459 invoked by uid 22791); 6 Sep 2007 02:40:34 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 06 Sep 2007 02:40:29 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 2C44B982A2; Thu, 6 Sep 2007 02:40:30 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id EFBBF9810B; Thu, 6 Sep 2007 02:40:29 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.67) (envelope-from ) id 1IT7IA-0006YZ-KY; Wed, 05 Sep 2007 22:40:26 -0400 Date: Thu, 06 Sep 2007 03:19:00 -0000 From: Daniel Jacobowitz To: "Mentat K." Cc: gdb@sourceware.org Subject: Re: add-symbol-file question Message-ID: <20070906024026.GA25178@caradoc.them.org> Mail-Followup-To: "Mentat K." , gdb@sourceware.org References: <58f0b2e40709051630p6d523a8du5f6293c2df7aa16@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <58f0b2e40709051630p6d523a8du5f6293c2df7aa16@mail.gmail.com> User-Agent: Mutt/1.5.15 (2007-04-09) 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: 2007-09/txt/msg00041.txt.bz2 On Wed, Sep 05, 2007 at 07:30:23PM -0400, Mentat K. wrote: > Hello, > I am debugging a core that was generated from an app that was compiled > with gcc 3.2 with -O2 (but without -g). All the shared object libs > that it links with were similary compiled with -O2 without -g > > One of the shared object libs has a class and I know the address in > the core file where an object of this class resides. I want to print > out this object without doing the byte arithmetic myself. > > What would be the simplest way of doing this? If all you need is that type, build the definition of the type with -g into a new object file. Load it with add-symbol-file at an out of the way address so that it does not overlap the code you care about. Then you should be able to use the class name and type. You have to be sure that debug info for the class is in the file you compile; sometimes it isn't, with G++. -- Daniel Jacobowitz CodeSourcery