From patchwork Wed Oct 14 11:14:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: henrik.wallin@windriver.com X-Patchwork-Id: 9108 Received: (qmail 86786 invoked by alias); 14 Oct 2015 15:07:45 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 86711 invoked by uid 89); 14 Oct 2015 15:07:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=1.2 required=5.0 tests=AWL, BAYES_50, KAM_LAZY_DOMAIN_SECURITY, T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mail.windriver.com Received: from mail.windriver.com (HELO mail.windriver.com) (147.11.1.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 14 Oct 2015 15:07:42 +0000 Received: from arn-build2.wrs.com (arn-build2.wrs.com [128.224.95.15]) by mail.windriver.com (8.15.2/8.15.1) with ESMTP id t9EBEZQw010718 for ; Wed, 14 Oct 2015 04:14:35 -0700 (PDT) Received: by arn-build2.wrs.com (Postfix, from userid 18580) id DE003220A9C; Wed, 14 Oct 2015 13:14:33 +0200 (CEST) From: henrik.wallin@windriver.com To: gdb-patches@sourceware.org Subject: [RFC][PATCH 06/15] Add possibility to restart trace after tfind. Date: Wed, 14 Oct 2015 13:14:24 +0200 Message-Id: <1dcc0d92d986b5ecc43973dc75832e01edf69c9f.1444820235.git.henrik.wallin@windriver.com> In-Reply-To: References: In-Reply-To: References: From: Par Olsson After starting examine the collected trace data with tfind it was not possible to re-start a trace session. This patch will add a question if the user wants to drop all collected data and start a new session. gdb/ChangeLog: * tracepoint.c : Initiate traceframe_number. (trace_start_command): Add interactive question if user wants to clear and restart a trace session when issuing a tstart while in progress examining trace data. Signed-off-by: Par Olsson Signed-off-by: Henrik Wallin --- gdb/tracepoint.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 6ca66e7c8d18..4aad1d6a4197 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -123,7 +123,7 @@ static VEC(tsv_s) *tvariables; static int next_tsv_number = 1; /* Number of last traceframe collected. */ -static int traceframe_number; +static int traceframe_number = -1; /* Tracepoint for last traceframe collected. */ static int tracepoint_number; @@ -1914,6 +1914,18 @@ trace_start_command (char *args, int from_tty) && !query (_("A trace is running already. Start a new run? "))) error (_("New trace run not started.")); } + if (traceframe_number >= 0) + { + if (from_tty + && !query (_("Currently examining trace data. " + "Start a new run? "))) + error (_("New trace run not started.")); + /* Reset our local state. */ + set_traceframe_num (-1); + set_tracepoint_num (-1); + set_traceframe_context (NULL); + clear_traceframe_info (); + } start_tracing (args); }