From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 118133 invoked by alias); 29 Jan 2018 01:30:50 -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 118121 invoked by uid 89); 29 Jan 2018 01:30:50 -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:30:48 +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 4FC2C1E513; Sun, 28 Jan 2018 20:30:47 -0500 (EST) Subject: Re: [PATCH 5/7] Remove one argument abbrev_len in read_partial_die To: Yao Qi , gdb-patches@sourceware.org References: <1516873114-7449-1-git-send-email-yao.qi@linaro.org> <1516873114-7449-6-git-send-email-yao.qi@linaro.org> From: Simon Marchi Message-ID: <065c8059-7456-a1ac-8a6c-6f98cc09e43a@simark.ca> Date: Mon, 29 Jan 2018 01:30: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-6-git-send-email-yao.qi@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-01/txt/msg00578.txt.bz2 On 2018-01-25 04:38 AM, Yao Qi wrote: > gdb: > > 2018-01-11 Yao Qi > > * dwarf2read.c (read_partial_die): Update the declaration. > (load_partial_dies): Caller update. > (read_partial_die): Remove one argument abbrev_len. > --- > gdb/dwarf2read.c | 10 +++------- > 1 file changed, 3 insertions(+), 7 deletions(-) > > diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c > index 9b4d09e..0ee102a 100644 > --- a/gdb/dwarf2read.c > +++ b/gdb/dwarf2read.c > @@ -1834,7 +1834,6 @@ static struct partial_die_info *load_partial_dies > static const gdb_byte *read_partial_die (const struct die_reader_specs *, > struct partial_die_info *, > struct abbrev_info *, > - unsigned int, > const gdb_byte *); > > static struct partial_die_info *find_partial_die (sect_offset, int, > @@ -18315,8 +18314,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, bytes_read, > - info_ptr); > + info_ptr = read_partial_die (reader, &pdi, abbrev, > + (const gdb_byte *) info_ptr + bytes_read); > > /* This two-pass algorithm for processing partial symbols has a > high cost in cache pressure. Thus, handle some simple cases > @@ -18498,8 +18497,7 @@ partial_die_info::partial_die_info (sect_offset sect_off_, > static const gdb_byte * > read_partial_die (const struct die_reader_specs *reader, > struct partial_die_info *part_die, > - struct abbrev_info *abbrev, unsigned int abbrev_len, > - const gdb_byte *info_ptr) > + struct abbrev_info *abbrev, const gdb_byte *info_ptr) > { > struct dwarf2_cu *cu = reader->cu; > struct dwarf2_per_objfile *dwarf2_per_objfile > @@ -18512,8 +18510,6 @@ read_partial_die (const struct die_reader_specs *reader, > int has_high_pc_attr = 0; > int high_pc_relative = 0; > > - info_ptr += abbrev_len; > - > for (i = 0; i < abbrev->num_attrs; ++i) > { > info_ptr = read_attribute (reader, &attr, &abbrev->attrs[i], info_ptr); > I didn't see the value of this change at first, but it makes the meaning of info_ptr the same in read_partial_die as in skip_one_die, so I think it's good. Could you improve the documentation of read_partial_die to clarify that INFO_PTR points after the abbrev code? The skip_one_die doc already specifies that, so you could just steal it from there. Simon