2005-11-24 Andrew Stubbs * frame.c (get_prev_frame_1): Check the PC is within the program before allowing the frame to be created. Index: src/gdb/frame.c =================================================================== --- src.orig/gdb/frame.c 2005-11-24 16:45:22.000000000 +0000 +++ src/gdb/frame.c 2005-11-24 17:24:09.000000000 +0000 @@ -1123,6 +1123,16 @@ get_prev_frame_1 (struct frame_info *thi this_frame->prev = prev_frame; prev_frame->next = this_frame; + /* Check that the new frame would refer to a location within the + program. This has to be done after it is linked in or the + function calls will not work. If the location is junk then + we have probably dropped off the bottom of the stack. */ + if (!find_pc_section (frame_unwind_address_in_block (this_frame))) + { + this_frame->prev = NULL; + return NULL; + } + if (frame_debug) { fprintf_unfiltered (gdb_stdlog, "-> ");