This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] Simplify STEP_OVER_UNDEBUGGABLE
- From: Andrew Cagney <cagney at gnu dot org>
- To: gdb-patches at sources dot redhat dot com
- Date: Fri, 14 May 2004 14:42:51 -0400
- Subject: [commit] Simplify STEP_OVER_UNDEBUGGABLE
Hello,
The attached deletes all the irrelevant guff that was being executed
when determining how to STEP_OVER_UNDEBUGGABLE. See the bottom of the
patch for what's left.
committed,
Andrew
2004-05-14 Andrew Cagney <cagney@redhat.com>
* infrun.c (handle_inferior_event): Simplify
STEP_OVER_UNDEBUGGABLE.
2004-05-14 Andrew Cagney <cagney@redhat.com>
Index: infrun.c
===================================================================
RCS file: /cvs/src/src/gdb/infrun.c,v
retrieving revision 1.162
diff -p -c -r1.162 infrun.c
*** infrun.c 14 May 2004 15:49:00 -0000 1.162
--- infrun.c 14 May 2004 18:40:47 -0000
*************** process_event_stop_test:
*** 2353,2434 ****
inferior stopped). Since we want to skip this kind of code,
we keep going until the inferior returns from this
function. */
! /* NOTE: cagney/2004-05-12: This test is performed after the
! sigtramp test as often sigtramps, while recognized by GDB,
! have no symbol information. */
! CORE_ADDR real_stop_pc;
!
! if ((step_over_calls == STEP_OVER_NONE)
! || ((step_range_end == 1)
! && in_prologue (prev_pc, ecs->stop_func_start)))
{
! /* I presume that step_over_calls is only 0 when we're
! supposed to be stepping at the assembly language level
! ("stepi"). Just stop. */
! /* Also, maybe we just did a "nexti" inside a prolog, so we
! thought it was a subroutine call but it was not. Stop as
! well. FENN */
stop_step = 1;
print_stop_reason (END_STEPPING_RANGE, 0);
stop_stepping (ecs);
return;
}
!
! if (step_over_calls == STEP_OVER_ALL || IGNORE_HELPER_CALL (stop_pc))
{
! /* We're doing a "next", set a breakpoint at callee's return
! address (the address at which the caller will
! resume). */
insert_step_resume_breakpoint (get_prev_frame (get_current_frame ()),
ecs);
keep_going (ecs);
return;
}
-
- /* If we are in a function call trampoline (a stub between the
- calling routine and the real function), locate the real
- function. That's what tells us (a) whether we want to step
- into it at all, and (b) what prologue we want to run to the
- end of, if we do step into it. */
- real_stop_pc = skip_language_trampoline (stop_pc);
- if (real_stop_pc == 0)
- real_stop_pc = SKIP_TRAMPOLINE_CODE (stop_pc);
- if (real_stop_pc != 0)
- ecs->stop_func_start = real_stop_pc;
-
- /* If we have line number information for the function we are
- thinking of stepping into, step into it.
-
- If there are several symtabs at that PC (e.g. with include
- files), just want to know whether *any* of them have line
- numbers. find_pc_line handles this. */
- {
- struct symtab_and_line tmp_sal;
-
- tmp_sal = find_pc_line (ecs->stop_func_start, 0);
- if (tmp_sal.line != 0)
- {
- step_into_function (ecs);
- 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;
- }
-
- /* Set a breakpoint at callee's return address (the address at
- which the caller will resume). */
- insert_step_resume_breakpoint (get_prev_frame (get_current_frame ()), ecs);
- keep_going (ecs);
- return;
}
if (frame_id_eq (frame_unwind_id (get_current_frame ()),
--- 2353,2377 ----
inferior stopped). Since we want to skip this kind of code,
we keep going until the inferior returns from this
function. */
! if (step_stop_if_no_debug)
{
! /* 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. */
stop_step = 1;
print_stop_reason (END_STEPPING_RANGE, 0);
stop_stepping (ecs);
return;
}
! else
{
! /* Set a breakpoint at callee's return address (the address
! at which the caller will resume). */
insert_step_resume_breakpoint (get_prev_frame (get_current_frame ()),
ecs);
keep_going (ecs);
return;
}
}
if (frame_id_eq (frame_unwind_id (get_current_frame ()),