From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4643 invoked by alias); 10 Jun 2013 12:48:14 -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 4633 invoked by uid 89); 10 Jun 2013 12:48:14 -0000 X-Spam-SWARE-Status: No, score=-3.9 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,TW_XS autolearn=ham version=3.3.1 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 10 Jun 2013 12:47:55 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1Um1Vq-0005f5-68 from Dmitry_Kozlov@mentor.com ; Mon, 10 Jun 2013 05:47:54 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 10 Jun 2013 05:47:54 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.2.247.3; Mon, 10 Jun 2013 13:47:52 +0100 Message-ID: <51B5CAF5.3090101@mentor.com> Date: Mon, 10 Jun 2013 13:08:00 -0000 From: Dmitry Kozlov User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 MIME-Version: 1.0 To: , Pedro Alves CC: Vladimir Prus Subject: [PATCH 2 OF 2] extend tsave to write start and stop time into a trace file Content-Type: multipart/mixed; boundary="------------040802020906070201020001" X-Virus-Found: No X-SW-Source: 2013-06/txt/msg00224.txt.bz2 --------------040802020906070201020001 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Content-length: 202 Hi Pedro, some time ago we already discussed these patches, could you please review them again. And this one extends tsave command to write start and stop time into a tracefile. Thank you, Dmitry --------------040802020906070201020001 Content-Type: text/x-patch; name="gdb_1_of_2_tstatus.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="gdb_1_of_2_tstatus.diff" Content-length: 3720 commit 1182d791b8f8fcfd1098b1c9c1375c68fe86ffaf Author: Dmitry Kozlov Date: Fri Jun 7 18:22:29 2013 +0400 Fix trace-status to output proper start-time and stop-time. diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 493da1d..561d93b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2013-06-10 Dmitry Kozlov + + Fix trace-status to output proper start-time and stop-time. + * tracepoint.c (trace_status_command): Fix type of printf arg to + prevent improper type conversion. + (trace_status_mi): Likewise. + 2013-06-08 Pedro Alves Yao Qi diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 604a414..772bdb8 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,9 @@ +2013-06-10 Dmitry Kozlov + + Fix trace-status to output proper start-time and stop-time. + * gdbserver/tracepoint.c (cmd_qtstatus): Modify trace-status output to + output start time and stop time in hex as gdb expects. + 2013-06-09 Jan Kratochvil Fix compatibility with Android Bionic. diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c index d237e7f..43f77bf 100644 --- a/gdb/gdbserver/tracepoint.c +++ b/gdb/gdbserver/tracepoint.c @@ -3663,7 +3663,8 @@ cmd_qtstatus (char *packet) free_space (), phex_nz (trace_buffer_hi - trace_buffer_lo, 0), circular_trace_buffer, disconnected_tracing, - plongest (tracing_start_time), plongest (tracing_stop_time), + phex_nz (tracing_start_time, sizeof (tracing_start_time)), + phex_nz (tracing_stop_time, sizeof (tracing_stop_time)), buf1, buf2); } diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 5bad3e8..38362b4 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -2049,20 +2049,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 (); @@ -2180,12 +2180,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); } } --------------040802020906070201020001--