From patchwork Thu Jan 25 09:38:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 25536 Received: (qmail 110776 invoked by alias); 25 Jan 2018 09:38:48 -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 110623 invoked by uid 89); 25 Jan 2018 09:38:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.1 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, UNWANTED_LANGUAGE_BODY autolearn=ham version=3.3.2 spammy=Persistent, H*r:sk:static., held X-HELO: mail-wr0-f181.google.com Received: from mail-wr0-f181.google.com (HELO mail-wr0-f181.google.com) (209.85.128.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 25 Jan 2018 09:38:45 +0000 Received: by mail-wr0-f181.google.com with SMTP id z48so6924158wrz.6 for ; Thu, 25 Jan 2018 01:38:45 -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=g50jF5uQ2+GDWb/w3aW3Cy3VtfKKxGaAx0IeiMjlZKU=; b=AibzN+dU73RQjW8L4Be/FPNGAIyNjBN99MOY6jvFbqOrJreLzh6AB1tVcuZt76+m1R UafHLPSJb8VzcIg7XOKsJHMxwtOIxFa9U6rOMkCjOP4YBV5fffbp7Spd1o32ov+gXpZz B+gtIKp0XAoPwP1mljglXTzhcS82Y4bX8V+cmxtgB1LF3Zlg3YRqv4spsxc7TyWQlAy1 ciBxD92TdEL+baPFy2n1TIBCBnxYyFtPCi8EtZjI8x/sh3UgYbWXWg4WYAZMBSojCHUL C5/xEqkqX4BE4A6fEhVW//f3E4GQYeRHxQEWRMcjuCyOw2fWA8DVorf5UixZ4FBg/H7Y FQXA== X-Gm-Message-State: AKwxytd+2yXWyDbJgVTaJhveqZQIuNKim9p4e5UlE1LS2axona0yLtiX /eqBDqBZM8fL2Ql+Hcpnyzaltg== X-Google-Smtp-Source: AH8x22613fF7a5w6hbPdhkeL6FB8SKaIYxmnFrWQcneCeZigJ5Q5h0EXQMNhTxxcCgPY1Qklc0sHhg== X-Received: by 10.223.172.52 with SMTP id v49mr1711946wrc.125.1516873123531; Thu, 25 Jan 2018 01:38:43 -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 p15sm3767493wre.47.2018.01.25.01.38.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 25 Jan 2018 01:38:43 -0800 (PST) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH 3/7] Change find_partial_die_in_comp_unit to dwarf2_cu::find_partial_die Date: Thu, 25 Jan 2018 09:38:30 +0000 Message-Id: <1516873114-7449-4-git-send-email-yao.qi@linaro.org> In-Reply-To: <1516873114-7449-1-git-send-email-yao.qi@linaro.org> References: <1516873114-7449-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes This patch changes find_partial_die_in_comp_unit to a dwarf2_cu method find_partial_die. gdb: 2018-01-11 Yao Qi * dwarf2read.c (struct dwarf2_cu) : New method. (find_partial_die_in_comp_unit): Change it to dwarf2_cu::find_partial_die. (find_partial_die): Update. --- gdb/dwarf2read.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 0853282..937faa2 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -785,6 +785,8 @@ struct dwarf2_cu this information, but later versions do. */ unsigned int processing_has_namespace_info : 1; + + struct partial_die_info *find_partial_die (sect_offset sect_off); }; /* Persistent data held for a compilation unit, even when not @@ -18668,15 +18670,15 @@ read_partial_die (const struct die_reader_specs *reader, /* Find a cached partial DIE at OFFSET in CU. */ -static struct partial_die_info * -find_partial_die_in_comp_unit (sect_offset sect_off, struct dwarf2_cu *cu) +struct partial_die_info * +dwarf2_cu::find_partial_die (sect_offset sect_off) { struct partial_die_info *lookup_die = NULL; struct partial_die_info part_die; part_die.sect_off = sect_off; lookup_die = ((struct partial_die_info *) - htab_find_with_hash (cu->partial_dies, &part_die, + htab_find_with_hash (partial_dies, &part_die, to_underlying (sect_off))); return lookup_die; @@ -18699,7 +18701,7 @@ find_partial_die (sect_offset sect_off, int offset_in_dwz, struct dwarf2_cu *cu) if (offset_in_dwz == cu->per_cu->is_dwz && offset_in_cu_p (&cu->header, sect_off)) { - pd = find_partial_die_in_comp_unit (sect_off, cu); + pd = cu->find_partial_die (sect_off); if (pd != NULL) return pd; /* We missed recording what we needed. @@ -18723,7 +18725,7 @@ find_partial_die (sect_offset sect_off, int offset_in_dwz, struct dwarf2_cu *cu) load_partial_comp_unit (per_cu); per_cu->cu->last_used = 0; - pd = find_partial_die_in_comp_unit (sect_off, per_cu->cu); + pd = per_cu->cu->find_partial_die (sect_off); } /* If we didn't find it, and not all dies have been loaded, @@ -18741,7 +18743,7 @@ find_partial_die (sect_offset sect_off, int offset_in_dwz, struct dwarf2_cu *cu) set. */ load_partial_comp_unit (per_cu); - pd = find_partial_die_in_comp_unit (sect_off, per_cu->cu); + pd = per_cu->cu->find_partial_die (sect_off); } if (pd == NULL)