This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: RFC: next/finish/etc -vs- exceptions
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Fri, 10 Dec 2010 05:52:30 +0100
- Subject: Re: RFC: next/finish/etc -vs- exceptions
- References: <m38w2a236l.fsf@fleche.redhat.com> <m3vd3ckx64.fsf@fleche.redhat.com> <m3oc8u3nsy.fsf@fleche.redhat.com>
On Thu, 09 Dec 2010 17:37:17 +0100, Tom Tromey wrote:
> >>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:
> I rebased this patch on CVS HEAD and committed it.
> I'm appending the updated version.
The attached testcase extension causes:
breakpoint.c:4393: internal-error: bpstat_what: unhandled bptype -1785358955
The new field `tp->control.exception_resume_breakpoint' should be probably
handled by existing save_infcall_control_state, restore_infcall_control_state
and discard_infcall_control_state somehow like step_resume_breakpoint is.
Thanks,
Jan
--- a/gdb/testsuite/gdb.cp/nextoverthrow.cc
+++ b/gdb/testsuite/gdb.cp/nextoverthrow.cc
@@ -19,8 +19,9 @@
using namespace std;
-void dummy ()
+int dummy ()
{
+ return 0;
}
class NextOverThrowDerivates
@@ -89,6 +90,18 @@ public:
function1 (val); // until here
}
+ void resumebpt (int val)
+ {
+ try
+ {
+ throw val;
+ }
+ catch (int x)
+ {
+ dummy ();
+ }
+ }
+
};
NextOverThrowDerivates next_cases;
@@ -198,6 +211,18 @@ int main ()
testval = val; // End: advance
}
+ // Test of "resumebpt".
+ try
+ {
+ next_cases.resumebpt (10); // Start: resumebpt
+ next_cases.resumebpt (11); // Second: resumebpt
+ }
+ catch (int val)
+ {
+ dummy ();
+ testval = val; // End: resumebpt
+ }
+
testval = 32; // done
}
--- a/gdb/testsuite/gdb.cp/nextoverthrow.exp
+++ b/gdb/testsuite/gdb.cp/nextoverthrow.exp
@@ -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