gdb
authorTom Tromey <tromey@redhat.com>
Wed, 15 Dec 2010 21:19:50 +0000 (21:19 +0000)
committerTom Tromey <tromey@redhat.com>
Wed, 15 Dec 2010 21:19:50 +0000 (21:19 +0000)
* infrun.c (save_infcall_control_state): Handle the
exception-resume breakpoint.
(restore_infcall_control_state): Likewise.
(discard_infcall_control_state): Likewise.
gdb/testsuite
2010-12-15  Jan Kratochvil  <jan.kratochvil@redhat.com>

* gdb.cp/nextoverthrow.cc (dummy): Return int 0.
(NextOverThrowDerivates) <resumebpt>: New.
(resumebpt_test): New.
(main): Call resumebpt_test.
* gdb.cp/nextoverthrow.exp: New block for test of "resumebpt".

gdb/ChangeLog
gdb/infrun.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.cp/nextoverthrow.cc
gdb/testsuite/gdb.cp/nextoverthrow.exp

index 629abfef445c6d9a785a870e6eff7c851964fe11..f8eb4c7ae0eb7dbfbf69c64282d134dfa0122c4b 100644 (file)
@@ -1,3 +1,10 @@
+2010-12-15  Tom Tromey  <tromey@redhat.com>
+
+       * infrun.c (save_infcall_control_state): Handle the
+       exception-resume breakpoint.
+       (restore_infcall_control_state): Likewise.
+       (discard_infcall_control_state): Likewise.
+
 2010-12-15  Kevin Buettner  <kevinb@redhat.com>
 
        * mips-tdep.c (mips_pseudo_register_write): Sign extend 32-bit
index 1bc00a4d6b63df5f79d2deb94c7655e3e174dc22..f72a18d77d1b0ef2b2b6eac357691a13a91192b0 100644 (file)
@@ -6379,6 +6379,7 @@ save_infcall_control_state (void)
   inf_status->inferior_control = inf->control;
 
   tp->control.step_resume_breakpoint = NULL;
+  tp->control.exception_resume_breakpoint = NULL;
 
   /* Save original bpstat chain to INF_STATUS; replace it in TP with copy of
      chain.  If caller's caller is walking the chain, they'll be happier if we
@@ -6428,6 +6429,10 @@ restore_infcall_control_state (struct infcall_control_state *inf_status)
   if (tp->control.step_resume_breakpoint)
     tp->control.step_resume_breakpoint->disposition = disp_del_at_next_stop;
 
+  if (tp->control.exception_resume_breakpoint)
+    tp->control.exception_resume_breakpoint->disposition
+      = disp_del_at_next_stop;
+
   /* Handle the bpstat_copy of the chain.  */
   bpstat_clear (&tp->control.stop_bpstat);
 
@@ -6476,6 +6481,10 @@ discard_infcall_control_state (struct infcall_control_state *inf_status)
     inf_status->thread_control.step_resume_breakpoint->disposition
       = disp_del_at_next_stop;
 
+  if (inf_status->thread_control.exception_resume_breakpoint)
+    inf_status->thread_control.exception_resume_breakpoint->disposition
+      = disp_del_at_next_stop;
+
   /* See save_infcall_control_state for info on stop_bpstat. */
   bpstat_clear (&inf_status->thread_control.stop_bpstat);
 
index 04175383bcce3f49fd8290ebd5c2a3e21476253a..9947918a2edf09a6631d18bc403a931e42e60b40 100644 (file)
@@ -1,3 +1,11 @@
+2010-12-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * gdb.cp/nextoverthrow.cc (dummy): Return int 0.
+       (NextOverThrowDerivates) <resumebpt>: New.
+       (resumebpt_test): New.
+       (main): Call resumebpt_test.
+       * gdb.cp/nextoverthrow.exp: New block for test of "resumebpt".
+
 2010-12-12  Stan Shebs  <stan@codesourcery.com>
 
        * gdb.trace/tsv.exp: Test print command on trace state variables.
index b25cb34338cb84ee12249cd50450fe3fc1143963..b618f15c22327fc0e811fefa498f0f373286dbe2 100644 (file)
@@ -19,8 +19,9 @@
 
 using namespace std;
 
-void dummy ()
+int dummy ()
 {
+  return 0;
 }
 
 class NextOverThrowDerivates
@@ -89,10 +90,39 @@ public:
     function1 (val);           // until here
   }
 
+  void resumebpt (int val)
+  {
+    try
+      {
+       throw val;
+      }
+    catch (int x)
+      {
+       dummy ();
+      }
+  }
+
 };
 NextOverThrowDerivates next_cases;
 
 
+int
+resumebpt_test (int x)
+{
+  try
+    {
+      next_cases.resumebpt (x);            // Start: resumebpt
+      next_cases.resumebpt (x + 1); // Second: resumebpt
+    }
+  catch (int val)
+    {
+      dummy ();
+      x = val;
+    }
+
+  return x;
+}
+
 int main () 
 { 
   int testval = -1;
@@ -198,6 +228,8 @@ int main ()
       testval = val;           // End: advance
     }
 
+  // Test of "resumebpt".
+  testval = resumebpt_test (10);
+
   testval = 32;                        // done
 }
-
index 960ea0d8e4541898f8c7db0f329ed7906ef313d8..3ec51f7fbe7c1bb586fcedf8cbfb443c13861205 100644 (file)
@@ -149,5 +149,14 @@ gdb_test "advance $line" ".*" "advance-over-throw"
 tbreak_and_cont "End: advance"
 verify_testval "pre-check - advance" 8
 
+tbreak_and_cont "Start: resumebpt"
+gdb_test "tbreak _Unwind_RaiseException"
+gdb_test "continue" "Temporary breakpoint.*" "continuing to _Unwind_RaiseException"
+gdb_test "finish" "Run till exit .*"
+gdb_test {set $retpc=$pc}
+gdb_test {break *$retpc if dummy ()}
+tbreak_and_cont "Second: resumebpt"
+gdb_test "next"
+
 tbreak_and_cont "done"
-verify_testval "post-check - advance" 9
+verify_testval "post-check - advance" 10