Fix trace-status to output proper start-time and stop-time.

This commit is contained in:
Dmitry Kozlov 2013-06-26 15:14:39 +00:00
parent 1aee363c16
commit f30aa5affe
4 changed files with 27 additions and 13 deletions

View 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.

View 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

View 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);
}

View 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);
}
}