diff options
Diffstat (limited to 'gdb/utils.c')
-rw-r--r-- | gdb/utils.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/gdb/utils.c b/gdb/utils.c index ae6fb59..0009cb1 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -280,16 +280,29 @@ static const char *const internal_problem_modes[] = NULL }; -/* Print a message reporting an internal error/warning. Ask the user - if they want to continue, dump core, or just exit. Return - something to indicate a quit. */ +/* Data structure used to control how the internal_vproblem function + should behave. An instance of this structure is created for each + problem type that GDB supports. */ 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; - 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; - 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; }; @@ -435,7 +448,7 @@ internal_vproblem (struct internal_problem *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 @@ -446,7 +459,7 @@ internal_verror (const char *file, int line, const char *fmt, va_list ap) } 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 @@ -456,7 +469,7 @@ internal_vwarning (const char *file, int line, const char *fmt, va_list ap) } 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 |