From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 105780 invoked by alias); 24 Aug 2018 20:34:22 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 105757 invoked by uid 89); 24 Aug 2018 20:34:21 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=Deal, MAINTAINERS X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 24 Aug 2018 20:34:19 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id w7OKYD3Z014276 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 24 Aug 2018 16:34:18 -0400 Received: by simark.ca (Postfix, from userid 112) id EEC001EB43; Fri, 24 Aug 2018 16:34:12 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id E38FB1EB37; Fri, 24 Aug 2018 16:34:11 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 24 Aug 2018 20:34:00 -0000 From: Simon Marchi To: John Darrington Cc: gdb-patches@sourceware.org, gcc-patches@gcc.gnu.org Subject: Re: [PATCH 2/3] GDB: Add support for 24 bit addresses In-Reply-To: <20180823173526.26144-2-john@darrington.wattle.id.au> References: <20180823173526.26144-1-john@darrington.wattle.id.au> <20180823173526.26144-2-john@darrington.wattle.id.au> Message-ID: <6fd724f11a46b40588fd2b922a358c52@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.6 X-IsSubscribed: yes X-SW-Source: 2018-08/txt/msg00606.txt.bz2 (CCing gcc-patches because of the change in include/dwarf2.h) On 2018-08-23 13:35, John Darrington wrote: > * include/dwarf2.h (enum dwarf_unit_type)[DW_EH_PE_udata3]: New member. > * gdb/dwarf2-frame.c (encoding_for_size): Deal with case 3. > (read_encoded_value): Deal with case DW_EH_PE_udata3 > --- > gdb/dwarf2-frame.c | 7 ++++++- > include/dwarf2.h | 5 ++++- > 2 files changed, 10 insertions(+), 2 deletions(-) > > diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c > index f7dc820f4d..b329e34997 100644 > --- a/gdb/dwarf2-frame.c > +++ b/gdb/dwarf2-frame.c > @@ -1527,12 +1527,14 @@ encoding_for_size (unsigned int size) > { > case 2: > return DW_EH_PE_udata2; > + case 3: > + return DW_EH_PE_udata3; > case 4: > return DW_EH_PE_udata4; > case 8: > return DW_EH_PE_udata8; > default: > - internal_error (__FILE__, __LINE__, _("Unsupported address > size")); > + internal_error (__FILE__, __LINE__, _("Unsupported address size > %d"), size); > } > } > > @@ -1605,6 +1607,9 @@ read_encoded_value (struct comp_unit *unit, > gdb_byte encoding, > case DW_EH_PE_udata2: > *bytes_read_ptr += 2; > return (base + bfd_get_16 (unit->abfd, (bfd_byte *) buf)); > + case DW_EH_PE_udata3: > + *bytes_read_ptr += 3; > + return (base + bfd_get_24 (unit->abfd, (bfd_byte *) buf)); > case DW_EH_PE_udata4: > *bytes_read_ptr += 4; > return (base + bfd_get_32 (unit->abfd, (bfd_byte *) buf)); > diff --git a/include/dwarf2.h b/include/dwarf2.h > index cf0039a92a..05c328057b 100644 > --- a/include/dwarf2.h > +++ b/include/dwarf2.h > @@ -474,11 +474,14 @@ enum dwarf_unit_type > #define DW_EH_PE_udata2 0x02 > #define DW_EH_PE_udata4 0x03 > #define DW_EH_PE_udata8 0x04 > + > +#define DW_EH_PE_udata3 0x05 > + > +#define DW_EH_PE_signed 0x08 > #define DW_EH_PE_sleb128 0x09 > #define DW_EH_PE_sdata2 0x0A > #define DW_EH_PE_sdata4 0x0B > #define DW_EH_PE_sdata8 0x0C > -#define DW_EH_PE_signed 0x08 > > #define DW_EH_PE_pcrel 0x10 > #define DW_EH_PE_textrel 0x20 This file is owned by GCC (see the MAINTAINERS file at the top of binutils-gdb). To get a modification in it, you would need to provide a patch to gcc, then we can import the change in binutils-gdb. I am not too sure who is responsible for allocating these values, as they are not from the DWARF standard. At the very least, there should be a comment to say what architecture uses this non-standard value. Is there also a gcc port you are planning to upstream, that would use this value? Simon