This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: questions on amd64-tdep.c sigtramp handling
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: dje at google dot com
- Cc: gdb at sourceware dot org
- Date: Tue, 27 Oct 2009 16:04:40 +0100 (CET)
- Subject: Re: questions on amd64-tdep.c sigtramp handling
- References: <20091020193318.EEA5384384@ruffy.mtv.corp.google.com>
> 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.