From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10602 invoked by alias); 16 Mar 2010 13:58:57 -0000 Received: (qmail 10593 invoked by uid 22791); 16 Mar 2010 13:58:56 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 16 Mar 2010 13:58:51 +0000 Received: (qmail 32669 invoked from network); 16 Mar 2010 13:58:49 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 16 Mar 2010 13:58:49 -0000 From: Pedro Alves To: Vladimir Prus Subject: Re: [MI tracepoints 4/9] -trace-start/end/status Date: Tue, 16 Mar 2010 13:58:00 -0000 User-Agent: KMail/1.12.2 (Linux/2.6.31-19-generic; KDE/4.3.2; x86_64; ; ) Cc: gdb-patches@sourceware.org, Stan Shebs References: <201003141154.07272.vladimir@codesourcery.com> <201003151846.05739.pedro@codesourcery.com> <201003161512.33593.vladimir@codesourcery.com> In-Reply-To: <201003161512.33593.vladimir@codesourcery.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201003161358.48076.pedro@codesourcery.com> X-IsSubscribed: yes 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 X-SW-Source: 2010-03/txt/msg00582.txt.bz2 On Tuesday 16 March 2010 12:12:33, Vladimir Prus wrote: > On Monday 15 March 2010 21:46:05 Pedro Alves wrote: > > > Double space after period everywhere please. > > > > + ui_out_field_int (uiout, "buffer-size", (int) ts->buffer_size); > > + ui_out_field_int (uiout, "buffer-free", (int) ts->buffer_free); > > > > When these optional fields aren't reported by the target, this > > will print -1. I don't see that mentioned in the manual. Is > > this intended? I would have expected optional fields to just > > not be present, as is common in MI. trace_status_command does > > that too. > > I did not realize they are optional. All status fields are optional, except for "running", "not running". The original packet was just: @item qTStatus Ask the stub if there is a trace experiment running right now. Replies: @table @samp @item T0 There is no trace experiment running. @item T1 There is a trace experiment running. @end table We then added the support for passing a `:' list of extra fields to that packet. See tracepoint.c:parse_trace_status. > Attached is the revised patch, > + gdb_assert (ts->stop_reason != trace_stop_reason_unknown); Therefore, this assertion is too strong. It should be a plain if (ts->stop_reason != trace_stop_reason_unknown) { > + > + switch (ts->stop_reason) > + { > + case tstop_command: > + stop_reason = "request"; > + break; > + case trace_buffer_full: > + stop_reason = "overflow"; > + break; > + case trace_disconnected: > + stop_reason = "disconnection"; > + break; > + case tracepoint_passcount: > + stop_reason = "passcount"; > + stopping_tracepoint = ts->stopping_tracepoint; > + break; > + } > + > + if (stop_reason) > + { > + ui_out_field_string (uiout, "stop-reason", stop_reason); > + if (stopping_tracepoint != -1) > + ui_out_field_int (uiout, "stopping-tracepoint", > + stopping_tracepoint); > + } > + } > + And this one should be conditionalized as well: > + ui_out_field_int (uiout, "frames", ts->traceframe_count); And I think the manual patch should be updated to mention any of these fields might be missing. -- Pedro Alves