diff options
author | Dmitry Kozlov <ddk@sourceware.org> | 2013-06-26 15:14:39 +0000 |
---|---|---|
committer | Dmitry Kozlov <ddk@sourceware.org> | 2013-06-26 15:14:39 +0000 |
commit | f30aa5affef01c27955e33d8e05960c58e9b8a66 (patch) | |
tree | 2d717ad23a3d9d075da462a4eeedc49c3b630911 | |
parent | 1aee363c16e15b48e09ddb17f7aa4d007f80fbe7 (diff) | |
download | gdb-f30aa5affef01c27955e33d8e05960c58e9b8a66.zip gdb-f30aa5affef01c27955e33d8e05960c58e9b8a66.tar.gz gdb-f30aa5affef01c27955e33d8e05960c58e9b8a66.tar.bz2 |
Fix trace-status to output proper start-time and stop-time.
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/gdbserver/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/gdbserver/tracepoint.c | 3 | ||||
-rw-r--r-- | gdb/tracepoint.c | 24 |
4 files changed, 27 insertions, 13 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e2ffd23..f7b3d55 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -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. diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index ec79b1a..a976ee0 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -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 diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c index 6492b5a..1a6ea3c 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 4277843..67735bc 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -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); } } |