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: questions on amd64-tdep.c sigtramp handling


> Date: Tue, 20 Oct 2009 12:33:18 -0700 (PDT)
> From: dje@google.com (Doug Evans)
> 
> Hi.
> 
> Why does amd64-tdep.c:amd64_sigtramp_frame_cache subtract 8 here?
> 
>   get_frame_register (this_frame, AMD64_RSP_REGNUM, buf);
>   cache->base = extract_unsigned_integer (buf, 8, byte_order) - 8;

The same reason why the i386 variant uses ... - 4.  The convention is
that cache->base holds the value of the frame pointer.  For frameless
functions we need to reserve the space used to save the stack pointer,
just in case it sets up the frame pointer at a later stage.

> And why does amd64_sigtramp_frame_this_id add 16 here?
> 
>   (*this_id) = frame_id_build (cache->base + 16, get_frame_pc (this_frame));

See the end of i386_push_dummy_call.


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