gdb: use bool instead of int in struct internal_problem

Change struct internal_problem (gdb/utils.c) to use bool instead of
int, update the 3 static instances of this structure that we create to
use true/false instead of 1/0.

I've also updated the comments on struct internal_problem as the
existing comment doesn't seem to be referring to the structure, it
talks about returning something, which doesn't make sense in this
context.

There should be no user visible changes after this commit.
This commit is contained in:
Andrew Burgess 2021-08-17 11:54:51 +01:00
parent 611841bb1a
commit 90f4cc60f1

View File

@ -280,16 +280,29 @@ static const char *const internal_problem_modes[] =
NULL NULL
}; };
/* Print a message reporting an internal error/warning. Ask the user /* Data structure used to control how the internal_vproblem function
if they want to continue, dump core, or just exit. Return should behave. An instance of this structure is created for each
something to indicate a quit. */ problem type that GDB supports. */
struct internal_problem struct internal_problem
{ {
/* The name of this problem type. This must not contain white space as
this string is used to build command names. */
const char *name; const char *name;
int user_settable_should_quit;
/* When this is true then a user command is created (based on NAME) that
allows the SHOULD_QUIT field to be modified, otherwise, SHOULD_QUIT
can't be changed from its default value by the user. */
bool user_settable_should_quit;
/* Reference a value from internal_problem_modes to indicate if GDB
should quit when it hits a problem of this type. */
const char *should_quit; const char *should_quit;
int user_settable_should_dump_core;
/* Like USER_SETTABLE_SHOULD_QUIT but for SHOULD_DUMP_CORE. */
bool user_settable_should_dump_core;
/* Like SHOULD_QUIT, but whether GDB should dump core. */
const char *should_dump_core; const char *should_dump_core;
}; };
@ -435,7 +448,7 @@ internal_vproblem (struct internal_problem *problem,
} }
static struct internal_problem internal_error_problem = { static struct internal_problem internal_error_problem = {
"internal-error", 1, internal_problem_ask, 1, internal_problem_ask "internal-error", true, internal_problem_ask, true, internal_problem_ask,
}; };
void void
@ -446,7 +459,7 @@ internal_verror (const char *file, int line, const char *fmt, va_list ap)
} }
static struct internal_problem internal_warning_problem = { static struct internal_problem internal_warning_problem = {
"internal-warning", 1, internal_problem_ask, 1, internal_problem_ask "internal-warning", true, internal_problem_ask, true, internal_problem_ask,
}; };
void void
@ -456,7 +469,7 @@ internal_vwarning (const char *file, int line, const char *fmt, va_list ap)
} }
static struct internal_problem demangler_warning_problem = { static struct internal_problem demangler_warning_problem = {
"demangler-warning", 1, internal_problem_ask, 0, internal_problem_no "demangler-warning", true, internal_problem_ask, false, internal_problem_no,
}; };
void void