Index: infrun.c =================================================================== RCS file: /cvs/src/src/gdb/infrun.c,v retrieving revision 1.208 diff -u -a -u -r1.208 infrun.c --- infrun.c 17 Dec 2005 22:34:01 -0000 1.208 +++ infrun.c 3 Jan 2006 17:48:16 -0000 @@ -2390,8 +2390,22 @@ /* 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_at_frame (get_prev_frame (get_current_frame ())); - keep_going (ecs); + /* We're doing a "next", set a breakpoint at callee's return + address (the address at which the caller will + resume). */ + if (get_prev_frame ( get_current_frame ())) + { + insert_step_resume_breakpoint_at_frame (get_prev_frame (get_current_frame ())); + } + else + { + struct symtab_and_line sr_sal; + init_sal (&sr_sal); /* initialize to zeros */ + sr_sal.pc = ADDR_BITS_REMOVE (gdbarch_unwind_pc (current_gdbarch,get_current_frame())); + sr_sal.section = find_pc_overlay (sr_sal.pc); + insert_step_resume_breakpoint_at_sal (sr_sal, null_frame_id); + } + keep_going (ecs); return; }