diff options
author | Yao Qi <yao@codesourcery.com> | 2012-07-01 10:37:04 +0000 |
---|---|---|
committer | Yao Qi <yao@codesourcery.com> | 2012-07-01 10:37:04 +0000 |
commit | 72d0e2c5df24fe2caa780e8a796e62d320842487 (patch) | |
tree | 45aed5950329e9da59a6ca90fa196401cdb4a25b /gdb/infrun.c | |
parent | bc823199d1bfb3dd8763f2f33b0583895509cec4 (diff) | |
download | binutils-72d0e2c5df24fe2caa780e8a796e62d320842487.zip binutils-72d0e2c5df24fe2caa780e8a796e62d320842487.tar.gz binutils-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/infrun.c')
-rw-r--r-- | gdb/infrun.c | 34 |
1 files changed, 9 insertions, 25 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c index 2f66ddc..11f981f 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -1185,19 +1185,6 @@ infrun_inferior_exit (struct inferior *inf) remove_displaced_stepping_state (inf->pid); } -/* Enum strings for "set|show displaced-stepping". */ - -static const char can_use_displaced_stepping_auto[] = "auto"; -static const char can_use_displaced_stepping_on[] = "on"; -static const char can_use_displaced_stepping_off[] = "off"; -static const char *const can_use_displaced_stepping_enum[] = -{ - can_use_displaced_stepping_auto, - can_use_displaced_stepping_on, - can_use_displaced_stepping_off, - NULL, -}; - /* If ON, and the architecture supports it, GDB will use displaced stepping to step over breakpoints. If OFF, or if the architecture doesn't support it, GDB will instead use the traditional @@ -1206,15 +1193,14 @@ static const char *const can_use_displaced_stepping_enum[] = which of all-stop or non-stop mode is active --- displaced stepping in non-stop mode; hold-and-step in all-stop mode. */ -static const char *can_use_displaced_stepping = - can_use_displaced_stepping_auto; +static enum auto_boolean can_use_displaced_stepping = AUTO_BOOLEAN_AUTO; static void show_can_use_displaced_stepping (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) { - if (can_use_displaced_stepping == can_use_displaced_stepping_auto) + if (can_use_displaced_stepping == AUTO_BOOLEAN_AUTO) fprintf_filtered (file, _("Debugger's willingness to use displaced stepping " "to step over breakpoints is %s (currently %s).\n"), @@ -1231,9 +1217,8 @@ show_can_use_displaced_stepping (struct ui_file *file, int from_tty, static int use_displaced_stepping (struct gdbarch *gdbarch) { - return (((can_use_displaced_stepping == can_use_displaced_stepping_auto - && non_stop) - || can_use_displaced_stepping == can_use_displaced_stepping_on) + return (((can_use_displaced_stepping == AUTO_BOOLEAN_AUTO && non_stop) + || can_use_displaced_stepping == AUTO_BOOLEAN_TRUE) && gdbarch_displaced_step_copy_insn_p (gdbarch) && !RECORD_IS_USED); } @@ -7296,9 +7281,8 @@ function is skipped and the step command stops at a different source line."), show_step_stop_if_no_debug, &setlist, &showlist); - add_setshow_enum_cmd ("displaced-stepping", class_run, - can_use_displaced_stepping_enum, - &can_use_displaced_stepping, _("\ + add_setshow_auto_boolean_cmd ("displaced-stepping", class_run, + &can_use_displaced_stepping, _("\ Set debugger's willingness to use displaced stepping."), _("\ Show debugger's willingness to use displaced stepping."), _("\ If on, gdb will use displaced stepping to step over breakpoints if it is\n\ @@ -7307,9 +7291,9 @@ stepping to step over breakpoints, even if such is supported by the target\n\ architecture. If auto (which is the default), gdb will use displaced stepping\n\ if the target architecture supports it and non-stop mode is active, but will not\n\ use it in all-stop mode (see help set non-stop)."), - NULL, - show_can_use_displaced_stepping, - &setlist, &showlist); + NULL, + show_can_use_displaced_stepping, + &setlist, &showlist); add_setshow_enum_cmd ("exec-direction", class_run, exec_direction_names, &exec_direction, _("Set direction of execution.\n\ |