This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Debugging variable arguments functions (stdarg)


On 16 July 2010 21:12, Jan Kratochvil <jan.kratochvil@redhat.com> wrote:
> On Fri, 16 Jul 2010 20:57:57 +0200, Petr HluzÃn 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 parameters
> in registers.
> Â Â Â Âhttp://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 - infeasible.

-- 
Petr Hluzin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]