From: Kevin Buettner <kevinb@redhat.com>
To: gdb-patches@sourceware.org
Cc: Tom de Vries <tdevries@suse.de>
Subject: Re: [PATCH, gdb/exp] Handle DW_OP_GNU_variable_value refs to abstract dies
Date: Tue, 04 Sep 2018 21:54:00 -0000 [thread overview]
Message-ID: <20180904145449.2cf6a099@pinnacle.lan> (raw)
In-Reply-To: <95697ec8-30e2-acaf-60fd-e46524f88e72@suse.de>
Hi Tom,
Thank you for doing this work. It looks mostly okay, though I do have
a few comments...
Kevin
On Tue, 4 Sep 2018 15:06:34 +0200
Tom de Vries <tdevries@suse.de> wrote:
> 2018-09-04 Tom de Vries <tdevries@suse.de>
>
> * dwarf2loc.c (sect_variable_value): Call indirect_synthetic_pointer
> with resolve_abstract_p == true.
> (indirect_synthetic_pointer): Add resolve_abstract_p parameter,
> defaulting to false. Propagate resolve_abstract_p to
> dwarf2_fetch_die_loc_sect_off.
> * dwarf2loc.h (dwarf2_fetch_die_loc_sect_off): Add resolve_abstract_p
> parameter, defaulting to false.
> * dwarf2read.c (dwarf2_per_objfile::~dwarf2_per_objfile): Reset
> abstract_to_concrete.
> (read_variable): Add variable to abstract_to_concrete.
> (dwarf2_fetch_die_loc_sect_off): Add and handle resolve_abstract_p
> parameter.
> * dwarf2read.h (struct die_info): Forward-declare.
> (die_info_ptr): New typedef.
> (DEF_VEC_P (die_info_ptr)): Add.
> (struct dwarf2_per_objfile): Add abstract_to_concrete field.
>
> * gdb.dwarf2/varval.exp: Add test.
>
> ---
> gdb/dwarf2loc.c | 10 ++++---
> gdb/dwarf2loc.h | 2 +-
> gdb/dwarf2read.c | 56 +++++++++++++++++++++++++++++++++++--
> gdb/dwarf2read.h | 6 ++++
> gdb/testsuite/gdb.dwarf2/varval.exp | 22 ++++++++++++++-
> 5 files changed, 88 insertions(+), 8 deletions(-)
>
> diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
> index 200fa03f46..a75eb158c7 100644
> --- a/gdb/dwarf2loc.c
> +++ b/gdb/dwarf2loc.c
> @@ -65,7 +65,7 @@ static struct value *indirect_synthetic_pointer
> (sect_offset die, LONGEST byte_offset,
> struct dwarf2_per_cu_data *per_cu,
> struct frame_info *frame,
> - struct type *type);
> + struct type *type, bool = false);
Please add a name for the new bool parameter.
> diff --git a/gdb/dwarf2loc.h b/gdb/dwarf2loc.h
> index f82e7b2d11..08120651b6 100644
> --- a/gdb/dwarf2loc.h
> +++ b/gdb/dwarf2loc.h
> @@ -67,7 +67,7 @@ const gdb_byte *dwarf2_find_location_expression
> struct dwarf2_locexpr_baton dwarf2_fetch_die_loc_sect_off
> (sect_offset offset_in_cu, struct dwarf2_per_cu_data *per_cu,
> CORE_ADDR (*get_frame_pc) (void *baton),
> - void *baton);
> + void *baton, bool = false);
Likewise, here.
> diff --git a/gdb/dwarf2read.h b/gdb/dwarf2read.h
> index 13855bcd54..71ef781d17 100644
> --- a/gdb/dwarf2read.h
> +++ b/gdb/dwarf2read.h
> @@ -20,6 +20,7 @@
> #ifndef DWARF2READ_H
> #define DWARF2READ_H
>
> +#include <unordered_map>
> #include "dwarf-index-cache.h"
> #include "filename-seen-cache.h"
> #include "gdb_obstack.h"
> @@ -95,6 +96,9 @@ struct dwarf2_debug_sections;
> struct mapped_index;
> struct mapped_debug_names;
> struct signatured_type;
> +struct die_info;
> +typedef struct die_info *die_info_ptr;
> +DEF_VEC_P (die_info_ptr);
>
> /* Collection of data recorded per objfile.
> This hangs off of dwarf2_objfile_data_key. */
> @@ -250,6 +254,8 @@ public:
> /* If we loaded the index from an external file, this contains the
> resources associated to the open file, memory mapping, etc. */
> std::unique_ptr<index_cache_resource> index_cache_res;
> +
> + std::unordered_map<die_info_ptr, VEC (die_info_ptr) *> abstract_to_concrete;
> };
Is there a good reason to use VEC instead of std::vector? I know that
there have been a number of patches which have been replacing VEC
with std:vector. So, unless there's a compelling reason to use VEC,
we might as well use std:vector here and save someone else the effort
of changing this use of VEC later on.
Also, can you add a comment for abstract_to_concrete?
Kevin
next prev parent reply other threads:[~2018-09-04 21:54 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-03 4:04 [PATCH 0/3] Add support for DW_OP_GNU_variable_value Kevin Buettner
2018-08-03 4:18 ` [PATCH 1/3] " Kevin Buettner
2018-08-03 18:36 ` Tom Tromey
2018-08-18 20:32 ` Kevin Buettner
2018-08-22 15:35 ` Tom de Vries
2018-08-23 21:12 ` Kevin Buettner
2018-08-24 13:09 ` [RFC, gdb/exp] Handle DW_OP_GNU_variable_value refs to abstract dies Tom de Vries
2018-08-24 13:18 ` Richard Biener
2018-09-04 10:17 ` [PATCH, " Tom de Vries
2018-09-04 13:06 ` Tom de Vries
2018-09-04 21:54 ` Kevin Buettner [this message]
2018-09-05 10:53 ` Tom de Vries
2018-09-06 3:46 ` Tom Tromey
2018-09-06 6:40 ` Tom de Vries
2018-09-06 13:11 ` Tom Tromey
2018-08-03 18:43 ` [PATCH 1/3] Add support for DW_OP_GNU_variable_value Tom Tromey
2018-08-03 4:19 ` [PATCH 2/3] Add support of DW_OP_GNU_variable_value to DWARF assembler Kevin Buettner
2018-08-03 18:37 ` Tom Tromey
2018-08-18 20:32 ` Kevin Buettner
2018-08-03 4:22 ` [PATCH 3/3] Test case for DW_OP_GNU_variable_value Kevin Buettner
2018-08-03 18:40 ` Tom Tromey
2018-08-18 20:32 ` Kevin Buettner
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=20180904145449.2cf6a099@pinnacle.lan \
--to=kevinb@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=tdevries@suse.de \
/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