* [RFC]: new set breakpoint pending and show breakpoint pending commands
@ 2004-02-11 0:18 Jeff Johnston
2004-02-11 6:19 ` Eli Zaretskii
2004-02-19 22:38 ` Jeff Johnston
0 siblings, 2 replies; 7+ messages in thread
From: Jeff Johnston @ 2004-02-11 0:18 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 1624 bytes --]
The following patch adds a setting to control how gdb creates pending
breakpoints. At Andrew's suggestion, I have made the setting a subsetting of
breakpoint so future breakpoint settings will all be grouped together.
The setting is an auto boolean and has three settings: on, off, and auto. The
default behavior is auto which is the current default behavior of querying
before setting a pending breakpoint. The on setting causes pending breakpoints
to be created automatically without prompting and the off setting causes no
pending breakpoints to be created. The off setting causes an error to occur
which matches the previous behavior Andrew was seeing with regard to scripts.
I have included a doc patch but will wait on posting a change to pending.exp
until everyone is ok with the interface. A change is not required to make
pending.exp work, it would just exercise the new functionality. I have tested
the new settings manually.
Ok?
-- Jeff J.
gdb/ChangeLog:
2004-02-10 Jeff Johnston <jjohnstn@redhat.com>
* breakpoint.c (pending_break_support): New setting variable.
(break_command_1): Account for pending_break_support setting
when creating pending breakpoints.
(set_breakpoint_cmd, show_breakpoint_cmd): New functions.
(_initialize_breakpoint): Add "set breakpoint pending" and
"show breakpoint pending" commands.
doc/ChangeLog:
2004-02-10 Jeff Johnston <jjohnstn@redhat.com>
* gdb.texinfo (breakpoints): Add information about the
new "set breakpoint pending" and "show breakpoint pending"
commands.
[-- Attachment #2: pbreakset.patch --]
[-- Type: text/plain, Size: 3757 bytes --]
Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.158
diff -u -p -r1.158 breakpoint.c
--- breakpoint.c 3 Feb 2004 22:47:40 -0000 1.158
+++ breakpoint.c 10 Feb 2004 23:58:18 -0000
@@ -212,6 +212,12 @@ static void ep_skip_leading_whitespace (
if such is available. */
static int can_use_hw_watchpoints;
+/* If AUTO_BOOLEAN_FALSE, gdb will not attempt to create pending breakpoints.
+ If AUTOBOOLEAN_TRUE, gdb will automatically create pending breakpoints
+ for unrecognized breakpoint locations.
+ If AUTO_BOOLEAN_AUTO, gdb will query when breakpoints are unrecognized. */
+static enum auto_boolean pending_break_support;
+
void _initialize_breakpoint (void);
extern int addressprint; /* Print machine addresses? */
@@ -5103,8 +5109,21 @@ break_command_1 (char *arg, int flag, in
error_output_message (NULL, err_msg);
xfree (err_msg);
- if (!query ("Make breakpoint pending on future shared library load? "))
+
+ /* If pending breakpoint support is turned off, throw error. */
+
+ if (pending_break_support == AUTO_BOOLEAN_FALSE)
+ throw_exception (RETURN_ERROR);
+
+ /* If pending breakpoint support is auto query and the user selects no,
+ then simply return the error code. */
+ if (pending_break_support == AUTO_BOOLEAN_AUTO &&
+ !query ("Make breakpoint pending on future shared library load? "))
return rc;
+
+ /* At this point, either the user was queried about setting a pending breakpoint
+ and selected yes, or pending breakpoint behavior is on and thus a pending
+ breakpoint is defaulted on behalf of the user. */
copy_arg = xstrdup (addr_start);
addr_string = ©_arg;
sals.nelts = 1;
@@ -7696,6 +7715,16 @@ enable_delete_command (char *args, int f
map_breakpoint_numbers (args, enable_delete_breakpoint);
}
\f
+static void
+set_breakpoint_cmd (char *args, int from_tty)
+{
+}
+
+static void
+show_breakpoint_cmd (char *args, int from_tty)
+{
+}
+
/* Use default_breakpoint_'s, or nothing if they aren't valid. */
struct symtabs_and_lines
@@ -7720,6 +7749,8 @@ decode_line_spec_1 (char *string, int fu
void
_initialize_breakpoint (void)
{
+ static struct cmd_list_element *breakpoint_set_cmdlist;
+ static struct cmd_list_element *breakpoint_show_cmdlist;
struct cmd_list_element *c;
breakpoint_chain = 0;
@@ -8038,4 +8069,29 @@ hardware.)",
add_show_from_set (c, &showlist);
can_use_hw_watchpoints = 1;
+
+ add_prefix_cmd ("breakpoint", class_maintenance, set_breakpoint_cmd, "\
+Breakpoint specific settings\n\
+Configure various breakpoint-specific variables such as\n\
+pending breakpoint behavior",
+ &breakpoint_set_cmdlist, "set breakpoint ",
+ 0/*allow-unknown*/, &setlist);
+ add_prefix_cmd ("breakpoint", class_maintenance, show_breakpoint_cmd, "\
+Breakpoint specific settings\n\
+Configure various breakpoint-specific variables such as\n\
+pending breakpoint behavior",
+ &breakpoint_show_cmdlist, "show breakpoint ",
+ 0/*allow-unknown*/, &showlist);
+
+ add_setshow_cmd ("pending", no_class, var_auto_boolean,
+ (char *) &pending_break_support,
+ "Set debugger's behavior regarding pending breakpoints.\n\
+If on, an unrecognized breakpoint location will cause gdb to create a pending\n\
+breakpoint. If off, an unrecognized breakpoint location results in an error.\n\
+If auto, an unrecognized breakpoint location results in a user-query to see if\n\
+a pending breakpoint should be created.","\
+Show debugger's behavior regarding pending breakpoints.",
+ NULL, NULL, &breakpoint_set_cmdlist, &breakpoint_show_cmdlist);
+
+ pending_break_support = AUTO_BOOLEAN_AUTO;
}
[-- Attachment #3: pbreaksetdoc.patch --]
[-- Type: text/plain, Size: 2573 bytes --]
Index: gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.193
diff -u -r1.193 gdb.texinfo
--- gdb.texinfo 6 Feb 2004 15:48:25 -0000 1.193
+++ gdb.texinfo 11 Feb 2004 00:16:50 -0000
@@ -2639,15 +2639,42 @@
(@pxref{Conditions, ,Break conditions}).
@cindex pending breakpoints
-If a specified breakpoint location cannot be found, @value{GDBN} will
-prompt you
-as to whether to make the breakpoint pending on a future shared
-library load. This is useful for setting breakpoints at the start of your
+If a specified breakpoint location cannot be found, it may due to the fact
+that the location is in a shared library that is yet to be loaded. In such
+a case, you may want @value{GDBN} to create a special breakpoint (known as
+a pending breakpoint) that
+attempts to resolve itself in the future when an appropriate shared library
+gets loaded.
+
+Pending breakpoints are useful to set at the start of your
@value{GDBN} session for locations that you know will be dynamically loaded
later by the program being debugged. When shared libraries are loaded,
-a check is made to see if the load resoloves any pending breakpoint locations.
-If a pending breakpoint location has been resolved,
-a real breakpoint is created and the original pending breakpoint is removed.
+a check is made to see if the load resolves any pending breakpoint locations.
+If a pending breakpoint location gets resolved,
+a regular breakpoint is created and the original pending breakpoint is removed.
+
+@value{GDBN} provides some additional commands for controlling pending
+breakpoint support:
+
+@kindex set breakpoint pending
+@kindex show breakpoint pending
+@table @code
+@item set breakpoint pending auto
+This is the default behavior. When a breakpoint location is unrecognized,
+you are queried to see if a pending breakpoint should be created.
+
+@item set breakpoint pending on
+This indicates that an unrecognized breakpoint location should automatically
+result in a pending breakpoint being created.
+
+@item set breakpoint pending off
+This indicates that pending breakpoints are not to be created. Any
+unrecognized breakpoint location results in an error. This setting does
+not affect any pending breakpoints previously created.
+
+@item show breakpoint pending
+Show the current behavior setting for creating pending breakpoints.
+@end table
@cindex operations allowed on pending breakpoints
Normal breakpoint operations apply to pending breakpoints as well. You may
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [RFC]: new set breakpoint pending and show breakpoint pending commands
2004-02-11 0:18 [RFC]: new set breakpoint pending and show breakpoint pending commands Jeff Johnston
@ 2004-02-11 6:19 ` Eli Zaretskii
2004-02-11 22:10 ` Jeff Johnston
2004-02-19 22:38 ` Jeff Johnston
1 sibling, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2004-02-11 6:19 UTC (permalink / raw)
To: Jeff Johnston; +Cc: gdb-patches
> Date: Tue, 10 Feb 2004 19:18:41 -0500
> From: Jeff Johnston <jjohnstn@redhat.com>
>
> I have included a doc patch but will wait on posting a change to pending.exp
> until everyone is ok with the interface. A change is not required to make
> pending.exp work, it would just exercise the new functionality. I have tested
> the new settings manually.
>
> Ok?
Thanks. A few minor comments about the documentation patch:
> +If a specified breakpoint location cannot be found, it may due to the fact
^^^
I think there's a "be" missing at the spot I marked.
> +that the location is in a shared library that is yet to be loaded. In such
> +a case, you may want @value{GDBN} to create a special breakpoint (known as
> +a pending breakpoint) that
Please put "pending breakpoint", just this once, in @dfn{}, so that it
stands out. (This is generally a good practice when introducing new
terminology.)
> When a breakpoint location is unrecognized,
> +you are queried to see if a pending breakpoint should be created.
I'd rephrase this slightly:
When @value{GDBN} cannot find the breakpoint location, it queries
you whether a pending breakpoint should be created.
Otherwise, it can go in when the code patch is approved.
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [RFC]: new set breakpoint pending and show breakpoint pending commands
2004-02-11 6:19 ` Eli Zaretskii
@ 2004-02-11 22:10 ` Jeff Johnston
0 siblings, 0 replies; 7+ messages in thread
From: Jeff Johnston @ 2004-02-11 22:10 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
Eli Zaretskii wrote:
>>Date: Tue, 10 Feb 2004 19:18:41 -0500
>>From: Jeff Johnston <jjohnstn@redhat.com>
>>
>>I have included a doc patch but will wait on posting a change to pending.exp
>>until everyone is ok with the interface. A change is not required to make
>>pending.exp work, it would just exercise the new functionality. I have tested
>>the new settings manually.
>>
>>Ok?
>
>
> Thanks. A few minor comments about the documentation patch:
>
>
>>+If a specified breakpoint location cannot be found, it may due to the fact
>
> ^^^
> I think there's a "be" missing at the spot I marked.
>
Arrr, there be.
>
>>+that the location is in a shared library that is yet to be loaded. In such
>>+a case, you may want @value{GDBN} to create a special breakpoint (known as
>>+a pending breakpoint) that
>
>
> Please put "pending breakpoint", just this once, in @dfn{}, so that it
> stands out. (This is generally a good practice when introducing new
> terminology.)
>
Done.
>
>> When a breakpoint location is unrecognized,
>>+you are queried to see if a pending breakpoint should be created.
>
>
> I'd rephrase this slightly:
>
> When @value{GDBN} cannot find the breakpoint location, it queries
> you whether a pending breakpoint should be created.
>
Done.
> Otherwise, it can go in when the code patch is approved.
>
>
Thanks.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC]: new set breakpoint pending and show breakpoint pending commands
2004-02-11 0:18 [RFC]: new set breakpoint pending and show breakpoint pending commands Jeff Johnston
2004-02-11 6:19 ` Eli Zaretskii
@ 2004-02-19 22:38 ` Jeff Johnston
2004-02-26 20:06 ` Jeff Johnston
1 sibling, 1 reply; 7+ messages in thread
From: Jeff Johnston @ 2004-02-19 22:38 UTC (permalink / raw)
To: Jeff Johnston; +Cc: gdb-patches
Ping...[excluding Eli who graciously reviewed the doc change]
Jeff Johnston wrote:
> The following patch adds a setting to control how gdb creates pending
> breakpoints. At Andrew's suggestion, I have made the setting a
> subsetting of breakpoint so future breakpoint settings will all be
> grouped together.
>
> The setting is an auto boolean and has three settings: on, off, and
> auto. The default behavior is auto which is the current default
> behavior of querying before setting a pending breakpoint. The on
> setting causes pending breakpoints to be created automatically without
> prompting and the off setting causes no pending breakpoints to be
> created. The off setting causes an error to occur which matches the
> previous behavior Andrew was seeing with regard to scripts.
>
> I have included a doc patch but will wait on posting a change to
> pending.exp until everyone is ok with the interface. A change is not
> required to make pending.exp work, it would just exercise the new
> functionality. I have tested the new settings manually.
>
> Ok?
>
> -- Jeff J.
>
> gdb/ChangeLog:
>
> 2004-02-10 Jeff Johnston <jjohnstn@redhat.com>
>
> * breakpoint.c (pending_break_support): New setting variable.
> (break_command_1): Account for pending_break_support setting
> when creating pending breakpoints.
> (set_breakpoint_cmd, show_breakpoint_cmd): New functions.
> (_initialize_breakpoint): Add "set breakpoint pending" and
> "show breakpoint pending" commands.
>
> doc/ChangeLog:
>
> 2004-02-10 Jeff Johnston <jjohnstn@redhat.com>
>
> * gdb.texinfo (breakpoints): Add information about the
> new "set breakpoint pending" and "show breakpoint pending"
> commands.
>
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC]: new set breakpoint pending and show breakpoint pending commands
2004-02-19 22:38 ` Jeff Johnston
@ 2004-02-26 20:06 ` Jeff Johnston
2004-02-26 20:24 ` Andrew Cagney
0 siblings, 1 reply; 7+ messages in thread
From: Jeff Johnston @ 2004-02-26 20:06 UTC (permalink / raw)
To: Jeff Johnston; +Cc: gdb-patches
Double Ping ...
Jeff Johnston wrote:
> Ping...[excluding Eli who graciously reviewed the doc change]
>
> Jeff Johnston wrote:
>
>> The following patch adds a setting to control how gdb creates pending
>> breakpoints. At Andrew's suggestion, I have made the setting a
>> subsetting of breakpoint so future breakpoint settings will all be
>> grouped together.
>>
>> The setting is an auto boolean and has three settings: on, off, and
>> auto. The default behavior is auto which is the current default
>> behavior of querying before setting a pending breakpoint. The on
>> setting causes pending breakpoints to be created automatically without
>> prompting and the off setting causes no pending breakpoints to be
>> created. The off setting causes an error to occur which matches the
>> previous behavior Andrew was seeing with regard to scripts.
>>
>> I have included a doc patch but will wait on posting a change to
>> pending.exp until everyone is ok with the interface. A change is not
>> required to make pending.exp work, it would just exercise the new
>> functionality. I have tested the new settings manually.
>>
>> Ok?
>>
>> -- Jeff J.
>>
>> gdb/ChangeLog:
>>
>> 2004-02-10 Jeff Johnston <jjohnstn@redhat.com>
>>
>> * breakpoint.c (pending_break_support): New setting variable.
>> (break_command_1): Account for pending_break_support setting
>> when creating pending breakpoints.
>> (set_breakpoint_cmd, show_breakpoint_cmd): New functions.
>> (_initialize_breakpoint): Add "set breakpoint pending" and
>> "show breakpoint pending" commands.
>>
>> doc/ChangeLog:
>>
>> 2004-02-10 Jeff Johnston <jjohnstn@redhat.com>
>>
>> * gdb.texinfo (breakpoints): Add information about the
>> new "set breakpoint pending" and "show breakpoint pending"
>> commands.
>>
>>
>>
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC]: new set breakpoint pending and show breakpoint pending commands
2004-02-26 20:06 ` Jeff Johnston
@ 2004-02-26 20:24 ` Andrew Cagney
2004-02-26 23:47 ` Jeff Johnston
0 siblings, 1 reply; 7+ messages in thread
From: Andrew Cagney @ 2004-02-26 20:24 UTC (permalink / raw)
To: Jeff Johnston; +Cc: gdb-patches
> Double Ping ...
Thought I'd covered it, sorry. Yes, ok (and finally some more sanity in
GDB's cli structure!)
Can you create a breakpoint bug report to move all the other breakpoint
options into "set/show breakpoint".
Andrew
> Jeff Johnston wrote:
>
>> Ping...[excluding Eli who graciously reviewed the doc change]
>>
>> Jeff Johnston wrote:
>>
>>> The following patch adds a setting to control how gdb creates pending breakpoints. At Andrew's suggestion, I have made the setting a subsetting of breakpoint so future breakpoint settings will all be grouped together.
>>>
>>> The setting is an auto boolean and has three settings: on, off, and auto. The default behavior is auto which is the current default behavior of querying before setting a pending breakpoint. The on setting causes pending breakpoints to be created automatically without prompting and the off setting causes no pending breakpoints to be created. The off setting causes an error to occur which matches the previous behavior Andrew was seeing with regard to scripts.
>>>
>>> I have included a doc patch but will wait on posting a change to pending.exp until everyone is ok with the interface. A change is not required to make pending.exp work, it would just exercise the new functionality. I have tested the new settings manually.
>>>
>>> Ok?
>>>
>>> -- Jeff J.
>>>
>>> gdb/ChangeLog:
>>>
>>> 2004-02-10 Jeff Johnston <jjohnstn@redhat.com>
>>>
>>> * breakpoint.c (pending_break_support): New setting variable.
>>> (break_command_1): Account for pending_break_support setting
>>> when creating pending breakpoints.
>>> (set_breakpoint_cmd, show_breakpoint_cmd): New functions.
>>> (_initialize_breakpoint): Add "set breakpoint pending" and
>>> "show breakpoint pending" commands.
>>>
>>> doc/ChangeLog:
>>>
>>> 2004-02-10 Jeff Johnston <jjohnstn@redhat.com>
>>>
>>> * gdb.texinfo (breakpoints): Add information about the
>>> new "set breakpoint pending" and "show breakpoint pending"
>>> commands.
>>>
>>>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC]: new set breakpoint pending and show breakpoint pending commands
2004-02-26 20:24 ` Andrew Cagney
@ 2004-02-26 23:47 ` Jeff Johnston
0 siblings, 0 replies; 7+ messages in thread
From: Jeff Johnston @ 2004-02-26 23:47 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
Andrew Cagney wrote:
>> Double Ping ...
>
>
> Thought I'd covered it, sorry. Yes, ok (and finally some more sanity in
> GDB's cli structure!)
>
> Can you create a breakpoint bug report to move all the other breakpoint
> options into "set/show breakpoint".
>
> Andrew
>
Done. See gdb/1575. Patch checked in. Thanks.
-- Jeff J.
>> Jeff Johnston wrote:
>>
>>> Ping...[excluding Eli who graciously reviewed the doc change]
>>>
>>> Jeff Johnston wrote:
>>>
>>>> The following patch adds a setting to control how gdb creates
>>>> pending breakpoints. At Andrew's suggestion, I have made the
>>>> setting a subsetting of breakpoint so future breakpoint settings
>>>> will all be grouped together.
>>>>
>>>> The setting is an auto boolean and has three settings: on, off, and
>>>> auto. The default behavior is auto which is the current default
>>>> behavior of querying before setting a pending breakpoint. The on
>>>> setting causes pending breakpoints to be created automatically
>>>> without prompting and the off setting causes no pending breakpoints
>>>> to be created. The off setting causes an error to occur which
>>>> matches the previous behavior Andrew was seeing with regard to scripts.
>>>>
>>>> I have included a doc patch but will wait on posting a change to
>>>> pending.exp until everyone is ok with the interface. A change is
>>>> not required to make pending.exp work, it would just exercise the
>>>> new functionality. I have tested the new settings manually.
>>>>
>>>> Ok?
>>>>
>>>> -- Jeff J.
>>>>
>>>> gdb/ChangeLog:
>>>>
>>>> 2004-02-10 Jeff Johnston <jjohnstn@redhat.com>
>>>>
>>>> * breakpoint.c (pending_break_support): New setting variable.
>>>> (break_command_1): Account for pending_break_support setting
>>>> when creating pending breakpoints.
>>>> (set_breakpoint_cmd, show_breakpoint_cmd): New functions.
>>>> (_initialize_breakpoint): Add "set breakpoint pending" and
>>>> "show breakpoint pending" commands.
>>>>
>>>> doc/ChangeLog:
>>>>
>>>> 2004-02-10 Jeff Johnston <jjohnstn@redhat.com>
>>>>
>>>> * gdb.texinfo (breakpoints): Add information about the
>>>> new "set breakpoint pending" and "show breakpoint pending"
>>>> commands.
>>>>
>>>>
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2004-02-26 23:47 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-11 0:18 [RFC]: new set breakpoint pending and show breakpoint pending commands Jeff Johnston
2004-02-11 6:19 ` Eli Zaretskii
2004-02-11 22:10 ` Jeff Johnston
2004-02-19 22:38 ` Jeff Johnston
2004-02-26 20:06 ` Jeff Johnston
2004-02-26 20:24 ` Andrew Cagney
2004-02-26 23:47 ` Jeff Johnston
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox