From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29198 invoked by alias); 26 Jun 2008 18:09:09 -0000 Received: (qmail 29190 invoked by uid 22791); 26 Jun 2008 18:09:08 -0000 X-Spam-Check-By: sourceware.org Received: from wx-out-0506.google.com (HELO wx-out-0506.google.com) (66.249.82.231) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 26 Jun 2008 18:08:51 +0000 Received: by wx-out-0506.google.com with SMTP id h28so111378wxd.24 for ; Thu, 26 Jun 2008 11:08:46 -0700 (PDT) Received: by 10.151.11.19 with SMTP id o19mr492253ybi.207.1214503726848; Thu, 26 Jun 2008 11:08:46 -0700 (PDT) Received: by 10.150.52.19 with HTTP; Thu, 26 Jun 2008 11:08:46 -0700 (PDT) Message-ID: <7611a2ff0806261108o1855655cp7705418469e8bdf5@mail.gmail.com> Date: Thu, 26 Jun 2008 18:09: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: <20080626162449.GF3595@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> <7611a2ff0806260803q226a05f8s833d9907d42e589c@mail.gmail.com> <20080626162449.GF3595@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/msg00281.txt.bz2 > (gdb) print /x $i0 > $1 = 0xfeedface As you've mentioned previously, this only works on Solaris. Am I totally out of luck on Linux? pchernik@ptxubuntu:~/cor$ cat foo.c #include void bar(char *p1, char *p2) { char *p3; strcpy(p3, "fail"); } int main() { char *p1 = "test1"; char *p2 = "test1"; bar(p1, p2); } pchernik@ptxubuntu:~/cor$ gcc -o foo foo.c pchernik@ptxubuntu:~/cor$ foo Segmentation fault (core dumped) pchernik@ptxubuntu:~/cor$ gdb foo core GNU gdb 6.6-debian Copyright (C) 2006 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i486-linux-gnu"... Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1". warning: Can't read pathname for load map: Input/output error. Reading symbols from /lib/tls/i686/cmov/libc.so.6...done. Loaded symbols for /lib/tls/i686/cmov/libc.so.6 Reading symbols from /lib/ld-linux.so.2...done. Loaded symbols for /lib/ld-linux.so.2 Core was generated by `foo'. Program terminated with signal 11, Segmentation fault. #0 0x0804834d in bar () (gdb) where #0 0x0804834d in bar () #1 0x0804838a in main () (gdb) print $i0 $1 = void (gdb) q Thanks, -Pavel