Blob Blame History Raw
diff -Naur insight-7.4.50.orig/gdb/dummy-frame.c insight-7.4.50.new/gdb/dummy-frame.c
--- insight-7.4.50.orig/gdb/dummy-frame.c	2012-01-04 09:17:00.000000000 +0100
+++ insight-7.4.50.new/gdb/dummy-frame.c	2012-04-04 17:53:55.871287239 +0200
@@ -29,6 +29,7 @@
 #include "gdbcmd.h"
 #include "gdb_string.h"
 #include "observer.h"
+#include "gdbthread.h"
 
 /* Dummy frame.  This saves the processor state just prior to setting
    up the inferior function call.  Older targets save the registers
@@ -108,19 +109,36 @@
   xfree (dummy);
 }
 
+/* Delete any breakpoint B which is a momentary breakpoint for return from
+   inferior call matching DUMMY_VOIDP.  */
+
+static int
+pop_dummy_frame_bpt (struct breakpoint *b, void *dummy_voidp)
+{
+  struct dummy_frame *dummy = dummy_voidp;
+
+  if (b->disposition == disp_del && frame_id_eq (b->frame_id, dummy->id)
+      && b->thread == pid_to_thread_id (inferior_ptid))
+    delete_breakpoint (b);
+
+  /* Continue the traversal.  */
+  return 0;
+}
+
 /* Pop *DUMMY_PTR, restoring program state to that before the
    frame was created.  */
 
 static void
 pop_dummy_frame (struct dummy_frame **dummy_ptr)
 {
-  struct dummy_frame *dummy;
+  struct dummy_frame *dummy = *dummy_ptr;
+
+  restore_infcall_suspend_state (dummy->caller_state);
 
-  restore_infcall_suspend_state ((*dummy_ptr)->caller_state);
+  iterate_over_breakpoints (pop_dummy_frame_bpt, dummy);
 
   /* restore_infcall_control_state frees inf_state,
      all that remains is to pop *dummy_ptr.  */
-  dummy = *dummy_ptr;
   *dummy_ptr = dummy->next;
   xfree (dummy);
 
diff -Naur insight-7.4.50.orig/gdb/testsuite/gdb.base/call-signal-resume.exp insight-7.4.50.new/gdb/testsuite/gdb.base/call-signal-resume.exp
--- insight-7.4.50.orig/gdb/testsuite/gdb.base/call-signal-resume.exp	2012-01-23 18:11:50.000000000 +0100
+++ insight-7.4.50.new/gdb/testsuite/gdb.base/call-signal-resume.exp	2012-04-04 17:53:55.872287182 +0200
@@ -101,6 +101,18 @@
 gdb_test_no_output "set confirm off"
 gdb_test "return" ""
 
+# Verify there are no remains of the dummy frame.
+gdb_test_no_output "maintenance print dummy-frames"
+set test "maintenance info breakpoints"
+gdb_test_multiple $test $test {
+    -re "call dummy.*\r\n$gdb_prompt $" {
+	fail $test
+    }
+    -re "\r\n$gdb_prompt $" {
+	pass $test
+    }
+}
+
 # Resume execution, the program should continue without any signal.
 
 gdb_test "break stop_two" "Breakpoint \[0-9\]* at .*"