This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: dwarf_block_to_fb_offset() and 64-bit host
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: jan dot kratochvil at redhat dot com
- Cc: xdje42 at gmail dot com, jifl at eCosCentric dot com, gdb at sourceware dot org
- Date: Sun, 25 Jan 2015 13:39:15 +0100 (CET)
- Subject: Re: dwarf_block_to_fb_offset() and 64-bit host
- Authentication-results: sourceware.org; auth=none
- References: <54C48488 dot 6040100 at eCosCentric dot com> <m38ugr9tre dot fsf at sspiff dot org> <20150125083241 dot GB5745 at host1 dot jankratochvil dot net>
> Date: Sun, 25 Jan 2015 09:32:41 +0100
> From: Jan Kratochvil <jan.kratochvil@redhat.com>
>
> On Sun, 25 Jan 2015 08:58:13 +0100, Doug Evans wrote:
> > I guess the first question is: Is an fb_offset of -28 valid?
> > i.e., is a negative value valid?
>
> It should not be for decreasing-sp archs (like x86*):
>
> gdb.arch/amd64-entry-value:
> <3><a90>: Abbrev Number: 8 (DW_TAG_GNU_call_site_parameter)
> <a91> DW_AT_location : 2 byte block: 77 0 (DW_OP_breg7 (rsp): 0)
> ^
> <a94> DW_AT_GNU_call_site_value: 1 byte block: 3b (DW_OP_lit11)
> <3><a96>: Abbrev Number: 8 (DW_TAG_GNU_call_site_parameter)
> <a97> DW_AT_location : 2 byte block: 77 8 (DW_OP_breg7 (rsp): 8)
> ^
> <a9a> DW_AT_GNU_call_site_value: 1 byte block: 3c (DW_OP_lit12)
> <3><a9c>: Abbrev Number: 8 (DW_TAG_GNU_call_site_parameter)
> <a9d> DW_AT_location : 2 byte block: 77 10 (DW_OP_breg7 (rsp): 16)
> ^^
> <aa0> DW_AT_GNU_call_site_value: 11 byte block: f4 31 8 0 0 0 0 0 0 27 40 (DW_OP_GNU_const_type: <0x31> 8 byte block: 0 0 0 0 0 0 27 40 )
> <3><aac>: Abbrev Number: 8 (DW_TAG_GNU_call_site_parameter)
> <aad> DW_AT_location : 2 byte block: 77 18 (DW_OP_breg7 (rsp): 24)
> ^^
> <ab0> DW_AT_GNU_call_site_value: 11 byte block: f4 31 8 0 0 0 0 0 0 29 40 (DW_OP_GNU_const_type: <0x31> 8 byte block: 0 0 0 0 0 0 29 40 )
>
> Despite its 'fb_offset' name it is an offset from SP so parameters should not
> be stored in the to-be-rewritten area under SP.
Well, some architectures (including amd64) reserve an area "beyond"
the stack pointer that can be used for temporary data (the "red zone"
on amd64). Now the amd64 "red zone" might not be used for storing
entry values, but for leaf frames it could. So I'd fb_offset should
be LONGEST instead of CORE_ADDR.