From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19584 invoked by alias); 11 Oct 2012 15:51:01 -0000 Received: (qmail 19574 invoked by uid 22791); 11 Oct 2012 15:50:59 -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; Thu, 11 Oct 2012 15:50:53 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1TML2C-0002Dy-CQ from Dmitry_Kozlov@mentor.com for gdb-patches@sourceware.org; Thu, 11 Oct 2012 08:50:52 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 11 Oct 2012 08:50:51 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.1.289.1; Thu, 11 Oct 2012 16:50:50 +0100 Message-ID: <5076EAD7.6010008@mentor.com> Date: Thu, 11 Oct 2012 15:51:00 -0000 From: Dmitry Kozlov User-Agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120912 Thunderbird/15.0.1 MIME-Version: 1.0 To: Yao Qi CC: , "'Stan_Shebs@mentor.com'" , Vladimir Prus Subject: Re: [PATCH] Modify trace-status output to always output stop-notes. References: <50755958.5090107@mentor.com> <50760E87.40902@codesourcery.com> In-Reply-To: <50760E87.40902@codesourcery.com> Content-Type: multipart/mixed; boundary="------------010302010801000608010307" 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: 2012-10/txt/msg00176.txt.bz2 --------------010302010801000608010307 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Content-length: 473 Hi Yao, thank you for review, here is revised patch. Dmitry On 10/11/2012 04:10 AM, Yao Qi wrote: > On 10/10/2012 07:17 PM, Dmitry Kozlov wrote: >> + 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); >> + } > > Besides Stan's comments, the indentation here looks strange to me, and > BUF is not xfree'ed. > --------------010302010801000608010307 Content-Type: text/x-patch; name="gdb-stop-notes_v2.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="gdb-stop-notes_v2.diff" Content-length: 3417 commit d9cc6813eccfc2afa35be6b201a222a44c657b55 Author: Dmitry Kozlov Date: Wed Oct 10 14:56:52 2012 +0400 Modify trace-status output to always output stop-notes. diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9196bc2..f34f04e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,8 +1,19 @@ +2012-10-10 Dmitry Kozlov + + * 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 * tracepoint.c (trace_save): Add saving starttime, stoptime, user and notes. -2012-10-04 Dmitry Kozlov +2012-10-04 Dmitry Kozlov + + * tracepoint.c (trace_save): Add saving starttime, stoptime, user and notes. + +2012-10-04 Dmitry Kozlov * tracepoint.c (trace_status_command): Fix type of printf arg. (trace_status_mi): Likewise. diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 8bfbe9c..a23bb6d 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,8 @@ +2012-10-11 Dmitry Kozlov + + * gdbserver/tracepoint.c (cmd_qtstatus): Modify trace-status output to + always output stop-notes. + 2012-10-01 Andrew Burgess * server.c (handle_search_memory_1): Include access length in 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 959ede5..507ca41 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -2164,6 +2164,8 @@ trace_status_mi (int on_stop) ui_out_field_string (uiout, "user-name", ts->user_name); ui_out_field_string (uiout, "notes", ts->notes); + // Always output stop-notes to MI to unify IDE processing of start and stop notes + ui_out_field_string (uiout, "stop-notes", ts->stop_desc); { char buf[100]; @@ -3065,6 +3067,14 @@ trace_save (const char *filename, int target_does_save) fprintf (fp, ";username:%s", buf); xfree (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); + xfree (buf); + } fprintf (fp, "\n"); @@ -3994,6 +4004,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. */ --------------010302010801000608010307--