aboutsummaryrefslogtreecommitdiff
path: root/gdb/infrun.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r--gdb/infrun.c67
1 files changed, 28 insertions, 39 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 5e4cd51..d6723fd 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -66,6 +66,7 @@
#include "common/enum-flags.h"
#include "progspace-and-thread.h"
#include "common/gdb_optional.h"
+#include "arch-utils.h"
/* Prototypes for local functions */
@@ -6787,7 +6788,7 @@ process_event_stop_test (struct execution_control_state *ecs)
tmp_sal = find_pc_line (ecs->stop_func_start, 0);
if (tmp_sal.line != 0
&& !function_name_is_marked_for_skip (ecs->stop_func_name,
- &tmp_sal))
+ tmp_sal))
{
if (execution_direction == EXEC_REVERSE)
handle_step_into_function_backward (gdbarch, ecs);
@@ -7317,8 +7318,8 @@ handle_step_into_function (struct gdbarch *gdbarch,
cust = find_pc_compunit_symtab (stop_pc);
if (cust != NULL && compunit_language (cust) != language_asm)
- ecs->stop_func_start = gdbarch_skip_prologue (gdbarch,
- ecs->stop_func_start);
+ ecs->stop_func_start
+ = gdbarch_skip_prologue_noexcept (gdbarch, ecs->stop_func_start);
stop_func_sal = find_pc_line (ecs->stop_func_start, 0);
/* Use the step_resume_break to step until the end of the prologue,
@@ -7396,8 +7397,8 @@ handle_step_into_function_backward (struct gdbarch *gdbarch,
cust = find_pc_compunit_symtab (stop_pc);
if (cust != NULL && compunit_language (cust) != language_asm)
- ecs->stop_func_start = gdbarch_skip_prologue (gdbarch,
- ecs->stop_func_start);
+ ecs->stop_func_start
+ = gdbarch_skip_prologue_noexcept (gdbarch, ecs->stop_func_start);
stop_func_sal = find_pc_line (stop_pc, 0);
@@ -8511,14 +8512,12 @@ sig_print_info (enum gdb_signal oursig)
static void
handle_command (char *args, int from_tty)
{
- char **argv;
int digits, wordlen;
int sigfirst, signum, siglast;
enum gdb_signal oursig;
int allsigs;
int nsigs;
unsigned char *sigs;
- struct cleanup *old_chain;
if (args == NULL)
{
@@ -8533,24 +8532,23 @@ handle_command (char *args, int from_tty)
/* Break the command line up into args. */
- argv = gdb_buildargv (args);
- old_chain = make_cleanup_freeargv (argv);
+ gdb_argv built_argv (args);
/* Walk through the args, looking for signal oursigs, signal names, and
actions. Signal numbers and signal names may be interspersed with
actions, with the actions being performed for all signals cumulatively
specified. Signal ranges can be specified as <LOW>-<HIGH>. */
- while (*argv != NULL)
+ for (char *arg : built_argv)
{
- wordlen = strlen (*argv);
- for (digits = 0; isdigit ((*argv)[digits]); digits++)
+ wordlen = strlen (arg);
+ for (digits = 0; isdigit (arg[digits]); digits++)
{;
}
allsigs = 0;
sigfirst = siglast = -1;
- if (wordlen >= 1 && !strncmp (*argv, "all", wordlen))
+ if (wordlen >= 1 && !strncmp (arg, "all", wordlen))
{
/* Apply action to all signals except those used by the
debugger. Silently skip those. */
@@ -8558,37 +8556,37 @@ handle_command (char *args, int from_tty)
sigfirst = 0;
siglast = nsigs - 1;
}
- else if (wordlen >= 1 && !strncmp (*argv, "stop", wordlen))
+ else if (wordlen >= 1 && !strncmp (arg, "stop", wordlen))
{
SET_SIGS (nsigs, sigs, signal_stop);
SET_SIGS (nsigs, sigs, signal_print);
}
- else if (wordlen >= 1 && !strncmp (*argv, "ignore", wordlen))
+ else if (wordlen >= 1 && !strncmp (arg, "ignore", wordlen))
{
UNSET_SIGS (nsigs, sigs, signal_program);
}
- else if (wordlen >= 2 && !strncmp (*argv, "print", wordlen))
+ else if (wordlen >= 2 && !strncmp (arg, "print", wordlen))
{
SET_SIGS (nsigs, sigs, signal_print);
}
- else if (wordlen >= 2 && !strncmp (*argv, "pass", wordlen))
+ else if (wordlen >= 2 && !strncmp (arg, "pass", wordlen))
{
SET_SIGS (nsigs, sigs, signal_program);
}
- else if (wordlen >= 3 && !strncmp (*argv, "nostop", wordlen))
+ else if (wordlen >= 3 && !strncmp (arg, "nostop", wordlen))
{
UNSET_SIGS (nsigs, sigs, signal_stop);
}
- else if (wordlen >= 3 && !strncmp (*argv, "noignore", wordlen))
+ else if (wordlen >= 3 && !strncmp (arg, "noignore", wordlen))
{
SET_SIGS (nsigs, sigs, signal_program);
}
- else if (wordlen >= 4 && !strncmp (*argv, "noprint", wordlen))
+ else if (wordlen >= 4 && !strncmp (arg, "noprint", wordlen))
{
UNSET_SIGS (nsigs, sigs, signal_print);
UNSET_SIGS (nsigs, sigs, signal_stop);
}
- else if (wordlen >= 4 && !strncmp (*argv, "nopass", wordlen))
+ else if (wordlen >= 4 && !strncmp (arg, "nopass", wordlen))
{
UNSET_SIGS (nsigs, sigs, signal_program);
}
@@ -8601,11 +8599,11 @@ handle_command (char *args, int from_tty)
SIGHUP, SIGINT, SIGALRM, etc. will work right anyway. */
sigfirst = siglast = (int)
- gdb_signal_from_command (atoi (*argv));
- if ((*argv)[digits] == '-')
+ gdb_signal_from_command (atoi (arg));
+ if (arg[digits] == '-')
{
siglast = (int)
- gdb_signal_from_command (atoi ((*argv) + digits + 1));
+ gdb_signal_from_command (atoi (arg + digits + 1));
}
if (sigfirst > siglast)
{
@@ -8617,7 +8615,7 @@ handle_command (char *args, int from_tty)
}
else
{
- oursig = gdb_signal_from_name (*argv);
+ oursig = gdb_signal_from_name (arg);
if (oursig != GDB_SIGNAL_UNKNOWN)
{
sigfirst = siglast = (int) oursig;
@@ -8625,7 +8623,7 @@ handle_command (char *args, int from_tty)
else
{
/* Not a number and not a recognized flag word => complain. */
- error (_("Unrecognized or ambiguous flag word: \"%s\"."), *argv);
+ error (_("Unrecognized or ambiguous flag word: \"%s\"."), arg);
}
}
@@ -8663,8 +8661,6 @@ Are you sure you want to change it? "),
break;
}
}
-
- argv++;
}
for (signum = 0; signum < nsigs; signum++)
@@ -8685,17 +8681,15 @@ Are you sure you want to change it? "),
break;
}
-
- do_cleanups (old_chain);
}
/* Complete the "handle" command. */
-static VEC (char_ptr) *
+static void
handle_completer (struct cmd_list_element *ignore,
+ completion_tracker &tracker,
const char *text, const char *word)
{
- VEC (char_ptr) *vec_signals, *vec_keywords, *return_val;
static const char * const keywords[] =
{
"all",
@@ -8710,13 +8704,8 @@ handle_completer (struct cmd_list_element *ignore,
NULL,
};
- vec_signals = signal_completer (ignore, text, word);
- vec_keywords = complete_on_enum (keywords, word, word);
-
- return_val = VEC_merge (char_ptr, vec_signals, vec_keywords);
- VEC_free (char_ptr, vec_signals);
- VEC_free (char_ptr, vec_keywords);
- return return_val;
+ signal_completer (ignore, tracker, text, word);
+ complete_on_enum (tracker, keywords, word, word);
}
enum gdb_signal