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).
+2000-11-10 Christopher Faylor <cgf@cygnus.com>
+
+ * 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.
+
+2000-11-10 Stephane Carrez <Stephane.Carrez@sun.com>
+
+ * 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).
+
2000-11-10 J.T. Conklin <jtc@redback.com>
* target.c (do_xfer_memory): Only perform a single memory transfer
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
/* 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);
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,
/* 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 =
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 ();
extern void proceed (CORE_ADDR, enum target_signal, int);
+/* 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 void kill_inferior (void);
extern void generic_mourn_inferior (void);
/* 1 means step over all subroutine calls.
-1 means step over calls to undebuggable functions. */
-extern int step_over_calls;
+enum step_over_calls_kind
+ {
+ STEP_OVER_NONE,
+ STEP_OVER_ALL,
+ STEP_OVER_UNDEBUGGABLE,
+ } step_over_calls;
/* If stepping, nonzero means step count is > 1
so don't print frame next time inferior stops
int inferior_ignoring_startup_exec_events = 0;
int inferior_ignoring_leading_exec_events = 0;
+/* 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 = 0;
+
/* In asynchronous mode, but simulating synchronous execution. */
int sync_execution = 0;
step_range_start = 0;
step_range_end = 0;
step_frame_address = 0;
- step_over_calls = -1;
+ step_over_calls = STEP_OVER_UNDEBUGGABLE;
stop_after_trap = 0;
stop_soon_quietly = 0;
proceed_to_finish = 0;
loader dynamic symbol resolution code, we keep on single stepping
until we exit the run time loader code and reach the callee's
address. */
- if (step_over_calls < 0 && IN_SOLIB_DYNSYM_RESOLVE_CODE (stop_pc))
+ if (step_over_calls == STEP_OVER_UNDEBUGGABLE && IN_SOLIB_DYNSYM_RESOLVE_CODE (stop_pc))
{
CORE_ADDR pc_after_resolver = SKIP_SOLIB_RESOLVER (stop_pc);
{
/* It's a subroutine call. */
- if (step_over_calls == 0)
+ if (step_over_calls == STEP_OVER_NONE)
{
/* I presume that step_over_calls is only 0 when we're
supposed to be stepping at the assembly language level
return;
}
- if (step_over_calls > 0 || IGNORE_HELPER_CALL (stop_pc))
+ if (step_over_calls == STEP_OVER_ALL || IGNORE_HELPER_CALL (stop_pc))
{
/* We're doing a "next". */
return;
}
}
+
+ /* If we have no line number and the step-stop-if-no-debug
+ is set, we stop the step so that the user has a chance to
+ switch in assembly mode. */
+ if (step_over_calls == STEP_OVER_UNDEBUGGABLE && step_stop_if_no_debug)
+ {
+ stop_step = 1;
+ print_stop_reason (END_STEPPING_RANGE, 0);
+ stop_stepping (ecs);
+ return;
+ }
+
step_over_function (ecs);
keep_going (ecs);
return;
CORE_ADDR step_range_start;
CORE_ADDR step_range_end;
CORE_ADDR step_frame_address;
- int step_over_calls;
+ enum step_over_calls_kind step_over_calls;
CORE_ADDR step_resume_break_address;
int stop_after_trap;
int stop_soon_quietly;
c->function.sfunc = set_schedlock_func; /* traps on target vector */
add_show_from_set (c, &showlist);
+
+ c = add_set_cmd ("step-mode", class_run,
+ var_boolean, (char*) &step_stop_if_no_debug,
+"Set mode of the step operation. When set, doing a step over a\n\
+function without debug line information will stop at the first\n\
+instruction of that function. Otherwise, the function is skipped and\n\
+the step command stops at a different source line.",
+ &setlist);
+ add_show_from_set (c, &showlist);
}