This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH v3 08/15] Write 'stop_desc' of trace status to tfile
The field "stop_desc" of "struct trace_status" is parsed (in
parse_trace_status) when the stop reason is tstop_command or
tracepoint_error. However, the "stop_desc" is only written to tfile
when stop_reason is tracepoint_error. Here is an inconsistency.
This patch fixes this inconsistency, as a result, the "tstatus" output
on tfile target is the same as its output on live target.
gdb:
2013-03-08 Yao Qi <yao@codesourcery.com>
* tracepoint.c (tfile_write_status): Write 'stop_desc' of trace
status to tfile if trace is stopped by command 'tstop'.
---
gdb/tracepoint.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 2525b1b..850adb9 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -3058,7 +3058,8 @@ tfile_write_status (struct trace_file_writer *self,
fprintf (writer->fp, "status %c;%s",
(ts->running ? '1' : '0'), stop_reason_names[ts->stop_reason]);
- if (ts->stop_reason == tracepoint_error)
+ if (ts->stop_reason == tracepoint_error
+ || ts->stop_reason == tstop_command)
{
char *buf = (char *) alloca (strlen (ts->stop_desc) * 2 + 1);
--
1.7.7.6