Fix trace-status to output proper start-time and stop-time.
authorDmitry Kozlov <ddk@sourceware.org>
Wed, 26 Jun 2013 15:14:39 +0000 (15:14 +0000)
committerDmitry Kozlov <ddk@sourceware.org>
Wed, 26 Jun 2013 15:14:39 +0000 (15:14 +0000)
gdb/ChangeLog
gdb/gdbserver/ChangeLog
gdb/gdbserver/tracepoint.c
gdb/tracepoint.c

index e2ffd23..f7b3d55 100644 (file)
@@ -1,3 +1,10 @@
+2013-06-26  Dmitry Kozlov <ddk@codesourcery.com>
+
+       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-26  Maciej W. Rozycki  <macro@codesourcery.com>
 
        * mips-tdep.c (mips_next_pc): Fix a typo.
index ec79b1a..a976ee0 100644 (file)
@@ -1,3 +1,9 @@
+2013-06-10  Dmitry Kozlov <ddk@codesourcery.com>
+
+       Fix trace-status to output proper start-time and stop-time.
+       * tracepoint.c (cmd_qtstatus): Modify trace-status output to
+       output start time and stop time in hex as gdb expects.
+
 2013-06-26  Pedro Alves  <pedro@codesourcery.com>
 
        * tracepoint.c (build_traceframe_info_xml): Output trace state
index 6492b5a..1a6ea3c 100644 (file)
@@ -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);
 }
 
index 4277843..67735bc 100644 (file)
@@ -2125,20 +2125,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 ();
@@ -2256,12 +2256,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);
   }
 }