From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27316 invoked by alias); 3 Dec 2017 18:06:45 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 27303 invoked by uid 89); 3 Dec 2017 18:06:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 03 Dec 2017 18:06:43 +0000 Received: from [10.0.0.11] (192-222-251-162.qc.cable.ebox.net [192.222.251.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 0B7461E4C2; Sun, 3 Dec 2017 13:06:41 -0500 (EST) Subject: Re: [PATCH] Remove mem_region_vector typedef To: Simon Marchi , gdb-patches@sourceware.org References: <1509377531-21044-1-git-send-email-palves@redhat.com> <1509383122-5110-1-git-send-email-simon.marchi@ericsson.com> From: Simon Marchi Message-ID: <8cb9cb4b-29e5-6312-dd4a-e4d74d565774@simark.ca> Date: Sun, 03 Dec 2017 18:06:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <1509383122-5110-1-git-send-email-simon.marchi@ericsson.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-12/txt/msg00062.txt.bz2 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) : 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. > --- > 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 > 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 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_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 (*to_memory_map) (struct target_ops *) > TARGET_DEFAULT_RETURN (std::vector ()); > > /* Erases the region of flash memory starting at ADDRESS, of > I pushed this one in too. Simon