From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26603 invoked by alias); 6 May 2012 01:53:03 -0000 Received: (qmail 26585 invoked by uid 22791); 6 May 2012 01:52:59 -0000 X-SWARE-Spam-Status: No, hits=-4.3 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; Sun, 06 May 2012 01:52:46 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1SQqeS-0003W0-QQ from Hui_Zhu@mentor.com ; Sat, 05 May 2012 18:52:44 -0700 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Sat, 5 May 2012 18:52:36 -0700 Received: from [127.0.0.1] (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.1.289.1; Sat, 5 May 2012 18:52:43 -0700 Message-ID: <4FA5D967.1060903@mentor.com> Date: Sun, 06 May 2012 01:53:00 -0000 From: Hui Zhu User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: Eli Zaretskii CC: , , Subject: Re: [PATCH] Autoload-breakpoints without report-async References: <4FA2B434.60706@mentor.com> <83ipgd6vw0.fsf@gnu.org> <4FA32A2E.20801@mentor.com> <83d36k77od.fsf@gnu.org> In-Reply-To: <83d36k77od.fsf@gnu.org> Content-Type: multipart/mixed; boundary="------------050006050200050805090301" 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-05/txt/msg00162.txt.bz2 --------------050006050200050805090301 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Content-length: 2491 On 05/04/12 14:59, Eli Zaretskii wrote: >> Date: Fri, 4 May 2012 09:00:30 +0800 >> From: Hui Zhu >> CC:,, >> >> Oops, I post the wrong version. The attachment is the right version. Please help me review it. >> +@item set breakpoint autoload query >> +If this option is @samp{query} (the default), @value{GDBN} will query to user > ^^^^^^^^^^^^^ > "query the user" > >> +how to handle the autoload-breakpoints when @value{GDBN} connect to the stub. > ^^^^^^^ > "connects" > >> +@item set breakpoint autoload stub >> +If this option is @samp{stub}, the autoload-breakpoints of GDB will be removed > ^^^ > "@value{GDBN}" > >> +@item @samp{QBDP}@var{autoload-breakpoints base format} >> +@value{GDBN} use this packet to control the autoload-breakpoints in the remote. > ^^^ > "uses" > >> +@table @samp >> + >> +@item @var{id}@samp{:}@var{command}@samp{:}@var{addr_string}@samp{:}@var{type}@samp{:}@var{ignore_num} > > The whole table uses @samp as the default typeface, so you don't need > @samp in the @item line. Every piece of text there that doesn't have > an explicit markup will be typeset as @samp automatically. > >> +@item @var{id} >> +This is the id in hex string format of this command want to control. >> +this command wants to control. > > This is the id in hex string format of the breakpoint to which to > apply this command. > >> + @value{GDBN} will create this breakpoint as >> +it have been created in the target. So when the target creates the >> +breakpoint, it needs to insert this breakpoint by itself. > > @value{GDBN} will assume the breakpoint already exists and is > inserted in the remote, so the target needs to insert the breakpoint > when it creates it. > >> +When @value{GDBN} or the target get this packet, it will delete >> +the autoload-breakpoint @var{id}. ^^^^^^^^^^^^^^ > > "they will delete" > > OK with these changes. > > Thanks. Hi Eli, Thanks for your review. This is the new patch that is updated by your commnets. Best, Hui 2012-05-04 Hui Zhu * gdb.texinfo (Setting Breakpoints): Add set breakpoint autoload. (Remote Serial Protocol): Add Autoload-breakpoints Format. --------------050006050200050805090301 Content-Type: text/plain; charset="us-ascii"; name="autoload-breakpoints-doc.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="autoload-breakpoints-doc.txt" Content-length: 4618 --- doc/gdb.texinfo | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) --- a/doc/gdb.texinfo +++ b/doc/gdb.texinfo @@ -3773,6 +3773,34 @@ not support breakpoint condition evaluat to evaluating all these conditions on the host's side. @end table +Prior to @value{GDBN} connects to remote stub, some breakpoints might +have been already set in target, either by a prior @value{GDBN} session or +by the program itself through some special system API. When @value{GDBN} +connects to target, it should handle these existing breakpoints from +remote stub. We call these breakpoints @dfn{auotload-breakpoints}. + +This feature can be controlled via the following commands: + +@kindex set breakpoint autoload +@kindex show breakpoint autoload +@table @code +@item set breakpoint autoload query +If this option is @samp{query} (the default), @value{GDBN} will query the user +how to handle the autoload-breakpoints when @value{GDBN} connects to the stub. + +@item set breakpoint autoload merge +If this option is @samp{merge}, the autoload-breakpoints of both @value{GDBN} +and of the stub will be kept. + +@item set breakpoint autoload gdb +If this option is @samp{gdb}, the autoload-breakpoints of stub will be removed +when @value{GDBN} connects to stub. + +@item set breakpoint autoload stub +If this option is @samp{stub}, the autoload-breakpoints of @value{GDBN} will +be removed when @value{GDBN} connects to stub. +@end table + @cindex negative breakpoint numbers @cindex internal @value{GDBN} breakpoints @@ -34333,6 +34361,7 @@ Show the current setting of the target w * Memory Map Format:: * Thread List Format:: * Traceframe Info Format:: +* Autoload-breakpoints Format:: @end menu @node Overview @@ -38936,6 +38965,77 @@ The formal DTD for the traceframe info f length CDATA #REQUIRED> @end smallexample +@node Autoload-breakpoints Format +@section Autoload-breakpoints Format +@cindex autoload-breakpoints format + +@table @samp +@item qBfP +@itemx qBsP +These packets request data in autoload-breakpoints base format +about autoload-breakpoints from the stub. +@value{GDBN} sends @code{qBfP} to get the first piece +of data, and multiple @code{qTsP} to get additional pieces. + +@item @samp{QBDP}@var{autoload-breakpoints base format} +@value{GDBN} uses this packet to control the autoload-breakpoints in the remote. +@end table + +Autoload-breakpoints base format describes the operation of +the autoload-breakpoints in @value{GDBN} and the stub. + +@table @samp + +@item @var{id}:@var{command}:@var{addr_string}:@var{type}:@var{ignore_num} +@table @samp +@item @var{id} +This is the id in hex string format of the breakpoint to which to +apply this command. +0 means all autoload-breakpoints. +@item @var{command} +This is the command character, either @samp{E} (for ``enable'') or +@samp{D} (for ``disable''). +If the autoload-breakpoint @var{id} does not exist, create one and +enable or disable it. @value{GDBN} will assume the breakpoint already +exists and is inserted in the remote, so the target needs to insert +the breakpoint when it creates it. +If the autoload-breakpoint @var{id} does exist, the following items +will be ignored, and the autoload-breakpoint will be enabled or +disabled as specified by @var{command}. +@item @var{addr_string} +This is the address of an autoload-breakpoint to create, encoded +as a hex string. +@item @var{type} +This is the type of the autoload-breakpoint to create, either +@samp{H} (for ``hardware'') or @samp{S} (for ``software''). +@item @var{ignore_num} +This is the ignore count of the autoload-breakpoint to create, +encoded as a hex string. +@end table + +@item @var{id}:R +This is the remove packet. +@var{id} is the number of the autoload-breakpoint that this command +wants to remove, encoded as a hex string. +0 means all autoload-breakpoints. +When @value{GDBN} or the target get this packet, they will delete +the autoload-breakpoint @var{id}. + +@item @var{id}:C:@var{cmd_str} +This packet adds commands in @var{cmd_list} to the command list +of the autoload-breakpoint whose number is @var{id}. +If @var{cmd_str} is empty, the command list will be emptied. +@var{cmd_str} is encoded as hex string. + +@item @var{id}:O:@var{condition_str} +This packet sets the condition of the autoload-breakpoint @var{id} to +be as specified by @var{condition_str}. +If @var{condition_str} is empty, the autoload-breakpoint becomes +unconditional. +@var{condition_str} is encoded as hex string. + +@end table + @include agentexpr.texi @node Target Descriptions --------------050006050200050805090301--