Call dummy_frame_dtor_ftype also from remove_dummy_frame
[deliverable/binutils-gdb.git] / gdb / dummy-frame.c
index f193289aeda78d213243f1cb750999be9c91a337..6c4fb4c6b47f02d9f71c2c5060102ebced927495 100644 (file)
@@ -28,6 +28,7 @@
 #include "gdbcmd.h"
 #include "observer.h"
 #include "gdbthread.h"
+#include "infcall.h"
 
 struct dummy_frame_id
 {
@@ -62,8 +63,7 @@ struct dummy_frame
   /* The caller's state prior to the call.  */
   struct infcall_suspend_state *caller_state;
 
-  /* If non-NULL, a destructor that is run when this dummy frame is
-     popped.  */
+  /* If non-NULL, a destructor that is run when this dummy frame is freed.  */
   dummy_frame_dtor_ftype *dtor;
 
   /* Arbitrary data that is passed to DTOR.  */
@@ -96,6 +96,9 @@ remove_dummy_frame (struct dummy_frame **dummy_ptr)
 {
   struct dummy_frame *dummy = *dummy_ptr;
 
+  if (dummy->dtor != NULL)
+    dummy->dtor (dummy->dtor_data, 0);
+
   *dummy_ptr = dummy->next;
   discard_infcall_suspend_state (dummy->caller_state);
   xfree (dummy);
@@ -136,7 +139,7 @@ pop_dummy_frame (struct dummy_frame **dummy_ptr)
   gdb_assert (ptid_equal (dummy->id.ptid, inferior_ptid));
 
   if (dummy->dtor != NULL)
-    dummy->dtor (dummy->dtor_data);
+    dummy->dtor (dummy->dtor_data, 1);
 
   restore_infcall_suspend_state (dummy->caller_state);
 
This page took 0.04052 seconds and 4 git commands to generate.