From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 33165 invoked by alias); 15 Sep 2019 08:34:09 -0000 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 Received: (qmail 33156 invoked by uid 89); 15 Sep 2019 08:34:08 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.9 required=5.0 tests=AWL,BAYES_40,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_STOCKGEN,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=detach, HX-Received:Sun, routine, xxx X-HELO: mail-yb1-f202.google.com Received: from mail-yb1-f202.google.com (HELO mail-yb1-f202.google.com) (209.85.219.202) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 15 Sep 2019 08:33:58 +0000 Received: by mail-yb1-f202.google.com with SMTP id e69so25045282ybc.11 for ; Sun, 15 Sep 2019 01:33:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc :content-transfer-encoding; bh=rSkZJ5S2CjfJGyzrrdxt4n0CrY6L64elniyX56R3Bf8=; b=M57I8alXOie+6zS0wHR1WQJSyHny9p847C1rDJvllIOmFkRHQ6rzkPATHmeWbAe8KW Ln3CUk4Nq+0YchMdiy0KJ5LXa2ggQ76v3BJWezUemTm/tyQkXYmLOT5MpS5NGMJm+WiM scrgx1VZxGK2VZqXF/oYZuIKGMLillh3ABVY4pRCAW9UndAf/x4RiVh3s9qP7VGyPvku iC6CiN94VX9r8MSRt+KxDsdo1f+Sel4SDFMYkDt8JlJ2SGnOjLRhKP0dq5rOBPmJ7vAn QQuLk5lbml7oS8ECJobEl8nePEYLJZdviNYYbXGNVmbPvR4MpsY9MYNLcql/sXFLAmEF O2hg== Date: Sun, 15 Sep 2019 08:34:00 -0000 Message-Id: <20190915083353.33228-1-cbiesinger@google.com> Mime-Version: 1.0 Subject: [RFC] Change boolean options to bool instead of int From: "Christian Biesinger via gdb-patches" Reply-To: Christian Biesinger To: gdb-patches@sourceware.org Cc: Christian Biesinger Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2019-09/txt/msg00263.txt.bz2 [Before I write a huge changelog entry for this... would this be acceptable in principle?] This is for add_setshow_boolean_cmd as well as the gdb::option interface. --- gdb/ada-lang.c | 6 +++--- gdb/arch/aarch64-insn.c | 2 +- gdb/arch/aarch64-insn.h | 2 +- gdb/arm-linux-nat.c | 2 +- gdb/arm-linux-tdep.c | 2 +- gdb/arm-nbsd-nat.c | 2 +- gdb/arm-tdep.c | 4 ++-- gdb/auto-load.c | 12 ++++++------ gdb/auto-load.h | 6 +++--- gdb/breakpoint.c | 10 +++++----- gdb/breakpoint.h | 2 +- gdb/btrace.c | 2 +- gdb/cli/cli-cmds.c | 2 +- gdb/cli/cli-cmds.h | 2 +- gdb/cli/cli-decode.c | 2 +- gdb/cli/cli-logging.c | 6 +++--- gdb/cli/cli-option.h | 10 +++++----- gdb/cli/cli-setshow.c | 8 ++++---- gdb/cli/cli-style.c | 6 +++--- gdb/cli/cli-style.h | 4 ++-- gdb/cli/cli-utils.h | 6 +++--- gdb/command.h | 6 +++--- gdb/compile/compile-cplus-types.c | 4 ++-- gdb/compile/compile-internal.h | 2 +- gdb/compile/compile.c | 4 ++-- gdb/cp-support.c | 2 +- gdb/cris-tdep.c | 4 ++-- gdb/csky-tdep.c | 2 +- gdb/dcache.c | 2 +- gdb/defs.h | 2 +- gdb/demangle.c | 4 ++-- gdb/dwarf-index-cache.c | 2 +- gdb/dwarf2-frame.c | 2 +- gdb/dwarf2-frame.h | 2 +- gdb/dwarf2read.c | 6 +++--- gdb/eval.c | 2 +- gdb/event-top.c | 4 ++-- gdb/event-top.h | 4 ++-- gdb/exec.c | 2 +- gdb/frame.h | 8 ++++---- gdb/gdb-demangle.h | 6 +++--- gdb/gdb_bfd.c | 2 +- gdb/gdbcore.h | 2 +- gdb/gdbsupport/common-debug.c | 2 +- gdb/gdbsupport/common-debug.h | 4 ++-- gdb/gdbthread.h | 2 +- gdb/gdbtypes.c | 4 ++-- gdb/hppa-tdep.c | 2 +- gdb/infcall.c | 8 ++++---- gdb/infcmd.c | 2 +- gdb/inferior.c | 2 +- gdb/inferior.h | 4 ++-- gdb/infrun.c | 14 +++++++------- gdb/infrun.h | 8 ++++---- gdb/linux-tdep.c | 4 ++-- gdb/linux-thread-db.c | 6 +++--- gdb/main.c | 6 +++++- gdb/maint-test-options.c | 8 ++++---- gdb/maint-test-settings.c | 2 +- gdb/maint.c | 14 +++++++------- gdb/memattr.c | 2 +- gdb/mi/mi-main.c | 2 +- gdb/mips-tdep.c | 2 +- gdb/nat/fork-inferior.h | 2 +- gdb/nat/linux-namespaces.c | 2 +- gdb/nat/linux-namespaces.h | 4 ++-- gdb/nios2-tdep.c | 2 +- gdb/or1k-tdep.c | 2 +- gdb/parse.c | 2 +- gdb/parser-defs.h | 2 +- gdb/printcmd.c | 2 +- gdb/python/py-auto-load.c | 2 +- gdb/python/py-param.c | 9 ++++++--- gdb/python/py-value.c | 4 ++-- gdb/python/python.c | 2 +- gdb/ravenscar-thread.c | 4 ++-- gdb/record-full.c | 6 +++--- gdb/record-full.h | 2 +- gdb/remote-notif.c | 2 +- gdb/remote-notif.h | 2 +- gdb/remote.c | 6 +++--- gdb/ser-tcp.c | 2 +- gdb/ser-unix.c | 2 +- gdb/skip.c | 2 +- gdb/solib-aix.c | 2 +- gdb/spu-tdep.c | 4 ++-- gdb/stack.c | 8 ++++---- gdb/symfile-debug.c | 2 +- gdb/symfile.c | 4 ++-- gdb/symfile.h | 4 ++-- gdb/symtab.c | 14 +++++++------- gdb/symtab.h | 4 ++-- gdb/target-dcache.c | 4 ++-- gdb/target.c | 20 +++++++++---------- gdb/target.h | 2 +- gdb/thread.c | 8 ++++---- gdb/top.c | 10 +++++----- gdb/top.h | 4 ++-- gdb/tracepoint.c | 4 ++-- gdb/typeprint.c | 4 ++-- gdb/utils.c | 6 +++--- gdb/utils.h | 4 ++-- gdb/valops.c | 2 +- gdb/valprint.h | 32 +++++++++++++++---------------- gdb/windows-tdep.c | 2 +- gdb/xml-support.c | 2 +- 106 files changed, 243 insertions(+), 236 deletions(-) diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 8cdb62bde03..c34733e754f 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -358,7 +358,7 @@ maint_show_ada_cmd (const char *args, int from_tty) =20 /* The "maintenance ada set/show ignore-descriptive-type" value. */ =20 -static int ada_ignore_descriptive_types_p =3D 0; +static bool ada_ignore_descriptive_types_p =3D false; =20 /* Inferior-specific data. */ =20 @@ -3795,7 +3795,7 @@ sort_choices (struct block_symbol syms[], int nsyms) =20 /* Whether GDB should display formals and return types for functions in the overloads selection menu. */ -static int print_signatures =3D 1; +static bool print_signatures =3D true; =20 /* Print the signature for SYM on STREAM according to the FLAGS options. = For all but functions, the signature is just the name of the symbol. For @@ -9299,7 +9299,7 @@ ada_is_string_type (struct type *type) =20 Set to True if the debugger should trust the contents of PAD types. Otherwise, ignore the PAD type if there is a parallel XVS type. */ -static int trust_pad_over_xvs =3D 1; +static bool trust_pad_over_xvs =3D true; =20 /* True if TYPE is a struct type introduced by the compiler to force the alignment of a value. Such types have a single field with a diff --git a/gdb/arch/aarch64-insn.c b/gdb/arch/aarch64-insn.c index e04ad87fefb..48d0be83ff9 100644 --- a/gdb/arch/aarch64-insn.c +++ b/gdb/arch/aarch64-insn.c @@ -20,7 +20,7 @@ #include "aarch64-insn.h" =20 /* Toggle this file's internal debugging dump. */ -int aarch64_debug =3D 0; +bool aarch64_debug =3D false; =20 /* Extract a signed value from a bit field within an instruction encoding. diff --git a/gdb/arch/aarch64-insn.h b/gdb/arch/aarch64-insn.h index 4492594c1b9..47a825b1142 100644 --- a/gdb/arch/aarch64-insn.h +++ b/gdb/arch/aarch64-insn.h @@ -19,7 +19,7 @@ #ifndef ARCH_AARCH64_INSN_H #define ARCH_AARCH64_INSN_H =20 -extern int aarch64_debug; +extern bool aarch64_debug; =20 /* List of opcodes that we need for building the jump pad and relocating an instruction. */ diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c index 6a374bbc74b..ef44e68d319 100644 --- a/gdb/arm-linux-nat.c +++ b/gdb/arm-linux-nat.c @@ -66,7 +66,7 @@ #define PTRACE_SETHBPREGS 30 #endif =20 -extern int arm_apcs_32; +extern bool arm_apcs_32; =20 class arm_linux_nat_target final : public linux_nat_target { diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c index aec20877d9d..31ea4564dbb 100644 --- a/gdb/arm-linux-tdep.c +++ b/gdb/arm-linux-tdep.c @@ -56,7 +56,7 @@ #include "user-regs.h" #include #include "elf/common.h" -extern int arm_apcs_32; +extern bool arm_apcs_32; =20 /* Under ARM GNU/Linux the traditional way of performing a breakpoint is to execute a particular software interrupt, rather than use a diff --git a/gdb/arm-nbsd-nat.c b/gdb/arm-nbsd-nat.c index 2a83553a3fe..38a9e954b92 100644 --- a/gdb/arm-nbsd-nat.c +++ b/gdb/arm-nbsd-nat.c @@ -40,7 +40,7 @@ public: =20 static arm_netbsd_nat_target the_arm_netbsd_nat_target; =20 -extern int arm_apcs_32; +extern bool arm_apcs_32; =20 static void arm_supply_gregset (struct regcache *regcache, struct reg *gregset) diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 5dcc4431220..0650485bf04 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -65,7 +65,7 @@ #include "gdbsupport/selftest.h" #endif =20 -static int arm_debug; +static bool arm_debug; =20 /* Macros for setting and testing a bit in a minimal symbol that marks it as Thumb function. The MSB of the minimal symbol's "info" field @@ -296,7 +296,7 @@ static CORE_ADDR arm_analyze_prologue (struct gdbarch *= gdbarch, =20 /* Set to true if the 32-bit mode is in use. */ =20 -int arm_apcs_32 =3D 1; +bool arm_apcs_32 =3D true; =20 /* Return the bit mask in ARM_PS_REGNUM that indicates Thumb mode. */ =20 diff --git a/gdb/auto-load.c b/gdb/auto-load.c index 115d5c10e82..2d18629f9f1 100644 --- a/gdb/auto-load.c +++ b/gdb/auto-load.c @@ -61,7 +61,7 @@ static void maybe_print_script_not_found_warning const char *section_name, unsigned offset); =20 /* Value of the 'set debug auto-load' configuration variable. */ -static int debug_auto_load =3D 0; +static bool debug_auto_load =3D false; =20 /* "show" command for the debug_auto_load configuration variable. */ =20 @@ -79,7 +79,7 @@ show_debug_auto_load (struct ui_file *file, int from_tty, set auto-load gdb-scripts on|off This is true if we should auto-load associated scripts when an objfile is opened, false otherwise. */ -static int auto_load_gdb_scripts =3D 1; +static bool auto_load_gdb_scripts =3D true; =20 /* "show" command for the auto_load_gdb_scripts configuration variable. */ =20 @@ -110,16 +110,16 @@ auto_load_gdb_scripts_enabled (const struct extension= _language_defn *extlang) This flag exists to facilitate deferring auto-loading during start-up until after ./.gdbinit has been read; it may augment the search directo= ries used to find the scripts. */ -int global_auto_load =3D 1; +bool global_auto_load =3D true; =20 /* Auto-load .gdbinit file from the current directory? */ -int auto_load_local_gdbinit =3D 1; +bool auto_load_local_gdbinit =3D true; =20 /* Absolute pathname to the current directory .gdbinit, if it exists. */ char *auto_load_local_gdbinit_pathname =3D NULL; =20 -/* Boolean value if AUTO_LOAD_LOCAL_GDBINIT_PATHNAME has been loaded. */ -int auto_load_local_gdbinit_loaded =3D 0; +/* if AUTO_LOAD_LOCAL_GDBINIT_PATHNAME has been loaded. */ +bool auto_load_local_gdbinit_loaded =3D true; =20 /* "show" command for the auto_load_local_gdbinit configuration variable. = */ =20 diff --git a/gdb/auto-load.h b/gdb/auto-load.h index 5d5903e1198..ab865e9fa51 100644 --- a/gdb/auto-load.h +++ b/gdb/auto-load.h @@ -25,11 +25,11 @@ struct program_space; struct auto_load_pspace_info; struct extension_language_defn; =20 -extern int global_auto_load; +extern bool global_auto_load; =20 -extern int auto_load_local_gdbinit; +extern bool auto_load_local_gdbinit; extern char *auto_load_local_gdbinit_pathname; -extern int auto_load_local_gdbinit_loaded; +extern bool auto_load_local_gdbinit_loaded; =20 extern struct auto_load_pspace_info * get_auto_load_pspace_data_for_loading (struct program_space *pspace); diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 9478d2dcf20..8c7c3ea2895 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -290,7 +290,7 @@ static char *dprintf_channel; =20 /* True if dprintf commands should continue to operate even if GDB has disconnected. */ -static int disconnected_dprintf =3D 1; +static bool disconnected_dprintf =3D true; =20 struct command_line * breakpoint_commands (struct breakpoint *b) @@ -301,7 +301,7 @@ breakpoint_commands (struct breakpoint *b) /* Flag indicating that a command has proceeded the inferior past the current breakpoint. */ =20 -static int breakpoint_proceeded; +static bool breakpoint_proceeded; =20 const char * bpdisp_text (enum bpdisp disp) @@ -350,7 +350,7 @@ show_pending_break_support (struct ui_file *file, int f= rom_tty, set with "break" but falling in read-only memory. If 0, gdb will warn about such breakpoints, but won't automatically use hardware breakpoints. */ -static int automatic_hardware_breakpoints; +static bool automatic_hardware_breakpoints; static void show_automatic_hardware_breakpoints (struct ui_file *file, int from_tty, struct cmd_list_element *c, @@ -368,7 +368,7 @@ show_automatic_hardware_breakpoints (struct ui_file *fi= le, int from_tty, breakpoints until the next resume, and removes them again when the target fully stops. This is a bit safer in case GDB crashes while processing user input. */ -static int always_inserted_mode =3D 0; +static bool always_inserted_mode =3D true; =20 static void show_always_inserted_mode (struct ui_file *file, int from_tty, @@ -477,7 +477,7 @@ static int executing_breakpoint_commands; static int overlay_events_enabled; =20 /* See description in breakpoint.h. */ -int target_exact_watchpoints =3D 0; +bool target_exact_watchpoints =3D false; =20 /* Walk the following statement or block through all breakpoints. ALL_BREAKPOINTS_SAFE does so even if the statement deletes the diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index 69a043c7676..49380e30c26 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -675,7 +675,7 @@ enum watchpoint_triggered only one register per watchpoint, thus assuming that all acesses that modify a memory location happen at its starting address. */ =20 -extern int target_exact_watchpoints; +extern bool target_exact_watchpoints; =20 /* Note that the ->silent field is not currently used by any commands (though the code is in there if it was to be, and set_raw_breakpoint diff --git a/gdb/btrace.c b/gdb/btrace.c index 466607dbfc2..1b809fb5c08 100644 --- a/gdb/btrace.c +++ b/gdb/btrace.c @@ -51,7 +51,7 @@ static struct cmd_list_element *maint_btrace_pt_set_cmdli= st; static struct cmd_list_element *maint_btrace_pt_show_cmdlist; =20 /* Control whether to skip PAD packets when computing the packet history. = */ -static int maint_btrace_pt_skip_pad =3D 1; +static bool maint_btrace_pt_skip_pad =3D true; =20 static void btrace_add_pc (struct thread_info *tp); =20 diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index 4fc656775c9..03cfc9b7fdc 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -165,7 +165,7 @@ struct cmd_list_element *showchecklist; /* Command tracing state. */ =20 int source_verbose =3D 0; -int trace_commands =3D 0; +bool trace_commands =3D 0; =0C /* 'script-extension' option support. */ =20 diff --git a/gdb/cli/cli-cmds.h b/gdb/cli/cli-cmds.h index 5bfffde04a1..1a8b9a0d506 100644 --- a/gdb/cli/cli-cmds.h +++ b/gdb/cli/cli-cmds.h @@ -139,7 +139,7 @@ extern gdb::optional /* Command tracing state. */ =20 extern int source_verbose; -extern int trace_commands; +extern bool trace_commands; =20 /* Common code for the "with" and "maintenance with" commands. SET_CMD_PREFIX is the spelling of the corresponding "set" command diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c index 7d4b39f467c..debffbc0f74 100644 --- a/gdb/cli/cli-decode.c +++ b/gdb/cli/cli-decode.c @@ -589,7 +589,7 @@ const char * const boolean_enums[] =3D { "on", "off", N= ULL }; Returns the new command element. */ =20 cmd_list_element * -add_setshow_boolean_cmd (const char *name, enum command_class theclass, in= t *var, +add_setshow_boolean_cmd (const char *name, enum command_class theclass, bo= ol *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_const_sfunc_ftype *set_func, diff --git a/gdb/cli/cli-logging.c b/gdb/cli/cli-logging.c index 9e39be197b8..22b540b4812 100644 --- a/gdb/cli/cli-logging.c +++ b/gdb/cli/cli-logging.c @@ -33,7 +33,7 @@ show_logging_filename (struct ui_file *file, int from_tty, value); } =20 -static int logging_overwrite; +static bool logging_overwrite; =20 static void maybe_warn_already_logging () @@ -61,8 +61,8 @@ show_logging_overwrite (struct ui_file *file, int from_tt= y, } =20 /* Value as configured by the user. */ -static int logging_redirect; -static int debug_redirect; +static bool logging_redirect; +static bool debug_redirect; =20 static void set_logging_redirect (const char *args, diff --git a/gdb/cli/cli-option.h b/gdb/cli/cli-option.h index d231d8b1adb..3fd0c0cdae9 100644 --- a/gdb/cli/cli-option.h +++ b/gdb/cli/cli-option.h @@ -82,7 +82,7 @@ public: returns the address of some member. */ union { - int *(*boolean) (const option_def &, void *ctx); + bool *(*boolean) (const option_def &, void *ctx); unsigned int *(*uinteger) (const option_def &, void *ctx); int *(*integer) (const option_def &, void *ctx); const char **(*enumeration) (const option_def &, void *ctx); @@ -155,7 +155,7 @@ template struct boolean_option_def : option_def { boolean_option_def (const char *long_option_, - int *(*get_var_address_cb_) (Context *), + bool *(*get_var_address_cb_) (Context *), show_value_ftype *show_cmd_cb_, const char *set_doc_, const char *show_doc_ =3D nullptr, @@ -165,7 +165,7 @@ struct boolean_option_def : option_def show_cmd_cb_, set_doc_, show_doc_, help_doc_) { - var_address.boolean =3D detail::get_var_address; + var_address.boolean =3D detail::get_var_address; } }; =20 @@ -173,11 +173,11 @@ struct boolean_option_def : option_def hood, but unlike boolean options, flag options don't take an on/off argument. */ =20 -template +template struct flag_option_def : boolean_option_def { flag_option_def (const char *long_option_, - int *(*var_address_cb_) (Context *), + bool *(*var_address_cb_) (Context *), const char *set_doc_, const char *help_doc_ =3D nullptr) : boolean_option_def (long_option_, diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c index 40538832b5d..d8391597acf 100644 --- a/gdb/cli/cli-setshow.c +++ b/gdb/cli/cli-setshow.c @@ -416,9 +416,9 @@ do_set_command (const char *arg, int from_tty, struct c= md_list_element *c) =20 if (val < 0) error (_("\"on\" or \"off\" expected.")); - if (val !=3D *(int *) c->var) + if (val !=3D *(bool *) c->var) { - *(int *) c->var =3D val; + *(bool *) c->var =3D val; =20 option_changed =3D 1; } @@ -588,7 +588,7 @@ do_set_command (const char *arg, int from_tty, struct c= md_list_element *c) break; case var_boolean: { - const char *opt =3D *(int *) c->var ? "on" : "off"; + const char *opt =3D *(bool *) c->var ? "on" : "off"; =20 gdb::observers::command_param_changed.notify (name, opt); } @@ -645,7 +645,7 @@ get_setshow_command_value_string (cmd_list_element *c) stb.puts (*(char **) c->var); break; case var_boolean: - stb.puts (*(int *) c->var ? "on" : "off"); + stb.puts (*(bool *) c->var ? "on" : "off"); break; case var_auto_boolean: switch (*(enum auto_boolean*) c->var) diff --git a/gdb/cli/cli-style.c b/gdb/cli/cli-style.c index e594e38cd6d..ea301774d22 100644 --- a/gdb/cli/cli-style.c +++ b/gdb/cli/cli-style.c @@ -26,15 +26,15 @@ /* True if styling is enabled. */ =20 #if defined (__MSDOS__) || defined (__CYGWIN__) -int cli_styling =3D 0; +bool cli_styling =3D false; #else -int cli_styling =3D 1; +bool cli_styling =3D true; #endif =20 /* True if source styling is enabled. Note that this is only consulted when cli_styling is true. */ =20 -int source_styling =3D 1; +bool source_styling =3D true; =20 /* Name of colors; must correspond to ui_file_style::basic_color. */ static const char * const cli_colors[] =3D { diff --git a/gdb/cli/cli-style.h b/gdb/cli/cli-style.h index cdcea84f0ee..826162f5788 100644 --- a/gdb/cli/cli-style.h +++ b/gdb/cli/cli-style.h @@ -110,9 +110,9 @@ extern cli_style_option title_style; =20 =20 /* True if source styling is enabled. */ -extern int source_styling; +extern bool source_styling; =20 /* True if styling is enabled. */ -extern int cli_styling; +extern bool cli_styling; =20 #endif /* CLI_CLI_STYLE_H */ diff --git a/gdb/cli/cli-utils.h b/gdb/cli/cli-utils.h index cbe8ff66e15..33b8663e9ae 100644 --- a/gdb/cli/cli-utils.h +++ b/gdb/cli/cli-utils.h @@ -215,9 +215,9 @@ check_for_argument (char **str, const char *arg) =20 struct qcs_flags { - int quiet =3D false; - int cont =3D false; - int silent =3D false; + bool quiet =3D false; + bool cont =3D false; + bool silent =3D false; }; =20 /* Validate FLAGS. Throws an error if both FLAGS->CONT and diff --git a/gdb/command.h b/gdb/command.h index 2c608048d54..29b99333946 100644 --- a/gdb/command.h +++ b/gdb/command.h @@ -62,8 +62,8 @@ cmd_types; /* Types of "set" or "show" command. */ typedef enum var_types { - /* "on" or "off". *VAR is an integer which is nonzero for on, - zero for off. */ + /* "on" or "off". *VAR is an bool which is true for on, + false for off. */ var_boolean, =20 /* "on" / "true" / "enable" or "off" / "false" / "disable" or @@ -331,7 +331,7 @@ extern void add_setshow_auto_boolean_cmd (const char *n= ame, extern cmd_list_element * add_setshow_boolean_cmd (const char *name, enum command_class theclass, - int *var, + bool *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_const_sfunc_ftype *set_func, diff --git a/gdb/compile/compile-cplus-types.c b/gdb/compile/compile-cplus-= types.c index 3a7c8b01f7d..042c2afbe90 100644 --- a/gdb/compile/compile-cplus-types.c +++ b/gdb/compile/compile-cplus-types.c @@ -41,11 +41,11 @@ const char *compile_cplus_instance::m_default_cflags = =3D "-std=3Dgnu++11"; =20 /* Flag to enable internal debugging. */ =20 -static int debug_compile_cplus_types =3D 0; +static bool debug_compile_cplus_types =3D false; =20 /* Flag to enable internal scope switching debugging. */ =20 -static int debug_compile_cplus_scopes =3D 0; +static bool debug_compile_cplus_scopes =3D false; =20 /* Forward declarations. */ =20 diff --git a/gdb/compile/compile-internal.h b/gdb/compile/compile-internal.h index 406a369d683..9c0e9894108 100644 --- a/gdb/compile/compile-internal.h +++ b/gdb/compile/compile-internal.h @@ -21,7 +21,7 @@ =20 /* Debugging flag for the "compile" family of commands. */ =20 -extern int compile_debug; +extern bool compile_debug; =20 struct block; =20 diff --git a/gdb/compile/compile.c b/gdb/compile/compile.c index 87970d2c948..5c3400ffec8 100644 --- a/gdb/compile/compile.c +++ b/gdb/compile/compile.c @@ -56,7 +56,7 @@ static struct cmd_list_element *compile_command_list; =20 /* Debug flag for "compile" commands. */ =20 -int compile_debug; +bool compile_debug; =20 /* Object of this type are stored in the compiler's symbol_err_map. */ =20 @@ -241,7 +241,7 @@ show_compile_debug (struct ui_file *file, int from_tty, struct compile_options { /* For -raw. */ - int raw =3D false; + bool raw =3D false; }; =20 using compile_flag_option_def diff --git a/gdb/cp-support.c b/gdb/cp-support.c index b8b0fcc0ae2..ecec08163f7 100644 --- a/gdb/cp-support.c +++ b/gdb/cp-support.c @@ -1472,7 +1472,7 @@ cp_lookup_rtti_type (const char *name, const struct b= lock *block) /* If nonzero, attempt to catch crashes in the demangler and print useful debugging information. */ =20 -static int catch_demangler_crashes =3D 1; +static bool catch_demangler_crashes =3D true; =20 /* Stack context and environment for demangler crash recovery. */ =20 diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c index 8eda05806f8..578f9516265 100644 --- a/gdb/cris-tdep.c +++ b/gdb/cris-tdep.c @@ -148,7 +148,7 @@ extern const struct cris_spec_reg cris_spec_regs[]; static unsigned int usr_cmd_cris_version; =20 /* Indicates whether to trust the above variable. */ -static int usr_cmd_cris_version_valid =3D 0; +static bool usr_cmd_cris_version_valid =3D true; =20 static const char cris_mode_normal[] =3D "normal"; static const char cris_mode_guru[] =3D "guru"; @@ -163,7 +163,7 @@ static const char *const cris_modes[] =3D { static const char *usr_cmd_cris_mode =3D cris_mode_normal; =20 /* Whether to make use of Dwarf-2 CFI (default on). */ -static int usr_cmd_cris_dwarf2_cfi =3D 1; +static bool usr_cmd_cris_dwarf2_cfi =3D true; =20 /* Sigtramp identification code copied from i386-linux-tdep.c. */ =20 diff --git a/gdb/csky-tdep.c b/gdb/csky-tdep.c index 54b856af067..a6f78a187cf 100644 --- a/gdb/csky-tdep.c +++ b/gdb/csky-tdep.c @@ -59,7 +59,7 @@ #include =20 /* Control debugging information emitted in this file. */ -static int csky_debug =3D 0; +static bool csky_debug =3D false; =20 static struct reggroup *cr_reggroup; static struct reggroup *fr_reggroup; diff --git a/gdb/dcache.c b/gdb/dcache.c index 1716def4c4a..14da0921824 100644 --- a/gdb/dcache.c +++ b/gdb/dcache.c @@ -126,7 +126,7 @@ static int dcache_read_line (DCACHE *dcache, struct dca= che_block *db); =20 static struct dcache_block *dcache_alloc (DCACHE *dcache, CORE_ADDR addr); =20 -static int dcache_enabled_p =3D 0; /* OBSOLETE */ +static bool dcache_enabled_p =3D 0; /* OBSOLETE */ =20 static void show_dcache_enabled_p (struct ui_file *file, int from_tty, diff --git a/gdb/defs.h b/gdb/defs.h index c9a38b60a6d..f12ba366ccf 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -314,7 +314,7 @@ struct ui; =20 extern int input_interactive_p (struct ui *); =20 -extern int info_verbose; +extern bool info_verbose; =20 /* From printcmd.c */ =20 diff --git a/gdb/demangle.c b/gdb/demangle.c index 29f46968a29..37356537e48 100644 --- a/gdb/demangle.c +++ b/gdb/demangle.c @@ -44,7 +44,7 @@ #endif =20 /* See documentation in gdb-demangle.h. */ -int demangle =3D 1; +bool demangle =3D true; =20 static void show_demangle (struct ui_file *file, int from_tty, @@ -57,7 +57,7 @@ show_demangle (struct ui_file *file, int from_tty, } =20 /* See documentation in gdb-demangle.h. */ -int asm_demangle =3D 0; +bool asm_demangle =3D 0; =20 static void show_asm_demangle (struct ui_file *file, int from_tty, diff --git a/gdb/dwarf-index-cache.c b/gdb/dwarf-index-cache.c index e56cb59343c..74f06dfbfb7 100644 --- a/gdb/dwarf-index-cache.c +++ b/gdb/dwarf-index-cache.c @@ -33,7 +33,7 @@ #include =20 /* When set to 1, show debug messages about the index cache. */ -static int debug_index_cache =3D 0; +static bool debug_index_cache =3D false; =20 /* The index cache directory, used for "set/show index-cache directory". = */ static char *index_cache_directory =3D NULL; diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c index 7839942b8c7..e18b35e7dba 100644 --- a/gdb/dwarf2-frame.c +++ b/gdb/dwarf2-frame.c @@ -171,7 +171,7 @@ static CORE_ADDR read_encoded_value (struct comp_unit *= unit, gdb_byte encoding, =0C =20 /* See dwarf2-frame.h. */ -int dwarf2_frame_unwinders_enabled_p =3D 1; +bool dwarf2_frame_unwinders_enabled_p =3D true; =20 /* Store the length the expression for the CFA in the `cfa_reg' field, which is unused in that case. */ diff --git a/gdb/dwarf2-frame.h b/gdb/dwarf2-frame.h index 6caf82ae0fc..3c54f0950e0 100644 --- a/gdb/dwarf2-frame.h +++ b/gdb/dwarf2-frame.h @@ -201,7 +201,7 @@ struct dwarf2_frame_state registered with the gdbarch. Not all architectures can or do use the DWARF unwinders. Setting this to true on a target that does not otherwise support the DWARF unwinders has no effect. */ -extern int dwarf2_frame_unwinders_enabled_p; +extern bool dwarf2_frame_unwinders_enabled_p; =20 /* Set the architecture-specific register state initialization function for GDBARCH to INIT_REG. */ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index a2b80ebbc15..c96e01895aa 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -103,10 +103,10 @@ static unsigned int dwarf_die_debug =3D 0; static unsigned int dwarf_line_debug =3D 0; =20 /* When non-zero, cross-check physname against demangler. */ -static int check_physname =3D 0; +static bool check_physname =3D 0; =20 /* When non-zero, do not reject deprecated .gdb_index sections. */ -static int use_deprecated_index_sections =3D 0; +static bool use_deprecated_index_sections =3D 0; =20 static const struct objfile_key dwarf2_objfile_data_ke= y; =20 @@ -25837,7 +25837,7 @@ show_dwarf_cmd (const char *args, int from_tty) cmd_show_list (show_dwarf_cmdlist, from_tty, ""); } =20 -int dwarf_always_disassemble; +bool dwarf_always_disassemble; =20 static void show_dwarf_always_disassemble (struct ui_file *file, int from_tty, diff --git a/gdb/eval.c b/gdb/eval.c index aed89e5f85a..f8915b99578 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -43,7 +43,7 @@ #include =20 /* This is defined in valops.c */ -extern int overload_resolution; +extern bool overload_resolution; =20 /* Prototypes for local functions. */ =20 diff --git a/gdb/event-top.c b/gdb/event-top.c index 2132fb550dc..0b05b2f85a5 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -86,11 +86,11 @@ static void async_sigterm_handler (gdb_client_data arg); ezannoni: as of 1999-04-29 I expect that this variable will not be used after gdb is changed to use the event loop as default engine, and event-top.c is merged into top.c. */ -int set_editing_cmd_var; +bool set_editing_cmd_var; =20 /* This is used to display the notification of the completion of an asynchronous execution command. */ -int exec_done_display_p =3D 0; +bool exec_done_display_p =3D false; =20 /* Used by the stdin event handler to compensate for missed stdin events. Setting this to a non-zero value inside an stdin callback makes the cal= lback diff --git a/gdb/event-top.h b/gdb/event-top.h index 4c3e6cb8612..1dc7b13d4f8 100644 --- a/gdb/event-top.h +++ b/gdb/event-top.h @@ -52,8 +52,8 @@ extern void async_enable_stdin (void); /* Exported variables from event-top.c. FIXME: these should really go into top.h. */ =20 -extern int set_editing_cmd_var; -extern int exec_done_display_p; +extern bool set_editing_cmd_var; +extern bool exec_done_display_p; extern struct prompts the_prompts; extern void (*after_char_processing_hook) (void); extern int call_stdin_event_handler_again_p; diff --git a/gdb/exec.c b/gdb/exec.c index 3098fcaadd5..4e4cacffda0 100644 --- a/gdb/exec.c +++ b/gdb/exec.c @@ -84,7 +84,7 @@ static exec_target exec_ops; =20 /* Whether to open exec and core files read-only or read-write. */ =20 -int write_files =3D 0; +bool write_files =3D false; static void show_write_files (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) diff --git a/gdb/frame.h b/gdb/frame.h index 09842c92a34..624bc87c9d3 100644 --- a/gdb/frame.h +++ b/gdb/frame.h @@ -808,9 +808,9 @@ struct frame_print_options const char *print_frame_info =3D print_frame_info_auto; const char *print_entry_values =3D print_entry_values_default; =20 - /* If non-zero, don't invoke pretty-printers for frame + /* If true, don't invoke pretty-printers for frame arguments. */ - int print_raw_frame_arguments; + bool print_raw_frame_arguments; }; =20 /* The values behind the global "set print ..." settings. */ @@ -931,11 +931,11 @@ struct set_backtrace_options { /* Flag to indicate whether backtraces should continue past main. */ - int backtrace_past_main =3D 0; + bool backtrace_past_main =3D false; =20 /* Flag to indicate whether backtraces should continue past entry. */ - int backtrace_past_entry =3D 0; + bool backtrace_past_entry =3D false; =20 /* Upper bound on the number of backtrace levels. Note this is not exposed as a command option, because "backtrace" and "frame diff --git a/gdb/gdb-demangle.h b/gdb/gdb-demangle.h index 9c944a5017f..0a78c66e5a4 100644 --- a/gdb/gdb-demangle.h +++ b/gdb/gdb-demangle.h @@ -19,14 +19,14 @@ #ifndef GDB_DEMANGLE_H #define GDB_DEMANGLE_H =20 -/* Nonzero means that encoded C++/ObjC names should be printed out in their +/* True means that encoded C++/ObjC names should be printed out in their C++/ObjC form rather than raw. */ -extern int demangle; +extern bool demangle; =20 /* Nonzero means that encoded C++/ObjC names should be printed out in their C++/ObjC form even in assembler language displays. If this is set, but DEMANGLE is zero, names are printed raw, i.e. DEMANGLE controls. */ -extern int asm_demangle; +extern bool asm_demangle; =20 /* Check if a character is one of the commonly used C++ marker characters.= */ extern int is_cplus_marker (int); diff --git a/gdb/gdb_bfd.c b/gdb/gdb_bfd.c index d3b4c749f50..a17460a8a00 100644 --- a/gdb/gdb_bfd.c +++ b/gdb/gdb_bfd.c @@ -137,7 +137,7 @@ static htab_t gdb_bfd_cache; /* When true gdb will reuse an existing bfd object if the filename, modification time, and file size all match. */ =20 -static int bfd_sharing =3D 1; +static bool bfd_sharing =3D true; static void show_bfd_sharing (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) diff --git a/gdb/gdbcore.h b/gdb/gdbcore.h index 6f9b4d88ecd..cac91c097ba 100644 --- a/gdb/gdbcore.h +++ b/gdb/gdbcore.h @@ -137,7 +137,7 @@ extern void specify_exec_file_hook (void (*hook) (const= char *filename)); =20 /* Whether to open exec and core files read-only or read-write. */ =20 -extern int write_files; +extern bool write_files; =20 /* Open and set up the core file bfd. */ =20 diff --git a/gdb/gdbsupport/common-debug.c b/gdb/gdbsupport/common-debug.c index 97c90032ebd..7e7e5c3f018 100644 --- a/gdb/gdbsupport/common-debug.c +++ b/gdb/gdbsupport/common-debug.c @@ -22,7 +22,7 @@ =20 /* See gdbsupport/common-debug.h. */ =20 -int show_debug_regs; +bool show_debug_regs; =20 /* See gdbsupport/common-debug.h. */ =20 diff --git a/gdb/gdbsupport/common-debug.h b/gdb/gdbsupport/common-debug.h index d5bfc9eb3ae..5584f098442 100644 --- a/gdb/gdbsupport/common-debug.h +++ b/gdb/gdbsupport/common-debug.h @@ -20,10 +20,10 @@ #ifndef COMMON_COMMON_DEBUG_H #define COMMON_COMMON_DEBUG_H =20 -/* Set to nonzero to enable debugging of hardware breakpoint/ +/* Set to true to enable debugging of hardware breakpoint/ watchpoint support code. */ =20 -extern int show_debug_regs; +extern bool show_debug_regs; =20 /* Print a formatted message to the appropriate channel for debugging output for the client. */ diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h index 04230d3c170..0daea9c2dac 100644 --- a/gdb/gdbthread.h +++ b/gdb/gdbthread.h @@ -623,7 +623,7 @@ extern void thread_command (const char *tidstr, int fro= m_tty); =20 /* Print notices on thread events (attach, detach, etc.), set with `set print thread-events'. */ -extern int print_thread_events; +extern bool print_thread_events; =20 /* Prints the list of threads and their details on UIOUT. If REQUESTED_THREADS, a list of GDB ids/ranges, is not NULL, only diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 4bc02e08f96..afda89e43fc 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -116,7 +116,7 @@ const struct floatformat *floatformats_ibm_long_double[= BFD_ENDIAN_UNKNOWN] =3D { =20 /* Should opaque types be resolved? */ =20 -static int opaque_type_resolution =3D 1; +static bool opaque_type_resolution =3D true; =20 /* A flag to enable printing of debugging information of C++ overloading. */ @@ -125,7 +125,7 @@ unsigned int overload_debug =3D 0; =20 /* A flag to enable strict type checking. */ =20 -static int strict_type_checking =3D 1; +static bool strict_type_checking =3D true; =20 /* A function to show whether opaque types are resolved. */ =20 diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index be30359638c..b1f71883ec3 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -41,7 +41,7 @@ #include "hppa-tdep.h" #include =20 -static int hppa_debug =3D 0; +static bool hppa_debug =3D false; =20 /* Some local constants. */ static const int hppa32_num_regs =3D 128; diff --git a/gdb/infcall.c b/gdb/infcall.c index 23f17ee0e23..726f14d525f 100644 --- a/gdb/infcall.c +++ b/gdb/infcall.c @@ -55,7 +55,7 @@ asynchronous inferior function call implementation, and that in turn means restructuring the code so that it is event driven. */ =20 -static int may_call_functions_p =3D 1; +static bool may_call_functions_p =3D true; static void show_may_call_functions_p (struct ui_file *file, int from_tty, struct cmd_list_element *c, @@ -86,7 +86,7 @@ show_may_call_functions_p (struct ui_file *file, int from= _tty, trust the debug information; the user can override this behavior with "set coerce-float-to-double 0". */ =20 -static int coerce_float_to_double_p =3D 1; +static bool coerce_float_to_double_p =3D true; static void show_coerce_float_to_double_p (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) @@ -104,7 +104,7 @@ show_coerce_float_to_double_p (struct ui_file *file, in= t from_tty, =20 The default is to stop in the frame where the signal was received. */ =20 -static int unwind_on_signal_p =3D 0; +static bool unwind_on_signal_p =3D false; static void show_unwind_on_signal_p (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) @@ -127,7 +127,7 @@ show_unwind_on_signal_p (struct ui_file *file, int from= _tty, The default is to unwind the frame if a std::terminate call is made. */ =20 -static int unwind_on_terminating_exception_p =3D 1; +static bool unwind_on_terminating_exception_p =3D true; =20 static void show_unwind_on_terminating_exception_p (struct ui_file *file, int from_tty, diff --git a/gdb/infcmd.c b/gdb/infcmd.c index d7a7e6f9336..dc82ef043fe 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -105,7 +105,7 @@ int stopped_by_random_signal; =20 /* See inferior.h. */ =20 -int startup_with_shell =3D 1; +bool startup_with_shell =3D true; =20 =0C /* Accessor routines. */ diff --git a/gdb/inferior.c b/gdb/inferior.c index 2d58a11ba85..cf2175494d1 100644 --- a/gdb/inferior.c +++ b/gdb/inferior.c @@ -46,7 +46,7 @@ struct inferior *inferior_list =3D NULL; static int highest_inferior_num; =20 /* See inferior.h. */ -int print_inferior_events =3D 1; +bool print_inferior_events =3D true; =20 /* The Current Inferior. This is a strong reference. I.e., whenever an inferior is the current inferior, its refcount is diff --git a/gdb/inferior.h b/gdb/inferior.h index 9cfb03cdbb3..3a64a7cfeae 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -244,7 +244,7 @@ extern void prepare_execution_command (struct target_op= s *target, =20 The catch-exec traps expected during start-up will be one more if the target is started up with a shell. */ -extern int startup_with_shell; +extern bool startup_with_shell; =20 /* Nonzero if stopped due to completion of a stack dummy routine. */ =20 @@ -257,7 +257,7 @@ extern int stopped_by_random_signal; =20 /* Print notices on inferior events (attach, detach, etc.), set with `set print inferior-events'. */ -extern int print_inferior_events; +extern bool print_inferior_events; =20 /* Anything but NO_STOP_QUIETLY means we expect a trap and the caller will handle it themselves. STOP_QUIETLY is used when running in diff --git a/gdb/infrun.c b/gdb/infrun.c index a9588f896a5..8a848875adc 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -136,7 +136,7 @@ mark_infrun_async_event_handler (void) /* When set, stop the 'step' command if we enter a function which has no line number information. The normal behavior is that we step over such function. */ -int step_stop_if_no_debug =3D 0; +bool step_stop_if_no_debug =3D false; static void show_step_stop_if_no_debug (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) @@ -155,9 +155,9 @@ static ptid_t previous_inferior_ptid; Exactly which branch is detached depends on 'set follow-fork-mode' setting. */ =20 -static int detach_fork =3D 1; +static bool detach_fork =3D true; =20 -int debug_displaced =3D 0; +bool debug_displaced =3D false; static void show_debug_displaced (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) @@ -176,7 +176,7 @@ show_debug_infrun (struct ui_file *file, int from_tty, =20 /* Support for disabling address space randomization. */ =20 -int disable_randomization =3D 1; +bool disable_randomization =3D true; =20 static void show_disable_randomization (struct ui_file *file, int from_tty, @@ -206,7 +206,7 @@ set_disable_randomization (const char *args, int from_t= ty, /* User interface for non-stop mode. */ =20 int non_stop =3D 0; -static int non_stop_1 =3D 0; +static bool non_stop_1 =3D false; =20 static void set_non_stop (const char *args, int from_tty, @@ -235,7 +235,7 @@ show_non_stop (struct ui_file *file, int from_tty, target's execution have been disabled. */ =20 int observer_mode =3D 0; -static int observer_mode_1 =3D 0; +static bool observer_mode_1 =3D false; =20 static void set_observer_mode (const char *args, int from_tty, @@ -2089,7 +2089,7 @@ set_schedlock_func (const char *args, int from_tty, s= truct cmd_list_element *c) /* True if execution commands resume all threads of all processes by default; otherwise, resume only threads of the current inferior process. */ -int sched_multi =3D 0; +bool sched_multi =3D false; =20 /* Try to setup for software single stepping over the specified location. Return 1 if target_resume() should use hardware single step. diff --git a/gdb/infrun.h b/gdb/infrun.h index 30374ee51c4..04f388206d1 100644 --- a/gdb/infrun.h +++ b/gdb/infrun.h @@ -30,7 +30,7 @@ struct return_value_info; extern unsigned int debug_infrun; =20 /* True if we are debugging displaced stepping. */ -extern int debug_displaced; +extern bool debug_displaced; =20 /* Nonzero if we want to give control to the user when we're notified of shared library events by the dynamic linker. */ @@ -39,12 +39,12 @@ extern int stop_on_solib_events; /* True if execution commands resume all threads of all processes by default; otherwise, resume only threads of the current inferior process. */ -extern int sched_multi; +extern bool sched_multi; =20 /* When set, stop the 'step' command if we enter a function which has no line number information. The normal behavior is that we step over such function. */ -extern int step_stop_if_no_debug; +extern bool step_stop_if_no_debug; =20 /* If set, the inferior should be controlled in non-stop mode. In this mode, each thread is controlled independently. Execution @@ -56,7 +56,7 @@ extern int non_stop; /* When set (default), the target should attempt to disable the operating system's address space randomization feature when starting an inferior. */ -extern int disable_randomization; +extern bool disable_randomization; =20 /* Returns a unique identifier for the current stop. This can be used to tell whether a command has proceeded the inferior past the diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c index 7d0c3e9fc95..ff888a90678 100644 --- a/gdb/linux-tdep.c +++ b/gdb/linux-tdep.c @@ -91,12 +91,12 @@ struct smaps_vmflags /* Whether to take the /proc/PID/coredump_filter into account when generating a corefile. */ =20 -static int use_coredump_filter =3D 1; +static bool use_coredump_filter =3D true; =20 /* Whether the value of smaps_vmflags->exclude_coredump should be ignored, including mappings marked with the VM_DONTDUMP flag in the dump. */ -static int dump_excluded_mappings =3D 0; +static bool dump_excluded_mappings =3D false; =20 /* This enum represents the signals' numbers on a generic architecture running the Linux kernel. The definition of "generic" comes from diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c index 1d32e9195c0..cfe99660d25 100644 --- a/gdb/linux-thread-db.c +++ b/gdb/linux-thread-db.c @@ -110,13 +110,13 @@ public: =20 static char *libthread_db_search_path; =20 -/* Set to non-zero if thread_db auto-loading is enabled +/* Set to true if thread_db auto-loading is enabled by the "set auto-load libthread-db" command. */ -static int auto_load_thread_db =3D 1; +static bool auto_load_thread_db =3D true; =20 /* Set to non-zero if load-time libthread_db tests have been enabled by the "maintenence set check-libthread-db" command. */ -static int check_thread_db_on_load =3D 0; +static bool check_thread_db_on_load =3D false; =20 /* "show" command for the auto_load_thread_db configuration variable. */ =20 diff --git a/gdb/main.c b/gdb/main.c index 6b75fced236..0ea78d8ae99 100644 --- a/gdb/main.c +++ b/gdb/main.c @@ -594,6 +594,9 @@ captured_main_1 (struct captured_main_args *context) OPT_READNOW, OPT_READNEVER }; + /* This struct requires int* in the struct, but write_files is a bool. + So use this temporary int that we write back after argument parsing= . */ + int write_files_1 =3D 0; static struct option long_options[] =3D { {"tui", no_argument, 0, OPT_TUI}, @@ -658,7 +661,7 @@ captured_main_1 (struct captured_main_args *context) {"w", no_argument, NULL, OPT_WINDOWS}, {"windows", no_argument, NULL, OPT_WINDOWS}, {"statistics", no_argument, 0, OPT_STATISTICS}, - {"write", no_argument, &write_files, 1}, + {"write", no_argument, &write_files_1, 1}, {"args", no_argument, &set_args, 1}, {"l", required_argument, 0, 'l'}, {"return-child-result", no_argument, &return_child_result, 1}, @@ -842,6 +845,7 @@ captured_main_1 (struct captured_main_args *context) gdb_program_name); } } + write_files =3D write_files_1; =20 if (batch_flag) { diff --git a/gdb/maint-test-options.c b/gdb/maint-test-options.c index 7039f932f1d..0688135233e 100644 --- a/gdb/maint-test-options.c +++ b/gdb/maint-test-options.c @@ -126,10 +126,10 @@ static const char *const test_options_enum_values_cho= ices[] =3D =20 struct test_options_opts { - int flag_opt =3D 0; - int xx1_opt =3D 0; - int xx2_opt =3D 0; - int boolean_opt =3D 0; + bool flag_opt =3D 0; + bool xx1_opt =3D 0; + bool xx2_opt =3D 0; + bool boolean_opt =3D 0; const char *enum_opt =3D test_options_enum_values_xxx; unsigned int uint_opt =3D 0; int zuint_unl_opt =3D 0; diff --git a/gdb/maint-test-settings.c b/gdb/maint-test-settings.c index a1c43ee9173..86d201a3c6f 100644 --- a/gdb/maint-test-settings.c +++ b/gdb/maint-test-settings.c @@ -50,7 +50,7 @@ maintenance_show_test_settings_cmd (const char *args, int= from_tty) /* Control variables for all the "maintenance set/show test-settings xxx" commands. */ =20 -static int maintenance_test_settings_boolean; +static bool maintenance_test_settings_boolean; =20 static auto_boolean maintenance_test_settings_auto_boolean =3D AUTO_BOOLEA= N_AUTO; =20 diff --git a/gdb/maint.c b/gdb/maint.c index 1a621a17191..b8eb93827c8 100644 --- a/gdb/maint.c +++ b/gdb/maint.c @@ -770,7 +770,7 @@ maintenance_with_cmd_completer (struct cmd_list_element= *ignore, =20 /* Profiling support. */ =20 -static int maintenance_profile_p; +static bool maintenance_profile_p; static void show_maintenance_profile_p (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) @@ -841,17 +841,17 @@ maintenance_set_profile_cmd (const char *args, int fr= om_tty, } #endif =0C -/* If nonzero, display time usage both at startup and for each command. */ +/* If true, display time usage both at startup and for each command. */ =20 -static int per_command_time; +static bool per_command_time; =20 -/* If nonzero, display space usage both at startup and for each command. = */ +/* If true, display space usage both at startup and for each command. */ =20 -static int per_command_space; +static bool per_command_space; =20 -/* If nonzero, display basic symtab stats for each command. */ +/* If true, display basic symtab stats for each command. */ =20 -static int per_command_symtab; +static bool per_command_symtab; =20 /* mt per-command commands. */ =20 diff --git a/gdb/memattr.c b/gdb/memattr.c index e695f6e07e7..0475780b29f 100644 --- a/gdb/memattr.c +++ b/gdb/memattr.c @@ -53,7 +53,7 @@ static bool target_mem_regions_valid; /* If this flag is set, gdb will assume that memory ranges not specified by the memory map have type MEM_NONE, and will emit errors on all accesses to that memory. */ -static int inaccessible_by_default =3D 1; +static bool inaccessible_by_default =3D true; =20 static void show_inaccessible_by_default (struct ui_file *file, int from_tty, diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index 5dc436bfd8c..8a6795e5171 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -105,7 +105,7 @@ static int mi_async =3D 0; =20 /* The set command writes to this variable. If the inferior is executing, mi_async is *not* updated. */ -static int mi_async_1 =3D 0; +static bool mi_async_1 =3D false; =20 static void set_mi_async_command (const char *args, int from_tty, diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 3fb53bc76da..37a1b2a0b8f 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -858,7 +858,7 @@ static int heuristic_fence_post =3D 0; register N. NOTE: This defines the pseudo register type so need to rebuild the architecture vector. */ =20 -static int mips64_transfers_32bit_regs_p =3D 0; +static bool mips64_transfers_32bit_regs_p =3D false; =20 static void set_mips64_transfers_32bit_regs (const char *args, int from_tty, diff --git a/gdb/nat/fork-inferior.h b/gdb/nat/fork-inferior.h index 1d0519fb26c..065496c3827 100644 --- a/gdb/nat/fork-inferior.h +++ b/gdb/nat/fork-inferior.h @@ -72,7 +72,7 @@ extern ptid_t startup_inferior (pid_t pid, int ntraps, =20 The catch-exec traps expected during start-up will be one more if the target is started up with a shell. */ -extern int startup_with_shell; +extern bool startup_with_shell; =20 /* Perform any necessary tasks before a fork/vfork takes place. ARGS is a string containing all the arguments received by the inferior. diff --git a/gdb/nat/linux-namespaces.c b/gdb/nat/linux-namespaces.c index e49bc1ade36..8cadea9be26 100644 --- a/gdb/nat/linux-namespaces.c +++ b/gdb/nat/linux-namespaces.c @@ -31,7 +31,7 @@ #include "gdbsupport/scope-exit.h" =20 /* See nat/linux-namespaces.h. */ -int debug_linux_namespaces; +bool debug_linux_namespaces; =20 /* Handle systems without fork. */ =20 diff --git a/gdb/nat/linux-namespaces.h b/gdb/nat/linux-namespaces.h index 166b11cbdca..fe7e8a452ee 100644 --- a/gdb/nat/linux-namespaces.h +++ b/gdb/nat/linux-namespaces.h @@ -20,9 +20,9 @@ #ifndef NAT_LINUX_NAMESPACES_H #define NAT_LINUX_NAMESPACES_H =20 -/* Set to nonzero to enable debugging of Linux namespaces code. */ +/* Set to true to enable debugging of Linux namespaces code. */ =20 -extern int debug_linux_namespaces; +extern bool debug_linux_namespaces; =20 /* Enumeration of Linux namespace types. */ =20 diff --git a/gdb/nios2-tdep.c b/gdb/nios2-tdep.c index 8d685d4acaa..cb17e4f3750 100644 --- a/gdb/nios2-tdep.c +++ b/gdb/nios2-tdep.c @@ -52,7 +52,7 @@ =20 /* Control debugging information emitted in this file. */ =20 -static int nios2_debug =3D 0; +static bool nios2_debug =3D false; =20 /* The following structures are used in the cache for prologue analysis; see the reg_value and reg_saved tables in diff --git a/gdb/or1k-tdep.c b/gdb/or1k-tdep.c index 8f6f6e19609..6a6dce15273 100644 --- a/gdb/or1k-tdep.c +++ b/gdb/or1k-tdep.c @@ -50,7 +50,7 @@ =20 /* Global debug flag. */ =20 -static int or1k_debug =3D 0; +static bool or1k_debug =3D false; =20 static void show_or1k_debug (struct ui_file *file, int from_tty, diff --git a/gdb/parse.c b/gdb/parse.c index a1ab75297a1..1035a8cc2d0 100644 --- a/gdb/parse.c +++ b/gdb/parse.c @@ -75,7 +75,7 @@ show_expressiondebug (struct ui_file *file, int from_tty, =20 =20 /* Non-zero if an expression parser should set yydebug. */ -int parser_debug; +bool parser_debug; =20 static void show_parserdebug (struct ui_file *file, int from_tty, diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h index 33670b29c4c..64aa9b8b1e0 100644 --- a/gdb/parser-defs.h +++ b/gdb/parser-defs.h @@ -32,7 +32,7 @@ struct language_defn; struct internalvar; class innermost_block_tracker; =20 -extern int parser_debug; +extern bool parser_debug; =20 /* A class that can be used to build a "struct expression". */ =20 diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 22356bfd6db..1385cd1a4ff 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -100,7 +100,7 @@ show_max_symbolic_offset (struct ui_file *file, int fro= m_tty, =20 /* Append the source filename and linenumber of the symbol when printing a symbolic value as `' if set. */ -static int print_symbol_filename =3D 0; +static bool print_symbol_filename =3D 0; static void show_print_symbol_filename (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) diff --git a/gdb/python/py-auto-load.c b/gdb/python/py-auto-load.c index c7b9afdb112..ade2aa1b377 100644 --- a/gdb/python/py-auto-load.c +++ b/gdb/python/py-auto-load.c @@ -29,7 +29,7 @@ set auto-load python-scripts on|off This is true if we should auto-load associated Python scripts when an objfile is opened, false otherwise. */ -static int auto_load_python_scripts =3D 1; +static bool auto_load_python_scripts =3D true; =20 /* "show" command for the auto_load_python_scripts configuration variable.= */ =20 diff --git a/gdb/python/py-param.c b/gdb/python/py-param.c index afeff581ee4..4794366583a 100644 --- a/gdb/python/py-param.c +++ b/gdb/python/py-param.c @@ -55,7 +55,10 @@ struct parm_constant parm_constants[] =3D /* A union that can hold anything described by enum var_types. */ union parmpy_variable { - /* Hold an integer value, for boolean and integer types. */ + /* Hold a boolean value. */ + bool boolval; + + /* Hold an integer value. */ int intval; =20 /* Hold an auto_boolean. */ @@ -198,7 +201,7 @@ set_parameter_value (parmpy_object *self, PyObject *val= ue) cmp =3D PyObject_IsTrue (value); if (cmp < 0) return -1; - self->value.intval =3D cmp; + self->value.boolval =3D cmp; break; =20 case var_auto_boolean: @@ -475,7 +478,7 @@ add_setshow_generic (int parmclass, enum command_class = cmdclass, case var_boolean: =20 add_setshow_boolean_cmd (cmd_name, cmdclass, - &self->value.intval, set_doc, show_doc, + &self->value.boolval, set_doc, show_doc, help_doc, get_set_value, get_show_value, set_list, show_list); =20 diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c index ede4c0e759a..1428b7abe5c 100644 --- a/gdb/python/py-value.c +++ b/gdb/python/py-value.c @@ -580,7 +580,7 @@ valpy_string (PyObject *self, PyObject *args, PyObject = *kw) encoding, errors); } =20 -/* Given a Python object, copy its truth value to a C int (the value +/* Given a Python object, copy its truth value to a C bool (the value pointed by dest). If src_obj is NULL, then *dest is not modified. =20 @@ -588,7 +588,7 @@ valpy_string (PyObject *self, PyObject *args, PyObject = *kw) in case of error. */ =20 static bool -copy_py_bool_obj (int *dest, PyObject *src_obj) +copy_py_bool_obj (bool *dest, PyObject *src_obj) { if (src_obj) { diff --git a/gdb/python/python.c b/gdb/python/python.c index 9c8c635f72b..ddf0e72d26f 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -441,7 +441,7 @@ gdbpy_parameter_value (enum var_types type, void *var) =20 case var_boolean: { - if (* (int *) var) + if (* (bool *) var) Py_RETURN_TRUE; else Py_RETURN_FALSE; diff --git a/gdb/ravenscar-thread.c b/gdb/ravenscar-thread.c index f217d949f61..0cc7e1dc75a 100644 --- a/gdb/ravenscar-thread.c +++ b/gdb/ravenscar-thread.c @@ -57,8 +57,8 @@ is running, switching to its corresponding ptid, and then performing the operation on that ptid using the target beneath us. */ =20 -/* If non-null, ravenscar task support is enabled. */ -static int ravenscar_task_support =3D 1; +/* If true, ravenscar task support is enabled. */ +static bool ravenscar_task_support =3D true; =20 static const char running_thread_name[] =3D "__gnat_running_thread_table"; =20 diff --git a/gdb/record-full.c b/gdb/record-full.c index e83ce01b715..c1d124f5192 100644 --- a/gdb/record-full.c +++ b/gdb/record-full.c @@ -159,7 +159,7 @@ struct record_full_entry =20 /* If true, query if PREC cannot record memory change of next instruction. */ -int record_full_memory_query =3D 0; +bool record_full_memory_query =3D false; =20 struct record_full_core_buf_entry { @@ -196,8 +196,8 @@ static struct record_full_entry *record_full_list =3D &= record_full_first; static struct record_full_entry *record_full_arch_list_head =3D NULL; static struct record_full_entry *record_full_arch_list_tail =3D NULL; =20 -/* 1 ask user. 0 auto delete the last struct record_full_entry. */ -static int record_full_stop_at_limit =3D 1; +/* true ask user. false auto delete the last struct record_full_entry. */ +static bool record_full_stop_at_limit =3D true; /* Maximum allowed number of insns in execution log. */ static unsigned int record_full_insn_max_num =3D DEFAULT_RECORD_FULL_INSN_MAX_NUM; diff --git a/gdb/record-full.h b/gdb/record-full.h index 8d1693af11d..d1eff9760e2 100644 --- a/gdb/record-full.h +++ b/gdb/record-full.h @@ -20,7 +20,7 @@ #ifndef RECORD_FULL_H #define RECORD_FULL_H =20 -extern int record_full_memory_query; +extern bool record_full_memory_query; =20 extern int record_full_arch_list_add_reg (struct regcache *regcache, int n= um); extern int record_full_arch_list_add_mem (CORE_ADDR addr, int len); diff --git a/gdb/remote-notif.c b/gdb/remote-notif.c index 2680618b3fa..bf62537d0b4 100644 --- a/gdb/remote-notif.c +++ b/gdb/remote-notif.c @@ -41,7 +41,7 @@ #include "infrun.h" #include "gdbcmd.h" =20 -int notif_debug =3D 0; +bool notif_debug =3D 0; =20 /* Supported clients of notifications. */ =20 diff --git a/gdb/remote-notif.h b/gdb/remote-notif.h index f9b0b2c6180..c735cc2918a 100644 --- a/gdb/remote-notif.h +++ b/gdb/remote-notif.h @@ -129,6 +129,6 @@ remote_notif_state *remote_notif_state_allocate (remote= _target *remote); =20 extern struct notif_client notif_client_stop; =20 -extern int notif_debug; +extern bool notif_debug; =20 #endif /* REMOTE_NOTIF_H */ diff --git a/gdb/remote.c b/gdb/remote.c index ae06c4ba791..e39366d8b20 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -1038,7 +1038,7 @@ static struct cmd_list_element *remote_show_cmdlist; =20 /* Controls whether GDB is willing to use range stepping. */ =20 -static int use_range_stepping =3D 1; +static bool use_range_stepping =3D true; =20 /* The max number of chars in debug output. The rest of chars are omitted. */ @@ -1492,12 +1492,12 @@ show_interrupt_sequence (struct ui_file *file, int = from_tty, to the remote target when gdb connects to it. This is mostly needed when you debug the Linux kernel: The Linux kernel expects BREAK g which is Magic SysRq g for connecting gdb. */ -static int interrupt_on_connect =3D 0; +static bool interrupt_on_connect =3D false; =20 /* This variable is used to implement the "set/show remotebreak" commands. Since these commands are now deprecated in favor of "set/show remote interrupt-sequence", it no longer has any effect on the code. */ -static int remote_break; +static bool remote_break; =20 static void set_remotebreak (const char *args, int from_tty, struct cmd_list_element *= c) diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c index 7498319cc41..079f24828e9 100644 --- a/gdb/ser-tcp.c +++ b/gdb/ser-tcp.c @@ -72,7 +72,7 @@ static struct cmd_list_element *tcp_show_cmdlist; =20 /* Whether to auto-retry refused connections. */ =20 -static int tcp_auto_retry =3D 1; +static bool tcp_auto_retry =3D true; =20 /* Timeout period for connections, in seconds. */ =20 diff --git a/gdb/ser-unix.c b/gdb/ser-unix.c index 049dfd5261f..c49bd84eb63 100644 --- a/gdb/ser-unix.c +++ b/gdb/ser-unix.c @@ -41,7 +41,7 @@ struct hardwire_ttystate =20 #ifdef CRTSCTS /* Boolean to explicitly enable or disable h/w flow control. */ -static int serial_hwflow; +static bool serial_hwflow; static void show_serial_hwflow (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) diff --git a/gdb/skip.c b/gdb/skip.c index 5258f50ab1f..a549aca897c 100644 --- a/gdb/skip.c +++ b/gdb/skip.c @@ -39,7 +39,7 @@ =20 /* True if we want to print debug printouts related to file/function skipping. */ -static int debug_skip =3D 0; +static bool debug_skip =3D false; =20 class skiplist_entry { diff --git a/gdb/solib-aix.c b/gdb/solib-aix.c index 0c8a18267c9..1a25a0d4a93 100644 --- a/gdb/solib-aix.c +++ b/gdb/solib-aix.c @@ -30,7 +30,7 @@ =20 /* Variable controlling the output of the debugging traces for this module. */ -static int solib_aix_debug; +static bool solib_aix_debug; =20 /* Our private data in struct so_list. */ =20 diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c index ddaee54b306..d01f3af3009 100644 --- a/gdb/spu-tdep.c +++ b/gdb/spu-tdep.c @@ -52,9 +52,9 @@ static struct cmd_list_element *setspucmdlist =3D NULL; static struct cmd_list_element *showspucmdlist =3D NULL; =20 /* Whether to stop for new SPE contexts. */ -static int spu_stop_on_load_p =3D 0; +static bool spu_stop_on_load_p =3D false; /* Whether to automatically flush the SW-managed cache. */ -static int spu_auto_flush_cache_p =3D 1; +static bool spu_auto_flush_cache_p =3D true; =20 =20 /* The tdep structure. */ diff --git a/gdb/stack.c b/gdb/stack.c index 10a88e99aba..0f7fbf5e6ef 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -183,9 +183,9 @@ pretty-printers for that value.") =20 struct backtrace_cmd_options { - int full =3D 0; - int no_filters =3D 0; - int hide =3D 0; + bool full =3D false; + bool no_filters =3D false; + bool hide =3D false; }; =20 using bt_flag_option_def @@ -2423,7 +2423,7 @@ print_frame_local_vars (struct frame_info *frame, =20 struct info_print_options { - int quiet =3D false; + bool quiet =3D false; char *type_regexp =3D nullptr; =20 ~info_print_options () diff --git a/gdb/symfile-debug.c b/gdb/symfile-debug.c index 9a5d0fa0a66..b2e3c0112a6 100644 --- a/gdb/symfile-debug.c +++ b/gdb/symfile-debug.c @@ -49,7 +49,7 @@ static const struct objfile_key symfile_debug_objfile_data_key; =20 /* If non-zero all calls to the symfile functions are logged. */ -static int debug_symfile =3D 0; +static bool debug_symfile =3D false; =20 /* Return non-zero if symfile debug logging is installed. */ =20 diff --git a/gdb/symfile.c b/gdb/symfile.c index 3cd514409b0..09896eaa158 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -151,7 +151,7 @@ static const char *print_symbol_loading =3D print_symbo= l_loading_full; library symbols are not loaded, commands like "info fun" will *not* report all the functions that are actually present. */ =20 -int auto_solib_add =3D 1; +bool auto_solib_add =3D 1; =0C =20 /* Return non-zero if symbol-loading messages should be printed. @@ -1273,7 +1273,7 @@ symbol_file_clear (int from_tty) =20 /* See symfile.h. */ =20 -int separate_debug_file_debug =3D 0; +bool separate_debug_file_debug =3D 0; =20 static int separate_debug_file_exists (const std::string &name, unsigned long crc, diff --git a/gdb/symfile.h b/gdb/symfile.h index 6fa6db4750e..43dd2a60f9f 100644 --- a/gdb/symfile.h +++ b/gdb/symfile.h @@ -449,7 +449,7 @@ extern section_addr_info library symbols are not loaded, commands like "info fun" will *not* report all the functions that are actually present. */ =20 -extern int auto_solib_add; +extern bool auto_solib_add; =20 /* From symfile.c */ =20 @@ -625,6 +625,6 @@ extern gdb_bfd_ref_ptr find_separate_debug_file_in_sect= ion (struct objfile *); =20 /* True if we are printing debug output about separate debug info files. = */ =20 -extern int separate_debug_file_debug; +extern bool separate_debug_file_debug; =20 #endif /* !defined(SYMFILE_H) */ diff --git a/gdb/symtab.c b/gdb/symtab.c index 4b528b4270a..e2edad4fb11 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -241,10 +241,10 @@ static unsigned int new_symbol_cache_size =3D DEFAULT= _SYMBOL_CACHE_SIZE; the original value from here. */ static unsigned int symbol_cache_size =3D DEFAULT_SYMBOL_CACHE_SIZE; =20 -/* Non-zero if a file may be known by two different basenames. +/* True if a file may be known by two different basenames. This is the uncommon case, and significantly slows down gdb. Default set to "off" to not slow down the common case. */ -int basenames_may_differ =3D 0; +bool basenames_may_differ =3D false; =20 /* Allow the user to configure the debugger behavior with respect to multiple-choice menus when more than one symbol matches during @@ -4131,10 +4131,10 @@ operator_chars (const char *p, const char **end) struct filename_partial_match_opts { /* Only match the directory name part. */ - int dirname =3D false; + bool dirname =3D false; =20 /* Only match the basename part. */ - int basename =3D false; + bool basename =3D false; }; =20 /* Data structure to maintain printing state for output_source_filename. = */ @@ -4912,8 +4912,8 @@ symtab_symbol_info (bool quiet, bool exclude_minsyms, =20 struct info_print_options { - int quiet =3D false; - int exclude_minsyms =3D false; + bool quiet =3D false; + bool exclude_minsyms =3D false; char *type_regexp =3D nullptr; =20 ~info_print_options () @@ -5010,7 +5010,7 @@ info_functions_command (const char *args, int from_tt= y) =20 struct info_types_options { - int quiet =3D false; + bool quiet =3D false; }; =20 /* The options used by the 'info types' command. */ diff --git a/gdb/symtab.h b/gdb/symtab.h index c54b8ee4b7a..d0465987749 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -544,7 +544,7 @@ extern const char *symbol_demangled_name =20 #define SYMBOL_PRINT_NAME(symbol) \ (demangle ? SYMBOL_NATURAL_NAME (symbol) : SYMBOL_LINKAGE_NAME (symbol)) -extern int demangle; +extern bool demangle; =20 /* Macro that returns the name to be used when sorting and searching symbo= ls. In C++, we search for the demangled form of a name, @@ -2064,7 +2064,7 @@ extern unsigned int symtab_create_debug; =20 extern unsigned int symbol_lookup_debug; =20 -extern int basenames_may_differ; +extern bool basenames_may_differ; =20 int compare_filenames_for_search (const char *filename, const char *search_name); diff --git a/gdb/target-dcache.c b/gdb/target-dcache.c index 98d5c1f83b6..c8a415512c5 100644 --- a/gdb/target-dcache.c +++ b/gdb/target-dcache.c @@ -77,7 +77,7 @@ target_dcache_get_or_init (void) } =20 /* The option sets this. */ -static int stack_cache_enabled_1 =3D 1; +static bool stack_cache_enabled_1 =3D true; /* And set_stack_cache updates this. The reason for the separation is so that we don't flush the cache for on->on transitions. */ @@ -114,7 +114,7 @@ stack_cache_enabled_p (void) =20 /* The option sets this. */ =20 -static int code_cache_enabled_1 =3D 1; +static bool code_cache_enabled_1 =3D true; =20 /* And set_code_cache updates this. The reason for the separation is so that we don't flush the cache for diff --git a/gdb/target.c b/gdb/target.c index a19a9bce133..58e14814613 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -131,7 +131,7 @@ static struct cmd_list_element *targetlist =3D NULL; /* Nonzero if we should trust readonly sections from the executable when reading memory. */ =20 -static int trust_readonly =3D 0; +static bool trust_readonly =3D false; =20 /* Nonzero if we should show true memory content including memory breakpoint inserted by gdb. */ @@ -2374,7 +2374,7 @@ target_require_runnable (void) =20 /* Whether GDB is allowed to fall back to the default run target for "run", "attach", etc. when no target is connected yet. */ -static int auto_connect_native_target =3D 1; +static bool auto_connect_native_target =3D true; =20 static void show_auto_connect_native_target (struct ui_file *file, int from_tty, @@ -3841,11 +3841,11 @@ target_thread_events (int enable) =20 /* Controls if targets can report that they can/are async. This is just for maintainers to use when debugging gdb. */ -int target_async_permitted =3D 1; +bool target_async_permitted =3D true; =20 /* The set command writes to this variable. If the inferior is executing, target_async_permitted is *not* updated. */ -static int target_async_permitted_1 =3D 1; +static bool target_async_permitted_1 =3D true; =20 static void maint_set_target_async_command (const char *args, int from_tty, @@ -3933,12 +3933,12 @@ maint_show_target_non_stop_command (struct ui_file = *file, int from_tty, =20 /* Temporary copies of permission settings. */ =20 -static int may_write_registers_1 =3D 1; -static int may_write_memory_1 =3D 1; -static int may_insert_breakpoints_1 =3D 1; -static int may_insert_tracepoints_1 =3D 1; -static int may_insert_fast_tracepoints_1 =3D 1; -static int may_stop_1 =3D 1; +static bool may_write_registers_1 =3D true; +static bool may_write_memory_1 =3D true; +static bool may_insert_breakpoints_1 =3D true; +static bool may_insert_tracepoints_1 =3D true; +static bool may_insert_fast_tracepoints_1 =3D true; +static bool may_stop_1 =3D true; =20 /* Make the user-set values match the real values again. */ =20 diff --git a/gdb/target.h b/gdb/target.h index 4e2e75cb806..6018bf90ef6 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -1802,7 +1802,7 @@ extern int target_has_execution_current (void); (current_top_target ()->get_thread_control_capabilities () & tc_schedloc= k) =20 /* Controls whether async mode is permitted. */ -extern int target_async_permitted; +extern bool target_async_permitted; =20 /* Can the target support asynchronous execution? */ #define target_can_async_p() (current_top_target ()->can_async_p ()) diff --git a/gdb/thread.c b/gdb/thread.c index 4a7fe689dbb..17bc642b84d 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -1204,7 +1204,7 @@ print_thread_info (struct ui_out *uiout, const char *= requested_threads, struct info_threads_opts { /* For "-gid". */ - int show_global_ids =3D 0; + bool show_global_ids =3D false; }; =20 static const gdb::option::option_def info_threads_option_defs[] =3D { @@ -1574,7 +1574,7 @@ static const gdb::option::option_def thr_qcs_flags_op= tion_defs[] =3D { ASCENDING and FLAGS as context. */ =20 static inline std::array -make_thread_apply_all_options_def_group (int *ascending, +make_thread_apply_all_options_def_group (bool *ascending, qcs_flags *flags) { return {{ @@ -1603,7 +1603,7 @@ make_thread_apply_options_def_group (qcs_flags *flags) static void thread_apply_all_command (const char *cmd, int from_tty) { - int ascending =3D false; + bool ascending =3D false; qcs_flags flags; =20 auto group =3D make_thread_apply_all_options_def_group (&ascending, @@ -1951,7 +1951,7 @@ thread_find_command (const char *arg, int from_tty) } =20 /* Print notices when new threads are attached and detached. */ -int print_thread_events =3D 1; +bool print_thread_events =3D true; static void show_print_thread_events (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) diff --git a/gdb/top.c b/gdb/top.c index 2b53640af06..9fc83fd3920 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -115,7 +115,7 @@ extern char lang_frame_mismatch_warn[]; /* language.c = */ /* Flag for whether we want to confirm potentially dangerous operations. Default is yes. */ =20 -int confirm =3D 1; +bool confirm =3D 1; =20 static void show_confirm (struct ui_file *file, int from_tty, @@ -850,15 +850,15 @@ gdb_readline_no_editing (const char *prompt) /* Variables which control command line editing and history substitution. These variables are given default values at the end of this file. */ -static int command_editing_p; +static bool command_editing_p; =20 /* NOTE 1999-04-29: This variable will be static again, once we modify gdb to use the event loop as the default command loop and we merge event-top.c into this file, top.c. */ =20 -/* static */ int history_expansion_p; +/* static */ bool history_expansion_p; =20 -static int write_history_p; +static bool write_history_p; static void show_write_history_p (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) @@ -1876,7 +1876,7 @@ show_history (const char *args, int from_tty) cmd_show_list (showhistlist, from_tty, ""); } =20 -int info_verbose =3D 0; /* Default verbose msgs off. */ +bool info_verbose =3D false; /* Default verbose msgs off. */ =20 /* Called by do_set_command. An elaborate joke. */ void diff --git a/gdb/top.h b/gdb/top.h index 32a898b82f5..176104f1fd1 100644 --- a/gdb/top.h +++ b/gdb/top.h @@ -217,7 +217,7 @@ extern void ui_register_input_event_handler (struct ui = *ui); extern void ui_unregister_input_event_handler (struct ui *ui); =20 /* From top.c. */ -extern int confirm; +extern bool confirm; extern int inhibit_gdbinit; =20 /* Print the GDB version banner to STREAM. If INTERACTIVE is false, @@ -280,7 +280,7 @@ extern void gdb_init (char *); /* Variables from top.c. */ extern int source_line_number; extern std::string source_file_name; -extern int history_expansion_p; +extern bool history_expansion_p; extern int server_command; extern char *lim_at_start; =20 diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 2d5b9c705ef..436cb21f5df 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -131,12 +131,12 @@ static struct cmd_list_element *tfindlist; /* List of expressions to collect by default at each tracepoint hit. */ char *default_collect; =20 -static int disconnected_tracing; +static bool disconnected_tracing; =20 /* This variable controls whether we ask the target for a linear or circular trace buffer. */ =20 -static int circular_trace_buffer; +static bool circular_trace_buffer =3D false; =20 /* This variable is the requested trace buffer size, or -1 to indicate that we don't care and leave it up to the target to set a size. */ diff --git a/gdb/typeprint.c b/gdb/typeprint.c index c87f6d13e02..41d95c2afb2 100644 --- a/gdb/typeprint.c +++ b/gdb/typeprint.c @@ -727,7 +727,7 @@ show_print_type (const char *args, int from_tty) cmd_show_list (showprinttypelist, from_tty, ""); } =20 -static int print_methods =3D 1; +static bool print_methods =3D true; =20 static void set_print_type_methods (const char *args, @@ -744,7 +744,7 @@ show_print_type_methods (struct ui_file *file, int from= _tty, value); } =20 -static int print_typedefs =3D 1; +static bool print_typedefs =3D true; =20 static void set_print_type_typedefs (const char *args, diff --git a/gdb/utils.c b/gdb/utils.c index f642cf470f4..2c0b515ee6e 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -99,13 +99,13 @@ static std::chrono::steady_clock::duration prompt_for_c= ontinue_wait_time; =20 /* A flag indicating whether to timestamp debugging messages. */ =20 -static int debug_timestamp =3D 0; +static bool debug_timestamp =3D false; =20 /* Nonzero means that strings with character values >0x7F should be printed as octal escapes. Zero means just print the value (e.g. it's an international character, and the terminal or window can cope.) */ =20 -int sevenbit_strings =3D 0; +bool sevenbit_strings =3D false; static void show_sevenbit_strings (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) @@ -119,7 +119,7 @@ show_sevenbit_strings (struct ui_file *file, int from_t= ty, =20 const char *warning_pre_print =3D "\nwarning: "; =20 -int pagination_enabled =3D 1; +bool pagination_enabled =3D true; static void show_pagination_enabled (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) diff --git a/gdb/utils.h b/gdb/utils.h index fd724444aa0..7cdc73ef54f 100644 --- a/gdb/utils.h +++ b/gdb/utils.h @@ -32,7 +32,7 @@ extern void initialize_utils (void); =20 /* String utilities. */ =20 -extern int sevenbit_strings; +extern bool sevenbit_strings; =20 /* Modes of operation for strncmp_iw_with_mode. */ =20 @@ -316,7 +316,7 @@ extern void wrap_here (const char *); =20 extern void reinitialize_more_filter (void); =20 -extern int pagination_enabled; +extern bool pagination_enabled; =20 extern struct ui_file **current_ui_gdb_stdout_ptr (void); extern struct ui_file **current_ui_gdb_stdin_ptr (void); diff --git a/gdb/valops.c b/gdb/valops.c index 0f6ff7b0a57..1aea5c55515 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -97,7 +97,7 @@ static CORE_ADDR allocate_space_in_inferior (int); =20 static struct value *cast_into_complex (struct type *, struct value *); =20 -int overload_resolution =3D 0; +bool overload_resolution =3D 0; static void show_overload_resolution (struct ui_file *file, int from_tty, struct cmd_list_element *c,=20 diff --git a/gdb/valprint.h b/gdb/valprint.h index 07014c11b9f..78a738a832a 100644 --- a/gdb/valprint.h +++ b/gdb/valprint.h @@ -30,23 +30,23 @@ struct value_print_options enum val_prettyformat prettyformat; =20 /* Controls pretty formatting of arrays. */ - int prettyformat_arrays; + bool prettyformat_arrays; =20 /* Controls pretty formatting of structures. */ - int prettyformat_structs; + bool prettyformat_structs; =20 /* Controls printing of virtual tables. */ - int vtblprint; + bool vtblprint; =20 /* Controls printing of nested unions. */ - int unionprint; + bool unionprint; =20 /* Controls printing of addresses. */ - int addressprint; + bool addressprint; =20 /* Controls looking up an object's derived type using what we find in its vtables. */ - int objectprint; + bool objectprint; =20 /* Maximum number of chars to print for a string pointer value or vector contents, or UINT_MAX for no limit. Note that "set print elements 0" @@ -66,40 +66,40 @@ struct value_print_options int format; =20 /* Stop printing at null character? */ - int stop_print_at_null; + bool stop_print_at_null; =20 /* True if we should print the index of each element when printing an array. */ - int print_array_indexes; + bool print_array_indexes; =20 - /* If nonzero, then dereference references, otherwise just print + /* If true, then dereference references, otherwise just print them like pointers. */ - int deref_ref; + bool deref_ref; =20 /* If nonzero, print static fields. */ - int static_field_print; + bool static_field_print; =20 /* If nonzero, print static fields for Pascal. FIXME: C++ has a flag, why not share with Pascal too? */ - int pascal_static_field_print; + bool pascal_static_field_print; =20 /* If non-zero don't do Python pretty-printing. */ - int raw; + bool raw; =20 /* If nonzero, print the value in "summary" form. If raw and summary are both non-zero, don't print non-scalar values ("..." is printed instead). */ - int summary; + bool summary; =20 /* If nonzero, when printing a pointer, print the symbol to which it points, if any. */ - int symbol_print; + bool symbol_print; =20 /* Maximum print depth when printing nested aggregates. */ int max_depth; =20 /* Whether "finish" should print the value. */ - int finish_print; + bool finish_print; }; =20 /* Create an option_def_group for the value_print options, with OPTS diff --git a/gdb/windows-tdep.c b/gdb/windows-tdep.c index 42083e789a5..bb69a79996a 100644 --- a/gdb/windows-tdep.c +++ b/gdb/windows-tdep.c @@ -100,7 +100,7 @@ static const int MAX_TIB64 =3D sizeof (thread_information_64) / sizeof (uint64_t); static const int FULL_TIB_SIZE =3D 0x1000; =20 -static int maint_display_all_tib =3D 0; +static bool maint_display_all_tib =3D false; =20 /* Define Thread Local Base pointer type. */ =20 diff --git a/gdb/xml-support.c b/gdb/xml-support.c index 8b79d69a6d5..eaf99efa6b9 100644 --- a/gdb/xml-support.c +++ b/gdb/xml-support.c @@ -26,7 +26,7 @@ #include =20 /* Debugging flag. */ -static int debug_xml; +static bool debug_xml; =20 /* The contents of this file are only useful if XML support is available. */ --=20 2.23.0.237.gc6a4ce50a0-goog