From: Yao Qi <qiyaoltc@gmail.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 3/7] Change find_partial_die_in_comp_unit to dwarf2_cu::find_partial_die
Date: Thu, 22 Feb 2018 15:36:00 -0000 [thread overview]
Message-ID: <1519313796-2397-4-git-send-email-yao.qi@linaro.org> (raw)
In-Reply-To: <1519313796-2397-1-git-send-email-yao.qi@linaro.org>
This patch changes find_partial_die_in_comp_unit to a dwarf2_cu method
find_partial_die.
gdb:
2018-01-11 Yao Qi <yao.qi@linaro.org>
* dwarf2read.c (struct dwarf2_cu) <find_partial_die>: 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 147c7ca..f386873 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
@@ -18701,15 +18703,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;
@@ -18732,7 +18734,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.
@@ -18756,7 +18758,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,
@@ -18774,7 +18776,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)
--
1.9.1
next prev parent reply other threads:[~2018-02-22 15:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-22 15:36 [PATCH 0/7 v2] Class-fy partial_die_info Yao Qi
2018-02-22 15:36 ` [PATCH 5/7] Remove one argument abbrev_len in read_partial_die Yao Qi
2018-02-22 15:36 ` [PATCH 4/7] Class-fy partial_die_info Yao Qi
2018-02-22 15:36 ` Yao Qi [this message]
2018-02-22 15:36 ` [PATCH 1/7] Re-write partial_die_info allocation in load_partial_dies Yao Qi
2018-02-22 15:36 ` [PATCH 7/7] Move read_partial_die to partial_die_info::read Yao Qi
2018-02-22 15:36 ` [PATCH 2/7] Don't check abbrev is NULL in read_partial_die Yao Qi
2018-02-25 23:33 ` Simon Marchi
2018-02-22 15:36 ` [PATCH 6/7] Move fixup_partial_die to partial_die_info::fixup Yao Qi
2018-02-25 23:52 ` [PATCH 0/7 v2] Class-fy partial_die_info Simon Marchi
2018-02-26 15:39 ` Yao Qi
-- strict thread matches above, loose matches on Subject: below --
2018-01-25 9:38 [PATCH 0/7] " Yao Qi
2018-01-25 9:38 ` [PATCH 3/7] Change find_partial_die_in_comp_unit to dwarf2_cu::find_partial_die Yao Qi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1519313796-2397-4-git-send-email-yao.qi@linaro.org \
--to=qiyaoltc@gmail.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).