From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17298 invoked by alias); 9 Dec 2012 12:49:41 -0000 Received: (qmail 17284 invoked by uid 22791); 9 Dec 2012 12:49:39 -0000 X-SWARE-Spam-Status: No, hits=-4.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,TW_BM 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; Sun, 09 Dec 2012 12:49:33 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1ThgK4-0002o8-EM from Yao_Qi@mentor.com ; Sun, 09 Dec 2012 04:49:32 -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); Sun, 9 Dec 2012 04:49:32 -0800 Received: from qiyao.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; Sun, 9 Dec 2012 04:49:28 -0800 Message-ID: <50C488D0.8010609@codesourcery.com> Date: Sun, 09 Dec 2012 12:49:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120911 Thunderbird/15.0.1 MIME-Version: 1.0 To: Pedro Alves CC: Subject: Re: [PATCH 1/6] Add a field 'installed' for each location of tracepoint. References: <1354596282-32526-1-git-send-email-yao@codesourcery.com> <1354596282-32526-2-git-send-email-yao@codesourcery.com> <50C10675.3000405@redhat.com> In-Reply-To: <50C10675.3000405@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit 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: 2012-12/txt/msg00219.txt.bz2 On 12/07/2012 04:56 AM, Pedro Alves wrote: > This should be documented in the manual and NEWS, both the CLI changes, and > the MI change (this patch adds the "installed" field to various MI things). > The new version includes changes to manual and NEWS. >> >Of course, the breakpoint related MI notifications are changed as >> >well. >> > >> >gdb: >> > >> >2012-12-03 Yao Qi >> > >> > * breakpoint.c (print_one_breakpoint_location): Add field >> > 'installed' for each location of a tracepoint. >> >--- >> > gdb/breakpoint.c | 11 +++++++++++ >> > 1 files changed, 11 insertions(+), 0 deletions(-) >> > >> >diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c >> >index 53944a6..40d2edd 100644 >> >--- a/gdb/breakpoint.c >> >+++ b/gdb/breakpoint.c >> >@@ -6123,6 +6123,17 @@ print_one_breakpoint_location (struct breakpoint *b, >> > ui_out_field_int (uiout, "pass", t->pass_count); >> > ui_out_text (uiout, " \n"); >> > } >> >+ >> >+ if (!header_of_multiple) >> >+ { >> >+ annotate_field (11); >> >+ ui_out_text (uiout, "\tinstalled "); >> >+ /* LOC is NULL means the tracepoint is still pending, set >> >+ field 'installed' 'n'. */ >> >+ ui_out_field_string (uiout, "installed", >> >+ loc ? (loc->inserted ? "y" : "n") : "n"); >> >+ ui_out_text (uiout, " \n"); > Not sure about the pending case. Can you show how does that look like? > Why not just display nothing in that case? How does the MI output look > like in the pending case? > In the new version, we don't display it for neither pending tracepoint nor pending locations. In CLI, the output of 'info tracepoint' will be like this, info trace Num Type Disp Enb Address What^M 2 tracepoint keep y 0x080485b1 in main at gdb.trace/change-loc.c:29 installed on target 4 tracepoint keep y collect $eip 4.1 y 0x0804859c in func4 at gdb.trace/change-loc.h:35 installed on target 4.2 y 0xb7ffc480 in func4 at gdb.trace/change-loc.h:35 installed on target 4.3 y set_tracepoint I'll post patch 6/6 once the output here is OK to us. -- Yao (齐尧) gdb: 2012-12-09 Yao Qi * breakpoint.c (print_one_breakpoint_location): Display the state of 'installed' of each non-pending location of a tracepoint in both CLI and MI. * NEWS: Mention the change for CLI and MI. gdb/doc: 2012-12-09 Yao Qi * gdb.texinfo (Listing Tracepoints): Move the example into the item about 'passcount'. New item and example about 'installed on target' output. (GDB/MI Breakpoint Commands): Doc about 'installed field. --- gdb/NEWS | 6 ++++++ gdb/breakpoint.c | 19 +++++++++++++++++++ gdb/doc/gdb.texinfo | 29 +++++++++++++++++++++++------ 3 files changed, 48 insertions(+), 6 deletions(-) diff --git a/gdb/NEWS b/gdb/NEWS index 3b09e5f..dd8b1f4 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -38,6 +38,9 @@ * The command 'forward-search' can now be abbreviated as 'fo'. +* The command 'info tracepoints' can now display 'installed on target' + or 'not installed on target' for each non-pending location of tracepoint. + * New configure options --enable-libmcheck/--disable-libmcheck @@ -99,6 +102,9 @@ show print type typedefs has been requested. ** New optional parameter COUNT added to the "-data-write-memory-bytes" command, to allow pattern filling of memory areas. + ** The response to breakpoint commands and breakpoint async records will + include an "installed" field containing a boolean state about each + non-pending tracepoint location is whether installed on target or not. * GDB now supports the "mini debuginfo" section, .gnu_debugdata. You must have the LZMA library available when configuring GDB for this diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 94874ec..5d5033f 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -6123,6 +6123,25 @@ print_one_breakpoint_location (struct breakpoint *b, ui_out_field_int (uiout, "pass", t->pass_count); ui_out_text (uiout, " \n"); } + + /* Don't display it when tracepoint or tracepoint location is + pending. */ + if (!header_of_multiple && loc != NULL && !loc->shlib_disabled) + { + annotate_field (11); + + if (ui_out_is_mi_like_p (uiout)) + ui_out_field_string (uiout, "installed", + loc->inserted ? "y" : "n"); + else + { + if (loc->inserted) + ui_out_text (uiout, "\t"); + else + ui_out_text (uiout, "\tnot "); + ui_out_text (uiout, "installed on target\n"); + } + } } if (ui_out_is_mi_like_p (uiout) && !part_of_multiple) diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 9ffdb77..cd2f76a 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -11476,8 +11476,6 @@ tracing: @itemize @bullet @item its passcount as given by the @code{passcount @var{n}} command -@end itemize - @smallexample (@value{GDBP}) @b{info trace} Num Type Disp Enb Address What @@ -11491,6 +11489,23 @@ Num Type Disp Enb Address What (@value{GDBP}) @end smallexample +@item +the state about installed on target of each location +@smallexample +(@value{GDBP}) @b{info trace} +Num Type Disp Enb Address What +4 tracepoint keep y + collect $eip +4.1 y 0x0804859c in func4 at change-loc.h:35 + installed on target +4.2 y 0xb7ffc480 in func4 at change-loc.h:35 + installed on target +4.3 y set_tracepoint +5 tracepoint keep y 0x080485b1 in foo at change-loc.c:29 + not installed on target +@end smallexample +@end itemize + @noindent This command can be abbreviated @code{info tp}. @end table @@ -28441,17 +28456,19 @@ The result is in the form: ^done,bkpt=@{number="@var{number}",type="@var{type}",disp="del"|"keep", enabled="y"|"n",addr="@var{hex}",func="@var{funcname}",file="@var{filename}", fullname="@var{full_filename}",line="@var{lineno}",[thread="@var{threadno},] -times="@var{times}"@} +times="@var{times}"[,installed="@var{installed}"]@} @end smallexample @noindent where @var{number} is the @value{GDBN} number for this breakpoint, @var{funcname} is the name of the function where the breakpoint was inserted, @var{filename} is the name of the source file which contains -this function, @var{lineno} is the source line number within that file -and @var{times} the number of times that the breakpoint has been hit +this function, @var{lineno} is the source line number within that file, +@var{times} the number of times that the breakpoint has been hit (always 0 for -break-insert but may be greater for -break-info or -break-list -which use the same output). +which use the same output), and @var{installed}, which is an optional +boolean, is about the state of each non-pending tracepoint location +installed on target or not. Note: this format is open to change. @c An out-of-band breakpoint instead of part of the result? -- 1.7.7.6