From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17190 invoked by alias); 26 Jun 2008 15:03:42 -0000 Received: (qmail 17181 invoked by uid 22791); 26 Jun 2008 15:03:41 -0000 X-Spam-Check-By: sourceware.org Received: from ti-out-0910.google.com (HELO ti-out-0910.google.com) (209.85.142.190) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 26 Jun 2008 15:03:24 +0000 Received: by ti-out-0910.google.com with SMTP id d10so54890tib.12 for ; Thu, 26 Jun 2008 08:03:21 -0700 (PDT) Received: by 10.150.49.1 with SMTP id w1mr286976ybw.23.1214492600112; Thu, 26 Jun 2008 08:03:20 -0700 (PDT) Received: by 10.150.52.19 with HTTP; Thu, 26 Jun 2008 08:03:20 -0700 (PDT) Message-ID: <7611a2ff0806260803q226a05f8s833d9907d42e589c@mail.gmail.com> Date: Thu, 26 Jun 2008 15:03:00 -0000 From: "Pavel Chernikov" To: "Joel Brobecker" Subject: Re: gdb / dbx / pstack question - getting function argument addresses from stack Cc: gdb@sourceware.org In-Reply-To: <20080626142633.GB3595@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <7611a2ff0806260620k4e4f6765l6a306c7e363fa12e@mail.gmail.com> <20080626142633.GB3595@adacore.com> 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/msg00278.txt.bz2 Hi Joel, Thanks for the reply! It's starting to make sense... Would you mind elaborating on "issue a series of print commands"? I'm not sure of what exactly I need to print... Thanks, -Pavel On Thu, Jun 26, 2008 at 10:26 AM, Joel Brobecker wrote: >> 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 >