From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1059 invoked by alias); 26 Jun 2008 14:26:57 -0000 Received: (qmail 1040 invoked by uid 22791); 26 Jun 2008 14:26:54 -0000 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 26 Jun 2008 14:26:36 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 1F4CE2A968E; Thu, 26 Jun 2008 10:26:34 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id t071xOaiAjUm; Thu, 26 Jun 2008 10:26:34 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id F3A042A968C; Thu, 26 Jun 2008 10:26:33 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id C19FCE7ACD; Thu, 26 Jun 2008 10:26:33 -0400 (EDT) Date: Thu, 26 Jun 2008 14:26:00 -0000 From: Joel Brobecker To: Pavel Chernikov Cc: gdb@sourceware.org Subject: Re: gdb / dbx / pstack question - getting function argument addresses from stack Message-ID: <20080626142633.GB3595@adacore.com> References: <7611a2ff0806260620k4e4f6765l6a306c7e363fa12e@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7611a2ff0806260620k4e4f6765l6a306c7e363fa12e@mail.gmail.com> User-Agent: Mutt/1.4.2.2i 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: 2008-06/txt/msg00276.txt.bz2 > Example: > dbx: [1] strlen(0x0, 0x0, 0x5, 0x7efefeff, 0x81010100, 0xffbee178), at > 0xff1332ec > gdb: #0 0xff1332ec in strlen () from /usr/lib/libc.so.1 > > Question 1: is it possible to achieve the same thing with gdb (ability > to see function argument addresses)? If not, is there another utility > that can be used? There is no way that I know of, right now, to get the information printed inside the argument section of the frame info. However, what the dbx is doing, I believe, is simply printing the contents of the %i0-%i5 registers. This trick only works on Sparc. Based on the description of what you're trying to do, you should be able to write a small script/program that starts the debugger with your core file, extracts the backtrace, then selects one frame after the other and issue a series of print commands. Your script/program would then post-process the output and stuff the value of the registers where you want to see them. -- Joel