aboutsummaryrefslogtreecommitdiff
path: root/gdb/breakpoint.c
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2012-07-01 10:37:04 +0000
committerYao Qi <yao@codesourcery.com>2012-07-01 10:37:04 +0000
commit72d0e2c5df24fe2caa780e8a796e62d320842487 (patch)
tree45aed5950329e9da59a6ca90fa196401cdb4a25b /gdb/breakpoint.c
parentbc823199d1bfb3dd8763f2f33b0583895509cec4 (diff)
downloadgdb-72d0e2c5df24fe2caa780e8a796e62d320842487.zip
gdb-72d0e2c5df24fe2caa780e8a796e62d320842487.tar.gz
gdb-72d0e2c5df24fe2caa780e8a796e62d320842487.tar.bz2
gdb:
* breakpoint.c: Removed always_inserted_auto, always_inserted_on, always_inserted_off, and always_inserted_enums. Change always_inserted_mode's type to 'enum auto_boolean'. (show_always_inserted_mode, breakpoint_always_inserted_mode): Update callers. (_initialize_breakpoint): Call add_setshow_auto_boolean_cmd instead of add_setshow_enum_cmd. * infrun.c: Remove can_use_displaced_stepping_auto, can_use_displaced_stepping_on, can_use_displaced_stepping_off, and can_use_displaced_stepping_enum. Change can_use_displaced_stepping's type to 'enum auto_boolean'. (show_can_use_displaced_stepping, use_displaced_stepping): Update callers. (_initialize_infrun): Call add_setshow_auto_boolean_cmd instead of add_setshow_enum_cmd.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r--gdb/breakpoint.c30
1 files changed, 11 insertions, 19 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 896c122..c5d49af 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -387,21 +387,13 @@ show_automatic_hardware_breakpoints (struct ui_file *file, int from_tty,
will remove breakpoints upon stop. If auto, GDB will behave as ON
if in non-stop mode, and as OFF if all-stop mode.*/
-static const char always_inserted_auto[] = "auto";
-static const char always_inserted_on[] = "on";
-static const char always_inserted_off[] = "off";
-static const char *const always_inserted_enums[] = {
- always_inserted_auto,
- always_inserted_off,
- always_inserted_on,
- NULL
-};
-static const char *always_inserted_mode = always_inserted_auto;
+static enum auto_boolean always_inserted_mode = AUTO_BOOLEAN_AUTO;
+
static void
show_always_inserted_mode (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
- if (always_inserted_mode == always_inserted_auto)
+ if (always_inserted_mode == AUTO_BOOLEAN_AUTO)
fprintf_filtered (file,
_("Always inserted breakpoint "
"mode is %s (currently %s).\n"),
@@ -415,8 +407,8 @@ show_always_inserted_mode (struct ui_file *file, int from_tty,
int
breakpoints_always_inserted_mode (void)
{
- return (always_inserted_mode == always_inserted_on
- || (always_inserted_mode == always_inserted_auto && non_stop));
+ return (always_inserted_mode == AUTO_BOOLEAN_TRUE
+ || (always_inserted_mode == AUTO_BOOLEAN_AUTO && non_stop));
}
static const char condition_evaluation_both[] = "host or target";
@@ -16161,8 +16153,8 @@ a warning will be emitted for such breakpoints."),
&breakpoint_set_cmdlist,
&breakpoint_show_cmdlist);
- add_setshow_enum_cmd ("always-inserted", class_support,
- always_inserted_enums, &always_inserted_mode, _("\
+ add_setshow_auto_boolean_cmd ("always-inserted", class_support,
+ &always_inserted_mode, _("\
Set mode for inserting breakpoints."), _("\
Show mode for inserting breakpoints."), _("\
When this mode is off, breakpoints are inserted in inferior when it is\n\
@@ -16173,10 +16165,10 @@ the behaviour depends on the non-stop setting (see help set non-stop).\n\
In this case, if gdb is controlling the inferior in non-stop mode, gdb\n\
behaves as if always-inserted mode is on; if gdb is controlling the\n\
inferior in all-stop mode, gdb behaves as if always-inserted mode is off."),
- NULL,
- &show_always_inserted_mode,
- &breakpoint_set_cmdlist,
- &breakpoint_show_cmdlist);
+ NULL,
+ &show_always_inserted_mode,
+ &breakpoint_set_cmdlist,
+ &breakpoint_show_cmdlist);
add_setshow_enum_cmd ("condition-evaluation", class_breakpoint,
condition_evaluation_enums,