File gdb-6.3-framepczero-20040927.patch of Package gdb

2004-09-27  Andrew Cagney  <cagney@gnu.org>

	* frame.c (get_prev_frame): Stop backtrace when a zero PC and
	successive normal frames.

Index: gdb-6.8.50.20081128/gdb/frame.c
===================================================================
--- gdb-6.8.50.20081128.orig/gdb/frame.c	2008-12-04 01:34:37.000000000 +0100
+++ gdb-6.8.50.20081128/gdb/frame.c	2008-12-04 01:35:47.000000000 +0100
@@ -1566,6 +1566,18 @@ get_prev_frame (struct frame_info *this_
       return NULL;
     }
 
+  if (this_frame->level > 0
+#if 0
+      && backtrace_past_zero_pc
+#endif
+      && get_frame_type (this_frame) == NORMAL_FRAME
+      && get_frame_type (get_next_frame (this_frame)) == NORMAL_FRAME
+      && get_frame_pc (this_frame) == 0)
+    {
+      frame_debug_got_null_frame (this_frame, "zero PC");
+      return NULL;
+    }
+
   return get_prev_frame_1 (this_frame);
 }