summaryrefslogtreecommitdiffstats
path: root/byterun/debugger.c
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>1997-02-17 16:53:10 +0000
committerXavier Leroy <xavier.leroy@inria.fr>1997-02-17 16:53:10 +0000
commitbc4c0e5f74dc339bd05976e7c26a822325878a82 (patch)
treea3faba93b3f99199181f62da8669920b1a25564f /byterun/debugger.c
parent2b0be513f301ac74335176f006145eaae41e1a40 (diff)
Trapper les exceptions sortant de output_value
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1277 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'byterun/debugger.c')
-rw-r--r--byterun/debugger.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/byterun/debugger.c b/byterun/debugger.c
index 1957664b5..c01999ce2 100644
--- a/byterun/debugger.c
+++ b/byterun/debugger.c
@@ -161,6 +161,7 @@ void debugger(event)
mlsize_t size;
value val;
value * p;
+ struct longjmp_buffer raise_buf, * saved_external_raise;
if (dbg_socket == -1) return; /* Not connected to a debugger. */
@@ -299,7 +300,16 @@ void debugger(event)
break;
case REQ_MARSHAL_OBJ:
val = getval(dbg_in);
- output_value(dbg_out, val);
+ /* Catch exceptions raised by output_value */
+ saved_external_raise = external_raise;
+ if (sigsetjmp(raise_buf.buf, 1) == 0) {
+ external_raise = &raise_buf;
+ output_value(dbg_out, val);
+ } else {
+ /* Send wrong magic number, will cause input_value to fail */
+ really_putblock(dbg_out, "\000\000\000\000", 4);
+ }
+ external_raise = saved_external_raise;
flush(dbg_out);
break;
case REQ_GET_CLOSURE_CODE: