[PATCH] Add autoload-breakpoints [7/7] autoload-breakpoints doc

Hui Zhu hui_zhu@mentor.com
Mon Mar 26 02:16:00 GMT 2012


Hi Eli,

Thanks for your review.

On 03/24/12 21:57, Eli Zaretskii wrote:
>> Date: Wed, 21 Mar 2012 18:57:26 +0800
>> From: Hui Zhu<hui_zhu@mentor.com>
>> CC:<gdb-patches@sourceware.org>,<stan_shebs@mentor.com>
>>
>> I post a patch that updated according to your comments.  Please help me
>> review it.
>
> Below.
>
>> +Prior to @value{GDBN} connects to remote stub, some breakpoints might
>> +have been already set in target, either by a prior GDB session or
>                                                        ^^^
> @value{GDBN}
>
>> +remote stub.  We call these breakpoints as "auotload-breakpoints".
>                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>    We call these breakpoints @dfn{auotload-breakpoints}.
>
>> +We believe such reliable report is useful to GDB, and generalize it,
>> +called "ReportAsync".
>
>   We call these asynchronous reports about changes in the remote-side
>   breakpoints @dfn{ReportAsync}.
>
>> +The connection between "ReportAsync" and "autoload-breakpoints" is when
>> +inferior/stub add/set/delete breakpoints, sends async report to GDB about
>> +added/set/removed breakpoints.
>
> This sentence adds nothing to what already has been said.  Please
> remove it.
>
>> +how to handle the autoload-breakpints when @value{GDBN} connect to the stub.
>                                ^^^^^^^^^^
> A typo.
>
>> +@cindex Autoload-breakpoints Format
>
> Lower-case "autoload" and "format", please.
>
>> +this packet through reportAsync Packets.
>                         ^^^^^^^^^^^
> "ReportAsync", with a capital R.
>
> OK with these changes.
>
> Thanks.

I post a new version patch according to your comments.

Best,
Hui

2012-03-26  Hui Zhu  <hui_zhu@mentor.com>

	* gdb.texinfo (Setting Breakpoints): Add set breakpoint autoload.
	(Remote Serial Protocol): Add Autoload-breakpoints Format.
-------------- next part --------------
---
 doc/gdb.texinfo |  103 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 103 insertions(+)

--- a/doc/gdb.texinfo
+++ b/doc/gdb.texinfo
@@ -3761,6 +3761,40 @@ 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}.
+
+The other use case we want to support in @value{GDBN} is that inferior
+may add/set/delete breakpoints on its own, and remote stub gets
+@value{GDBN} notified, and @value{GDBN} can take some actions accordingly.
+We believe such reliable report is useful to GDB, and generalize it,
+called "ReportAsync".
+
+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 to user
+how to handle the autoload-breakpoints when @value{GDBN} connect 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 GDB will be removed
+when @value{GDBN} connects to stub.
+@end table
+
 
 @cindex negative breakpoint numbers
 @cindex internal @value{GDBN} breakpoints
@@ -33671,6 +33705,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
@@ -38296,6 +38331,74 @@ 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-breakpints 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} and the stub use this packet to control
+the autoload-breakpoints in the remote.  The stub will translate
+this packet through ReportAsync Packets.
+@end table
+
+Autoload-breakpoints base format describes the operation of
+the autoload-breakpoints in @value{GDBN} and the stub.
+
+@table @samp
+
+@item @var{id}@samp{:}@var{command}@samp{:}@var{addr_string}@samp{:}@var{type}@samp{:}@var{ignore_num}
+@table @samp
+@item @var{id}
+This is the id in hex string format of this command want to control.
+this command wants to control.
+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.  If it 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}@samp{:}@samp{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.
+
+@item @var{id}@samp{:}@samp{C}@samp{:}@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}@samp{:}@samp{O}@samp{:}@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


More information about the Gdb-patches mailing list