From: Simon Marchi Date: Sun, 3 Dec 2017 18:01:03 +0000 (-0500) Subject: Remove mem_region_vector typedef X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1e97a22796cced8bba3359df46e8c2883653516f;p=binutils-gdb.git Remove mem_region_vector typedef 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) : Change return type to std::vector. * target-debug.h (target_debug_print_mem_region_vector): Rename to ... (target_debug_print_std_vector_mem_region): ... this. * target-delegates.c: Re-generate. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a360083f511..d1704c0c21e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,13 @@ +2017-12-03 Simon Marchi + + * target.h (mem_region_vector): Remove. + (struct target_ops) : Change return type to + std::vector. + * target-debug.h (target_debug_print_mem_region_vector): Rename + to ... + (target_debug_print_std_vector_mem_region): ... this. + * target-delegates.c: Re-generate. + 2017-12-03 Pedro Alves * make-target-delegates (munge_type): Also munge '<', '>', and diff --git a/gdb/target-debug.h b/gdb/target-debug.h index 068495e4804..d1d7fb5b832 100644 --- a/gdb/target-debug.h +++ b/gdb/target-debug.h @@ -114,7 +114,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 1cbe6f80448..9691074bfe2 100644 --- a/gdb/target-delegates.c +++ b/gdb/target-delegates.c @@ -2148,29 +2148,29 @@ debug_get_memory_xfer_limit (struct target_ops *self) return result; } -static mem_region_vector +static std::vector delegate_memory_map (struct target_ops *self) { self = self->beneath; return self->to_memory_map (self); } -static mem_region_vector +static std::vector tdefault_memory_map (struct target_ops *self) { return std::vector (); } -static mem_region_vector +static std::vector debug_memory_map (struct target_ops *self) { - mem_region_vector result; + std::vector 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 0d1e7bd6e8d..638e2f06e68 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_vector; - struct target_ops { struct target_ops *beneath; /* To the target under this one. */ @@ -777,7 +772,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 (*to_memory_map) (struct target_ops *) TARGET_DEFAULT_RETURN (std::vector ()); /* Erases the region of flash memory starting at ADDRESS, of