summaryrefslogtreecommitdiff
path: root/gdb/infcmd.c
diff options
context:
space:
mode:
authorChristopher Faylor <me+cygwin@cgf.cx>2000-11-10 19:27:45 +0000
committerChristopher Faylor <me+cygwin@cgf.cx>2000-11-10 19:27:45 +0000
commitf8a784c923646eabe489c156606d948b2d96a88b (patch)
tree583009fbec5d9adf5971d534525c8352b64ac6bf /gdb/infcmd.c
parentcd50d4b67fec9c82efe34440a9f3bceb3dab35fa (diff)
downloadgdb-f8a784c923646eabe489c156606d948b2d96a88b.tar.gz
* inferior.h (step_over_calls_kind): New enum to clarify values in
step_over_calls. * infcmd.c (step_over_calls): Change definition. (step_1): Use new enum values in relation to step_over_calls. (step_once): Ditto. (until_next_command): Ditto. * infrun.c (clear_proceed_status): Ditto. (handle_inferior_event): Ditto. * inferior.h (step_stop_if_no_debug): New variable. * infrun.c (step_stop_if_no_debug): Declare. (handle_inferior_event): Stop the step command if we entered a function without line info. (_initialize_infrun): New command 'set step-mode' to control the step command. * infcmd.c (step_once): Switch to stepi mode if there is no line info (and switching is enabled).
Diffstat (limited to 'gdb/infcmd.c')
-rw-r--r--gdb/infcmd.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index d20cb432b55..343853abf3d 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -178,11 +178,7 @@ CORE_ADDR step_frame_address;
CORE_ADDR step_sp;
-/* 1 means step over all subroutine calls.
- 0 means don't step over calls (used by stepi).
- -1 means step over calls to undebuggable functions. */
-
-int step_over_calls;
+enum step_over_calls_kind step_over_calls;
/* If stepping, nonzero means step count is > 1
so don't print frame next time inferior stops
@@ -513,11 +509,11 @@ which has no line number information.\n", name);
/* It is stepi.
Don't step over function calls, not even to functions lacking
line numbers. */
- step_over_calls = 0;
+ step_over_calls = STEP_OVER_NONE;
}
if (skip_subroutines)
- step_over_calls = 1;
+ step_over_calls = STEP_OVER_ALL;
step_multi = (count > 1);
proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 1);
@@ -607,7 +603,13 @@ step_once (int skip_subroutines, int single_inst, int count)
if (!single_inst)
{
find_pc_line_pc_range (stop_pc, &step_range_start, &step_range_end);
- if (step_range_end == 0)
+
+ /* If we have no line info, switch to stepi mode. */
+ if (step_range_end == 0 && step_stop_if_no_debug)
+ {
+ step_range_start = step_range_end = 1;
+ }
+ else if (step_range_end == 0)
{
char *name;
if (find_pc_partial_function (stop_pc, &name, &step_range_start,
@@ -628,11 +630,11 @@ which has no line number information.\n", name);
/* It is stepi.
Don't step over function calls, not even to functions lacking
line numbers. */
- step_over_calls = 0;
+ step_over_calls = STEP_OVER_NONE;
}
if (skip_subroutines)
- step_over_calls = 1;
+ step_over_calls = STEP_OVER_ALL;
step_multi = (count > 1);
arg1 =
@@ -958,7 +960,7 @@ until_next_command (int from_tty)
step_range_end = sal.end;
}
- step_over_calls = 1;
+ step_over_calls = STEP_OVER_ALL;
step_frame_address = FRAME_FP (frame);
step_sp = read_sp ();