From: Simon Marchi <simark@simark.ca>
To: Yao Qi <qiyaoltc@gmail.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 7/7] Move read_partial_die to partial_die_info::read
Date: Mon, 29 Jan 2018 01:58:00 -0000 [thread overview]
Message-ID: <ecdbcca3-2aa2-91d9-008b-b60061fe91c8@simark.ca> (raw)
In-Reply-To: <1516873114-7449-8-git-send-email-yao.qi@linaro.org>
On 2018-01-25 04:38 AM, Yao Qi wrote:
> gdb:
>
> 2018-01-11 Yao Qi <yao.qi@linaro.org>
>
> * dwarf2read.c (struct partial_die_info) <read>: 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
next prev parent reply other threads:[~2018-01-29 1:58 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-25 9:38 [PATCH 0/7] Class-fy partial_die_info Yao Qi
2018-01-25 9:38 ` [PATCH 7/7] Move read_partial_die to partial_die_info::read Yao Qi
2018-01-29 1:58 ` Simon Marchi [this message]
2018-01-25 9:38 ` [PATCH 1/7] Re-write partial_die_info allocation in load_partial_dies Yao Qi
2018-01-25 9:38 ` [PATCH 6/7] Move fixup_partial_die to partial_die_info::fixup Yao Qi
2018-01-25 12:59 ` Pedro Alves
2018-01-25 14:45 ` Yao Qi
2018-01-25 9:38 ` [PATCH 5/7] Remove one argument abbrev_len in read_partial_die Yao Qi
2018-01-29 1:30 ` Simon Marchi
2018-01-25 9:38 ` [PATCH 3/7] Change find_partial_die_in_comp_unit to dwarf2_cu::find_partial_die Yao Qi
2018-01-25 9:38 ` [PATCH 2/7] Don't check abbrev is NULL in read_partial_die Yao Qi
2018-01-25 9:38 ` [PATCH 4/7] Class-fy partial_die_info Yao Qi
2018-01-25 16:19 ` Tom Tromey
2018-01-26 17:25 ` Yao Qi
2018-01-26 20:55 ` Tom Tromey
2018-01-29 1:15 ` Simon Marchi
2018-01-30 10:49 ` Yao Qi
2018-01-30 15:11 ` Pedro Alves
2018-01-30 11:39 ` Pedro Alves
2018-01-31 3:46 ` Simon Marchi
2018-01-31 11:55 ` Yao Qi
2018-01-31 15:33 ` Pedro Alves
2018-01-25 12:05 ` [PATCH 0/7] " Joel Brobecker
2018-01-25 14:03 ` Yao Qi
2018-02-22 15:36 [PATCH 0/7 v2] " Yao Qi
2018-02-22 15:36 ` [PATCH 7/7] Move read_partial_die to partial_die_info::read 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=ecdbcca3-2aa2-91d9-008b-b60061fe91c8@simark.ca \
--to=simark@simark.ca \
--cc=gdb-patches@sourceware.org \
--cc=qiyaoltc@gmail.com \
/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).