From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 100065 invoked by alias); 29 Jan 2018 01:58:10 -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 100047 invoked by uid 89); 29 Jan 2018 01:58:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 29 Jan 2018 01:58:08 +0000 Received: from [10.0.0.11] (192-222-251-162.qc.cable.ebox.net [192.222.251.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 33CF51E513; Sun, 28 Jan 2018 20:58:07 -0500 (EST) Subject: Re: [PATCH 7/7] Move read_partial_die to partial_die_info::read To: Yao Qi , gdb-patches@sourceware.org References: <1516873114-7449-1-git-send-email-yao.qi@linaro.org> <1516873114-7449-8-git-send-email-yao.qi@linaro.org> From: Simon Marchi Message-ID: Date: Mon, 29 Jan 2018 01:58:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <1516873114-7449-8-git-send-email-yao.qi@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-01/txt/msg00579.txt.bz2 On 2018-01-25 04:38 AM, Yao Qi wrote: > gdb: > > 2018-01-11 Yao Qi > > * dwarf2read.c (struct partial_die_info) : New method. > (read_partial_die): Remove the declaration. > (load_partial_dies): Update. > (partial_die_info::partial_die_info): > (read_partial_die): Change it to partial_die_info::read. > --- > gdb/dwarf2read.c | 108 +++++++++++++++++++++++++++++-------------------------- > 1 file changed, 57 insertions(+), 51 deletions(-) > > diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c > index 9b6f2ec..02e4431 100644 > --- a/gdb/dwarf2read.c > +++ b/gdb/dwarf2read.c > @@ -1415,6 +1415,12 @@ struct partial_die_info > name. */ > void fixup (struct dwarf2_cu *cu); > > + /* Read a minimal amount of information into the minimal die > + structure. */ > + const gdb_byte *read (const struct die_reader_specs *reader, > + struct abbrev_info *abbrev, > + const gdb_byte *info_ptr); > + > /* Offset of this DIE. */ > const sect_offset sect_off; > > @@ -1481,8 +1487,8 @@ struct partial_die_info > > /* Pointer into the info_buffer (or types_buffer) pointing at the target of > DW_AT_sibling, if any. */ > - /* NOTE: This member isn't strictly necessary, read_partial_die could > - return DW_AT_sibling values to its caller load_partial_dies. */ > + /* NOTE: This member isn't strictly necessary, partial_die_info::read > + could return DW_AT_sibling values to its caller load_partial_dies. */ > const gdb_byte *sibling = nullptr; > > /* If HAS_SPECIFICATION, the offset of the DIE referred to by > @@ -1836,11 +1842,6 @@ static unsigned int peek_abbrev_code (bfd *, const gdb_byte *); > static struct partial_die_info *load_partial_dies > (const struct die_reader_specs *, const gdb_byte *, int); > > -static const gdb_byte *read_partial_die (const struct die_reader_specs *, > - struct partial_die_info *, > - struct abbrev_info *, > - const gdb_byte *); > - > static struct partial_die_info *find_partial_die (sect_offset, int, > struct dwarf2_cu *); > > @@ -14804,7 +14805,7 @@ dwarf2_get_pc_bounds (struct die_info *die, CORE_ADDR *lowpc, > return PC_BOUNDS_NOT_PRESENT; > } > > - /* read_partial_die has also the strict LOW < HIGH requirement. */ > + /* partial_die_info::read has also the strict LOW < HIGH requirement. */ > if (high <= low) > return PC_BOUNDS_INVALID; > > @@ -18316,8 +18317,8 @@ load_partial_dies (const struct die_reader_specs *reader, > struct partial_die_info pdi ((sect_offset) (info_ptr - reader->buffer), > abbrev); > > - info_ptr = read_partial_die (reader, &pdi, abbrev, > - (const gdb_byte *) info_ptr + bytes_read); > + info_ptr = pdi.read (reader, abbrev, > + (const gdb_byte *) info_ptr + bytes_read); Nit: can you remove the unnecessary cast while at it? Otherwise the patch LGTM (the patches I didn't comment on also LGTM). Simon