This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH v3 07/15] Write trace notes and username into tfile.


The fields "notes" and "user_name" in "struct trace_status" are used
in the output of "tstatus".  When in tfile target, the "notes" and
"user name" are missing the output of "tstatus", because GDB doesn't
write them into tfile.  With this patch, GDB starts to write them into
tfile, and the corresponding information will be shown when GDB reads
trace status from the tfile target.

gdb:

2013-03-08  Yao Qi  <yao@codesourcery.com>

	* tracepoint.c (tfile_write_status): Write trace notes and user
	name into tfile if they are not NULL.
---
 gdb/tracepoint.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index d224e14..2525b1b 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -3078,6 +3078,20 @@ tfile_write_status (struct trace_file_writer *self,
     fprintf (writer->fp, ";disconn:%x", ts->disconnected_tracing);
   if (ts->circular_buffer)
     fprintf (writer->fp, ";circular:%x", ts->circular_buffer);
+  if (ts->notes != NULL)
+    {
+      char *buf = (char *) alloca (strlen (ts->notes) * 2 + 1);
+
+      bin2hex ((gdb_byte *) ts->notes, buf, 0);
+      fprintf (writer->fp, ";notes:%s", buf);
+    }
+  if (ts->user_name != NULL)
+    {
+      char *buf = (char *) alloca (strlen (ts->user_name) * 2 + 1);
+
+      bin2hex ((gdb_byte *) ts->user_name, buf, 0);
+      fprintf (writer->fp, ";username:%s", buf);
+    }
   fprintf (writer->fp, "\n");
 }
 
-- 
1.7.7.6


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]