From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7182 invoked by alias); 11 Oct 2012 17:10:12 -0000 Received: (qmail 7163 invoked by uid 22791); 11 Oct 2012 17:10:09 -0000 X-SWARE-Spam-Status: No, hits=-8.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 11 Oct 2012 17:09:57 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q9BH9sro014971 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Oct 2012 13:09:54 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q9BH9pfd027011; Thu, 11 Oct 2012 13:09:52 -0400 Message-ID: <5076FD5F.4060009@redhat.com> Date: Thu, 11 Oct 2012 17:10:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1 MIME-Version: 1.0 To: Dmitry Kozlov CC: Yao Qi , gdb-patches@sourceware.org, "'Stan_Shebs@mentor.com'" , Vladimir Prus Subject: Re: [PATCH] Extend tsave: save start time, stop time, user and notes References: <506C4719.3030900@mentor.com> <5072CB78.8030908@codesourcery.com> <5076EB66.6080307@mentor.com> In-Reply-To: <5076EB66.6080307@mentor.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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: 2012-10/txt/msg00180.txt.bz2 On 10/11/2012 04:53 PM, Dmitry Kozlov wrote: >> Logically, this patch depends on your previous patch >> >> PATCH fix start-time and stop-time in trace-status >> http://sourceware.org/ml/gdb-patches/2012-09/msg00621.html >> >> otherwise, we generate start-time and stop-time in trace file in decimal format, while gdb still interprets it as hex. Since gdbserver and gdb have always been in disagreement (IOW, this never worked correctly with gdbserver, so we're free to change it), and the RSP uses hex everywhere (*), let's fix gdbserver instead. @cindex remote protocol, field separator Fields within the packet should be separated using @samp{,} @samp{;} or @samp{:}. Except where otherwise noted all numbers are represented in @sc{hex} with leading zeros suppressed. > +2012-10-04 Dmitry Kozlov > + > + * tracepoint.c (trace_save): Add saving starttime, stoptime, user and notes. > + > +2012-10-04 Dmitry Kozlov > + > + * tracepoint.c (trace_status_command): Fix type of printf arg. > + (trace_status_mi): Likewise. Looks like something stale (two entries). > + > 2012-10-03 Doug Evans > > PR symtab/14601 > diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c > index 0f94150..959ede5 100644 > --- a/gdb/tracepoint.c > +++ b/gdb/tracepoint.c > @@ -3018,10 +3018,11 @@ trace_save (const char *filename, int target_does_save) > (ts->running ? '1' : '0'), stop_reason_names[ts->stop_reason]); > if (ts->stop_reason == tracepoint_error) > { > - char *buf = (char *) alloca (strlen (ts->stop_desc) * 2 + 1); > + char *buf = (char *) xmalloc (strlen (ts->stop_desc) * 2 + 1); > > bin2hex ((gdb_byte *) ts->stop_desc, buf, 0); > fprintf (fp, ":%s", buf); > + xfree (buf); > } > fprintf (fp, ":%x", ts->stopping_tracepoint); > if (ts->traceframe_count >= 0) > @@ -3036,6 +3037,35 @@ trace_save (const char *filename, int target_does_save) > fprintf (fp, ";disconn:%x", ts->disconnected_tracing); > if (ts->circular_buffer) > fprintf (fp, ";circular:%x", ts->circular_buffer); > + if (ts->start_time) > + { > + fprintf (fp, ";starttime:%ld%06ld", > + (long int) (ts->start_time / 1000000), > + (long int) (ts->start_time % 1000000)); See above. Numbers in the remote protocol are represented in hex. > + } > + if (ts->stop_time) > + { > + fprintf (fp, ";stoptime:%ld%06ld", > + (long int) (ts->stop_time / 1000000), > + (long int) (ts->stop_time % 1000000)); > + } > + if (ts->notes && ts->notes[0] != 0 ) Spurious space after 0. > + { > + char *buf = (char *) xmalloc (strlen (ts->notes) * 2 + 1); Unnecessary cast. > + > + bin2hex ((gdb_byte *) ts->notes, buf, 0); > + fprintf (fp, ";notes:%s", buf); > + xfree (buf); Indentation is off (compared to ts->stop_time branch above). Check tabs vs spaces. > + } > + if (ts->user_name) As Yao pointed out, shouldn't this get the same check for empty string? > + { > + char *buf = (char *) xmalloc (strlen (ts->user_name) * 2 + 1); > + > + bin2hex ((gdb_byte *) ts->user_name, buf, 0); > + fprintf (fp, ";username:%s", buf); > + xfree (buf); > + } -- Pedro Alves