From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15530 invoked by alias); 18 Jul 2010 19:28:17 -0000 Received: (qmail 15521 invoked by uid 22791); 18 Jul 2010 19:28:16 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mail-yx0-f169.google.com (HELO mail-yx0-f169.google.com) (209.85.213.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 18 Jul 2010 19:28:11 +0000 Received: by yxs7 with SMTP id 7so1016249yxs.0 for ; Sun, 18 Jul 2010 12:28:09 -0700 (PDT) Received: by 10.100.194.1 with SMTP id r1mr3866077anf.105.1279481288168; Sun, 18 Jul 2010 12:28:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.19.10 with HTTP; Sun, 18 Jul 2010 12:27:48 -0700 (PDT) In-Reply-To: <20100716191203.GA20877@host1.dyn.jankratochvil.net> References: <20100716191203.GA20877@host1.dyn.jankratochvil.net> From: =?UTF-8?B?UGV0ciBIbHV6w61u?= Date: Sun, 18 Jul 2010 19:28:00 -0000 Message-ID: Subject: Re: Debugging variable arguments functions (stdarg) To: Jan Kratochvil Cc: G , gdb@sourceware.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: 2010-07/txt/msg00069.txt.bz2 On 16 July 2010 21:12, Jan Kratochvil wrote: > On Fri, 16 Jul 2010 20:57:57 +0200, Petr Hluz=C3=ADn wrote: >> Workaround B: >> Get value of stack pointer (RSP?) of frame MysqlWrapper() and dump raw >> memory around the address. You should see these values somewhere >> around: >> 0x00000000004041e2 (return address in MysqlWrapper) >> 0x406bf0 (the third argument to WriteLog) >> Between these two values should be the values of 3rd and 4th argument. > > This is not so simple on x86_64, it passes even (first few) stdarg parame= ters > in registers. > =C2=A0 =C2=A0 =C2=A0 =C2=A0http://www.x86-64.org/documentation/abi.pdf Nice reading. I suppose it is documented section "3.5.7 Variable Argument Lists". Unfortunately I was not able to find any specific wording. But it makes sense. You are probably right. It should be possible by reading the document to determine if the two arguments go to stack or remained in registers. I failed to figure that out. Ok, this means that G has to examine stack memory of all frames - infeasibl= e. --=20 Petr Hluzin