From: Simon Marchi <simark@simark.ca>
To: Simon Marchi <simon.marchi@ericsson.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Remove mem_region_vector typedef
Date: Sun, 03 Dec 2017 18:06:00 -0000 [thread overview]
Message-ID: <8cb9cb4b-29e5-6312-dd4a-e4d74d565774@simark.ca> (raw)
In-Reply-To: <1509383122-5110-1-git-send-email-simon.marchi@ericsson.com>
On 2017-10-30 01:05 PM, Simon Marchi wrote:
> [Something we can push once that series is in.]
>
> Now that make-target-delegates understands namespaces and templates,
> this typedef is no longer useful.
>
> gdb/ChangeLog:
>
> * target.h (mem_region_vector): Remove.
> (struct target_ops) <to_memory_map>: Change return type to
> std::vector<mem_region>.
> * target-debug.h (target_debug_print_mem_region_vector): Rename
> to ...
> (target_debug_print_std_vector_mem_region): ... this.
> * target-delegates.c: Re-generate.
> ---
> gdb/target-debug.h | 2 +-
> gdb/target-delegates.c | 10 +++++-----
> gdb/target.h | 7 +------
> 3 files changed, 7 insertions(+), 12 deletions(-)
>
> diff --git a/gdb/target-debug.h b/gdb/target-debug.h
> index 383d4ea..27e5a55 100644
> --- a/gdb/target-debug.h
> +++ b/gdb/target-debug.h
> @@ -116,7 +116,7 @@
> target_debug_do_print (host_address_to_string (X))
> #define target_debug_print_bfd_p(X) \
> target_debug_do_print (host_address_to_string (X))
> -#define target_debug_print_mem_region_vector(X) \
> +#define target_debug_print_std_vector_mem_region(X) \
> target_debug_do_print (host_address_to_string (X.data ()))
> #define target_debug_print_VEC_static_tracepoint_marker_p_p(X) \
> target_debug_do_print (host_address_to_string (X))
> diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c
> index 8702a9e..aaf11d8 100644
> --- a/gdb/target-delegates.c
> +++ b/gdb/target-delegates.c
> @@ -2146,29 +2146,29 @@ debug_get_memory_xfer_limit (struct target_ops *self)
> return result;
> }
>
> -static mem_region_vector
> +static std::vector<mem_region>
> delegate_memory_map (struct target_ops *self)
> {
> self = self->beneath;
> return self->to_memory_map (self);
> }
>
> -static mem_region_vector
> +static std::vector<mem_region>
> tdefault_memory_map (struct target_ops *self)
> {
> return std::vector<mem_region> ();
> }
>
> -static mem_region_vector
> +static std::vector<mem_region>
> debug_memory_map (struct target_ops *self)
> {
> - mem_region_vector result;
> + std::vector<mem_region> result;
> fprintf_unfiltered (gdb_stdlog, "-> %s->to_memory_map (...)\n", debug_target.to_shortname);
> result = debug_target.to_memory_map (&debug_target);
> fprintf_unfiltered (gdb_stdlog, "<- %s->to_memory_map (", debug_target.to_shortname);
> target_debug_print_struct_target_ops_p (&debug_target);
> fputs_unfiltered (") = ", gdb_stdlog);
> - target_debug_print_mem_region_vector (result);
> + target_debug_print_std_vector_mem_region (result);
> fputs_unfiltered ("\n", gdb_stdlog);
> return result;
> }
> diff --git a/gdb/target.h b/gdb/target.h
> index 7bcdefb..a4e696f 100644
> --- a/gdb/target.h
> +++ b/gdb/target.h
> @@ -418,11 +418,6 @@ typedef void async_callback_ftype (enum inferior_event_type event_type,
> #define TARGET_DEFAULT_RETURN(ARG)
> #define TARGET_DEFAULT_FUNC(ARG)
>
> -/* Define a typedef, because make-target-delegates doesn't currently handle type
> - names with templates. */
> -
> -typedef std::vector<mem_region> mem_region_vector;
> -
> struct target_ops
> {
> struct target_ops *beneath; /* To the target under this one. */
> @@ -778,7 +773,7 @@ struct target_ops
> This method should not cache data; if the memory map could
> change unexpectedly, it should be invalidated, and higher
> layers will re-fetch it. */
> - mem_region_vector (*to_memory_map) (struct target_ops *)
> + std::vector<mem_region> (*to_memory_map) (struct target_ops *)
> TARGET_DEFAULT_RETURN (std::vector<mem_region> ());
>
> /* Erases the region of flash memory starting at ADDRESS, of
>
I pushed this one in too.
Simon
prev parent reply other threads:[~2017-12-03 18:06 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-30 15:32 [PATCH 0/2] Make make-target-delegates grok C++ type names better Pedro Alves
2017-10-30 15:32 ` [PATCH 1/2] Make make-target-delegates grok namespace scope op and template params Pedro Alves
2017-10-30 16:02 ` Simon Marchi
2017-12-03 0:51 ` Simon Marchi
2017-12-03 11:58 ` Pedro Alves
2017-12-03 18:00 ` Simon Marchi
2017-10-30 15:32 ` [PATCH 2/2] target_set_syscall_catchpoint, use gdb::array_view and bool Pedro Alves
2017-10-30 15:59 ` Simon Marchi
2017-10-30 15:59 ` John Baldwin
2017-12-03 18:18 ` Simon Marchi
2017-12-06 22:38 ` John Baldwin
2017-12-06 22:50 ` Simon Marchi
2017-10-30 17:05 ` [PATCH] Remove mem_region_vector typedef Simon Marchi
2017-12-03 18:06 ` Simon Marchi [this message]
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=8cb9cb4b-29e5-6312-dd4a-e4d74d565774@simark.ca \
--to=simark@simark.ca \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@ericsson.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