From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18044 invoked by alias); 25 Jan 2015 12:41:05 -0000 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 Received: (qmail 17981 invoked by uid 89); 25 Jan 2015 12:40:52 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: glazunov.sibelius.xs4all.nl Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sun, 25 Jan 2015 12:40:33 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3) with ESMTP id t0PCdGMV008990; Sun, 25 Jan 2015 13:39:16 +0100 (CET) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3/Submit) id t0PCdFCC010381; Sun, 25 Jan 2015 13:39:15 +0100 (CET) Date: Mon, 26 Jan 2015 08:48:00 -0000 Message-Id: <201501251239.t0PCdFCC010381@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: jan.kratochvil@redhat.com CC: xdje42@gmail.com, jifl@eCosCentric.com, gdb@sourceware.org In-reply-to: <20150125083241.GB5745@host1.jankratochvil.net> (message from Jan Kratochvil on Sun, 25 Jan 2015 09:32:41 +0100) Subject: Re: dwarf_block_to_fb_offset() and 64-bit host References: <54C48488.6040100@eCosCentric.com> <20150125083241.GB5745@host1.jankratochvil.net> X-SW-Source: 2015-01/txt/msg00075.txt.bz2 > Date: Sun, 25 Jan 2015 09:32:41 +0100 > From: Jan Kratochvil > > 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>: Abbrev Number: 8 (DW_TAG_GNU_call_site_parameter) > DW_AT_location : 2 byte block: 77 0 (DW_OP_breg7 (rsp): 0) > ^ > DW_AT_GNU_call_site_value: 1 byte block: 3b (DW_OP_lit11) > <3>: Abbrev Number: 8 (DW_TAG_GNU_call_site_parameter) > DW_AT_location : 2 byte block: 77 8 (DW_OP_breg7 (rsp): 8) > ^ > DW_AT_GNU_call_site_value: 1 byte block: 3c (DW_OP_lit12) > <3>: Abbrev Number: 8 (DW_TAG_GNU_call_site_parameter) > DW_AT_location : 2 byte block: 77 10 (DW_OP_breg7 (rsp): 16) > ^^ > 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>: Abbrev Number: 8 (DW_TAG_GNU_call_site_parameter) > DW_AT_location : 2 byte block: 77 18 (DW_OP_breg7 (rsp): 24) > ^^ > 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.