From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23697 invoked by alias); 1 Oct 2012 13:41:23 -0000 Received: (qmail 23683 invoked by uid 22791); 1 Oct 2012 13:41:21 -0000 X-SWARE-Spam-Status: No, hits=-4.2 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,TW_XS X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 01 Oct 2012 13:41:15 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1TIgFF-0002SE-Tl from Dmitry_Kozlov@mentor.com ; Mon, 01 Oct 2012 06:41:13 -0700 Received: from SVR-IES-FEM-02.mgc.mentorg.com ([137.202.0.106]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Mon, 1 Oct 2012 06:41:13 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-02.mgc.mentorg.com (137.202.0.106) with Microsoft SMTP Server id 14.1.289.1; Mon, 1 Oct 2012 14:41:11 +0100 Message-ID: <50699D74.2090401@mentor.com> Date: Mon, 01 Oct 2012 13:41:00 -0000 From: Dmitry Kozlov User-Agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120912 Thunderbird/15.0.1 MIME-Version: 1.0 To: Tom Tromey CC: , "'Stan_Shebs@mentor.com'" , Vladimir Prus Subject: Re: PATCH fix start-time and stop-time in trace-status References: <506444DD.9040503@mentor.com> <87d317wlaa.fsf@fleche.redhat.com> In-Reply-To: <87d317wlaa.fsf@fleche.redhat.com> Content-Type: multipart/mixed; boundary="------------060200010809000201000401" 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/msg00005.txt.bz2 --------------060200010809000201000401 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Content-length: 326 Tom, I have updated the patch. Thank you, Dmitry On 09/27/2012 07:14 PM, Tom Tromey wrote: >>>>>> "Dmitry" == Dmitry Kozlov writes: > Dmitry> +char *unpack_ulongest (char *buff, ULONGEST *result); > > I think you could use the existing strtoulst rather than introducing a > new function. > > Tom --------------060200010809000201000401 Content-Type: text/x-patch; name="gdb_dates_v2.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="gdb_dates_v2.diff" Content-length: 2843 diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 20631b5..eeaf805 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2012-10-01 Dmitry Kozlov + + * tracepoint.c (trace_status_command): Fix type of printf arg. + (trace_status_mi): Likewise. + 2012-10-01 Andrew Burgess * target.c (simple_search_memory): Include access length in diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index cce8d00..0f94150 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -2041,20 +2041,20 @@ trace_status_command (char *args, int from_tty) /* Reporting a run time is more readable than two long numbers. */ printf_filtered (_("Trace started at %ld.%06ld secs, stopped %ld.%06ld secs later.\n"), - (long int) ts->start_time / 1000000, - (long int) ts->start_time % 1000000, - (long int) run_time / 1000000, - (long int) run_time % 1000000); + (long int) (ts->start_time / 1000000), + (long int) (ts->start_time % 1000000), + (long int) (run_time / 1000000), + (long int) (run_time % 1000000)); } else printf_filtered (_("Trace started at %ld.%06ld secs.\n"), - (long int) ts->start_time / 1000000, - (long int) ts->start_time % 1000000); + (long int) (ts->start_time / 1000000), + (long int) (ts->start_time % 1000000)); } else if (ts->stop_time) printf_filtered (_("Trace stopped at %ld.%06ld secs.\n"), - (long int) ts->stop_time / 1000000, - (long int) ts->stop_time % 1000000); + (long int) (ts->stop_time / 1000000), + (long int) (ts->stop_time % 1000000)); /* Now report any per-tracepoint status available. */ tp_vec = all_tracepoints (); @@ -2169,12 +2169,12 @@ trace_status_mi (int on_stop) char buf[100]; xsnprintf (buf, sizeof buf, "%ld.%06ld", - (long int) ts->start_time / 1000000, - (long int) ts->start_time % 1000000); + (long int) (ts->start_time / 1000000), + (long int) (ts->start_time % 1000000)); ui_out_field_string (uiout, "start-time", buf); xsnprintf (buf, sizeof buf, "%ld.%06ld", - (long int) ts->stop_time / 1000000, - (long int) ts->stop_time % 1000000); + (long int) (ts->stop_time / 1000000), + (long int) (ts->stop_time % 1000000)); ui_out_field_string (uiout, "stop-time", buf); } } @@ -3940,12 +3940,12 @@ Status line: '%s'\n"), p, line); } else if (strncmp (p, "starttime", p1 - p) == 0) { - p = unpack_varlen_hex (++p1, &val); + val = strtoulst(++p1, (const char **) &p, 10); ts->start_time = val; } else if (strncmp (p, "stoptime", p1 - p) == 0) { - p = unpack_varlen_hex (++p1, &val); + val = strtoulst(++p1, (const char **) &p, 10); ts->stop_time = val; } else if (strncmp (p, "username", p1 - p) == 0) --------------060200010809000201000401--