Index: infrun.c =================================================================== RCS file: /cvs/src/src/gdb/infrun.c,v retrieving revision 1.134 diff -u -p -r1.134 infrun.c --- infrun.c 1 Feb 2004 18:05:09 -0000 1.134 +++ infrun.c 4 Feb 2004 17:35:39 -0000 @@ -2482,6 +2482,17 @@ process_event_stop_test: return; } + if (ecs->stop_func_name == NULL + && step_over_calls == STEP_OVER_UNDEBUGGABLE) + { + /* We couldn't determine where we stopped, so we just stepped + inside undebuggable code. Since we want to step over this + kind of code, we keep going until the inferior returns from + the current function. */ + handle_step_into_function (ecs); + return; + } + /* We can't update step_sp every time through the loop, because reading the stack pointer would slow down stepping too much. But we can update it every time we leave the step range. */ @@ -2571,15 +2582,44 @@ process_event_stop_test: return; } - if (((stop_pc == ecs->stop_func_start /* Quick test */ - || in_prologue (stop_pc, ecs->stop_func_start)) - && !IN_SOLIB_RETURN_TRAMPOLINE (stop_pc, ecs->stop_func_name)) - || IN_SOLIB_CALL_TRAMPOLINE (stop_pc, ecs->stop_func_name) - || ecs->stop_func_name == 0) + if (legacy_frame_p (current_gdbarch)) { - /* It's a subroutine call. */ - handle_step_into_function (ecs); - return; + /* FIXME: brobecker/2004-02-04: The current architecture is still + using the legacy frame code, so we prefer not to rely on frame IDs + to check whether we just stepped into a function or not. Some + experiments conducted on sparc-solaris before it was converted + to the new frame code showed that it could introduce some + severe problems. Once all targets have transitioned to the new + frame code, this block can be deleted. */ + if (((stop_pc == ecs->stop_func_start /* Quick test */ + || in_prologue (stop_pc, ecs->stop_func_start)) + && !IN_SOLIB_RETURN_TRAMPOLINE (stop_pc, ecs->stop_func_name)) + || IN_SOLIB_CALL_TRAMPOLINE (stop_pc, ecs->stop_func_name) + || ecs->stop_func_name == 0) + { + /* It's a subroutine call. */ + handle_step_into_function (ecs); + return; + } + } + else + { + if (IN_SOLIB_CALL_TRAMPOLINE (stop_pc, ecs->stop_func_name)) + { + /* We landed in a shared library call trampoline, so it + is a subroutine call. */ + handle_step_into_function (ecs); + return; + } + + if (frame_id_eq (get_frame_id (get_prev_frame (get_current_frame ())), + step_frame_id)) + { + /* It's a subroutine call. */ + handle_step_into_function (ecs); + return; + } + } /* We've wandered out of the step range. */