From patchwork Thu Feb 22 15:36:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 26003 Received: (qmail 31193 invoked by alias); 22 Feb 2018 15:36:49 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 31055 invoked by uid 89); 22 Feb 2018 15:36:48 -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, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=H*r:sk:static. X-HELO: mail-wm0-f68.google.com Received: from mail-wm0-f68.google.com (HELO mail-wm0-f68.google.com) (74.125.82.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 22 Feb 2018 15:36:47 +0000 Received: by mail-wm0-f68.google.com with SMTP id t3so4690839wmc.2 for ; Thu, 22 Feb 2018 07:36:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=67io5FALgNytiS9M6a8RaxBrlN7SgUShXwgTOM3RqNU=; b=o9c5AUJ8H6vXWWSUkRP2SEhzH6k5obITQIYDENqVFVdgq6DmReTxzyZMRQtGYYGwsn ncEo3v7C32vQRBw7Ba4Ri2VSqc/f+oHuJbu8MOaqPhRBI3EZ1xbWGt/ihGWKYCarZ7oF CpxlOZ/5y2zx7lMRoHJP/oyA/IaAwEunsJHya/p1iBzpPr6JPtP34l/k4M9faJaCSBya okJjINgMfTkcpbv92KPPX3t0TgHuuVgp81l0u9ZWRTAKj8GDzOJDJxkMyZb5YVttP0ec w3DS8wk0Rf8iLsd8hmI4SDdXkmlPELBTZfWV58OVZ5BWM5GSrmZE2zzZIp/rlTn2Xmc/ Hg0w== X-Gm-Message-State: APf1xPAaCZGC3ld84nUiWiy8kTHvDTi+8AwnkUkgT3WxoY2S5xt9jamY tlLRM3tac324V7O7dvTuLwpgasFB X-Google-Smtp-Source: AH8x2262ihXAnTvRsUnwVxWERgvYVMKDgMlPx/z40zpNi0pR55S+ke68ljS+M8UwJlwNi/LdvbPF0g== X-Received: by 10.28.179.9 with SMTP id c9mr4843681wmf.99.1519313805115; Thu, 22 Feb 2018 07:36:45 -0800 (PST) Received: from E107787-LIN.cambridge.arm.com (static.42.136.251.148.clients.your-server.de. [148.251.136.42]) by smtp.gmail.com with ESMTPSA id a67sm538325wrc.13.2018.02.22.07.36.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 22 Feb 2018 07:36:44 -0800 (PST) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH 5/7] Remove one argument abbrev_len in read_partial_die Date: Thu, 22 Feb 2018 15:36:34 +0000 Message-Id: <1519313796-2397-6-git-send-email-yao.qi@linaro.org> In-Reply-To: <1519313796-2397-1-git-send-email-yao.qi@linaro.org> References: <1519313796-2397-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes 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 | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index b01d9f3..333a890 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, @@ -18348,8 +18347,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 @@ -18524,13 +18523,13 @@ partial_die_info::partial_die_info (sect_offset sect_off_, { } -/* Read a minimal amount of information into the minimal die structure. */ +/* Read a minimal amount of information into the minimal die structure. + INFO_PTR should point just after the initial uleb128 of a DIE. */ 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 @@ -18543,8 +18542,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);