From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9085 invoked by alias); 26 Jun 2008 19:01:40 -0000 Received: (qmail 9073 invoked by uid 22791); 26 Jun 2008 19:01:38 -0000 X-Spam-Check-By: sourceware.org Received: from yx-out-1718.google.com (HELO yx-out-1718.google.com) (74.125.44.152) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 26 Jun 2008 19:01:21 +0000 Received: by yx-out-1718.google.com with SMTP id 6so88284yxn.48 for ; Thu, 26 Jun 2008 12:01:19 -0700 (PDT) Received: by 10.151.12.4 with SMTP id p4mr563461ybi.235.1214506879104; Thu, 26 Jun 2008 12:01:19 -0700 (PDT) Received: by 10.150.52.19 with HTTP; Thu, 26 Jun 2008 12:01:18 -0700 (PDT) Message-ID: <7611a2ff0806261201l62ec82adha2758dde69548df9@mail.gmail.com> Date: Thu, 26 Jun 2008 19:01: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: <20080626185008.GC8971@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> <7611a2ff0806261108o1855655cp7705418469e8bdf5@mail.gmail.com> <20080626185008.GC8971@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/msg00286.txt.bz2 Right, I should have mentioned that the "old" platform is SPARC Solaris and the "new" platform is I386 Linux. Thanks for the info! I guess my only option is to check how x86 OpenSolaris is doing it (IF it is doing it)... Thanks again, -Pavel On Thu, Jun 26, 2008 at 2:50 PM, Joel Brobecker wrote: >> As you've mentioned previously, this only works on Solaris. Am I >> totally out of luck on Linux? > > The Operating System is actually not the most important factor in > this case. The reason why this "works" on Sparc is because the Sparc > ABI says that the first few parameters should be passed through the > output/input registers. There can be up to 6 registers passed this > way. So when dbx prints the "parameters" when there is no debugging > info, it is actually printing the contents of these registers. > > You didn't say which CPU your Linux was running on, but I'll guess > it's x86. I don't know x86 all that well, but I remember that the > arguments are passed through the stack at an offset to the function > frame base. So the idea that works on Sparc doesn't work for x86, > and I don't see another simple scheme that would work on x86 either. > > -- > Joel >