From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1427 invoked by alias); 9 Mar 2013 03:49:29 -0000 Received: (qmail 1315 invoked by uid 22791); 9 Mar 2013 03:49:27 -0000 X-SWARE-Spam-Status: No, hits=-4.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 09 Mar 2013 03:49:18 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1UEAmI-0003cm-A6 from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Fri, 08 Mar 2013 19:48:58 -0800 Received: from SVR-ORW-FEM-03.mgc.mentorg.com ([147.34.97.39]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Fri, 8 Mar 2013 19:48:58 -0800 Received: from qiyao.dyndns.dyndns.org (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.1.289.1; Fri, 8 Mar 2013 19:48:57 -0800 From: Yao Qi To: Subject: [PATCH v3 07/15] Write trace notes and username into tfile. Date: Sat, 09 Mar 2013 03:49:00 -0000 Message-ID: <1362800844-27940-8-git-send-email-yao@codesourcery.com> In-Reply-To: <1362800844-27940-1-git-send-email-yao@codesourcery.com> References: <1362800844-27940-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2013-03/txt/msg00407.txt.bz2 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 * 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