This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Modify trace-status output to always output stop-notes.
- From: Dmitry Kozlov <dmitry_kozlov at mentor dot com>
- To: <gdb-patches at sourceware dot org>, "'Stan_Shebs at mentor dot com'" <Stan_Shebs at mentor dot com>
- Cc: Vladimir Prus <vladimir at codesourcery dot com>, Yao Qi <yao at codesourcery dot com>
- Date: Wed, 10 Oct 2012 15:17:44 +0400
- Subject: [PATCH] Modify trace-status output to always output stop-notes.
Hi,
accoriding to discussion in gdb mailing list I have added stop-notes as
mandatory part of MI trace-status command. This makes processing of
stop-notes on IDE side more uniform with trace-notes processing.
Previously Yao mentioned that he implemented notifications that can be
used to monitor trace-status, but putting stop-notes to trace-status
looks more clear way because processing one extra trace-status parameter
defferently from others.
Stan, is it ok?
Thank you
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 9196bc2..5ee6ceb 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,8 +1,21 @@
+2012-10-10 Dmitry Kozlov <ddk@codesourcery.com>
+
+ * gdbserver/traicepoint.c (cmd_qtstatus): Modify trace-status output to
+ always output stop-notes.
+ * tracepoint.c (trace_status_mi): Modify trace status MI command output to
+ always output stop-notes.
+ (trace_save): Save stop-notes if any by tsave.
+ (parse_trace_status): Add parsing stop-notes.
+
2012-10-04 Dmitry Kozlov <ddk@codesourcery.com>
diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c
index 201a25b..60ba775 100644
--- a/gdb/gdbserver/tracepoint.c
+++ b/gdb/gdbserver/tracepoint.c
@@ -3657,7 +3657,7 @@ cmd_qtstatus (char *packet)
"circular:%d;"
"disconn:%d;"
"starttime:%s;stoptime:%s;"
- "username:%s:;notes:%s:",
+ "username:%s;notes:%s;stop-notes:%s",
tracing ? 1 : 0,
stop_reason_rsp, tracing_stop_tpnum,
traceframe_count, traceframes_created,
@@ -3665,7 +3665,7 @@ cmd_qtstatus (char *packet)
circular_trace_buffer,
disconnected_tracing,
plongest (tracing_start_time), plongest (tracing_stop_time),
- buf1, buf2);
+ buf1, buf2, buf3);
}
static void
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 0e44316..5ca6404 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -2164,6 +2164,7 @@ trace_status_mi (int on_stop)
ui_out_field_string (uiout, "user-name", ts->user_name);
ui_out_field_string (uiout, "notes", ts->notes);
+ ui_out_field_string (uiout, "stop-notes", ts->stop_desc);
{
char buf[100];
@@ -3062,6 +3063,13 @@ trace_save (const char *filename, int target_does_save)
bin2hex ((gdb_byte *) ts->user_name, buf, 0);
fprintf (fp, ";username:%s", buf);
}
+ if (ts->stop_desc)
+ {
+ char *buf = (char *) xmalloc (strlen (ts->stop_desc) * 2 + 1);
+
+ bin2hex ((gdb_byte *) ts->stop_desc, buf, 0);
+ fprintf (fp, ";stop-notes:%s", buf);
+ }
fprintf (fp, "\n");
@@ -3991,6 +3999,14 @@ Status line: '%s'\n"), p, line);
ts->notes[end] = '\0';
p = p3;
}
+ else if (strncmp (p, "stop-notes", p1 - p) == 0)
+ {
+ ++p1;
+ ts->stop_desc= xmalloc (strlen (p) / 2);
+ end = hex2bin (p1, ts->stop_desc, (p3 - p1) / 2);
+ ts->stop_desc[end] = '\0';
+ p = p3;
+ }
else
{
/* Silently skip unknown optional info. */