[m-dev.] for review: new debugger command: excp
Zoltan Somogyi
zs at cs.mu.OZ.AU
Tue Jul 18 13:21:33 AEST 2000
For review by anyone.
Estimated hours taken: 0.5
Add a new debugger command, excp, that continues forward execution until it
reaches an exception event (or the program exits). This command was requested
by MC.
doc/user_guide.texi:
Document the new command.
trace/mercury_trace.[ch]:
Add a forward movement operation that stops only at the first exception
event.
trace/mercury_trace_internal.c:
Implement the excp command using the new operation.
tests/debugger/exception_vars.{inp,exp,exp2}:
Test the operation of the new command.
tests/debugger/mdb_command_test.inp:
Test the documentation of the new command.
Zoltan.
cvs diff: Diffing .
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing doc
Index: doc/user_guide.texi
===================================================================
RCS file: /home/mercury1/repository/mercury/doc/user_guide.texi,v
retrieving revision 1.209
diff -u -b -r1.209 user_guide.texi
--- doc/user_guide.texi 2000/06/19 07:58:32 1.209
+++ doc/user_guide.texi 2000/07/17 06:36:51
@@ -1834,6 +1834,19 @@
@sp 1
By default, this command is strict, and it uses the default print level.
@sp 1
+ at item excp [-NSans]
+Continues the program until execution reaches an exception event.
+Reports an error if the current event is already an exception event.
+ at sp 1
+The options @samp{-n} or @samp{--none}, @samp{-s} or @samp{--some},
+ at samp{-a} or @samp{--all} specify the print level to use
+for the duration of the command,
+while the options @samp{-S} or @samp{--strict}
+and @samp{-N} or @samp{--nostrict} specify
+the strictness of the command.
+ at sp 1
+By default, this command is strict, and it uses the default print level.
+ at sp 1
@item return [-NSans]
Continues the program until the program finished returning,
i.e. until it reaches a port other than EXIT.
cvs diff: Diffing extras
cvs diff: Diffing extras/aditi
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/concurrency
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing library
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
Index: tests/debugger/exception_vars.exp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/exception_vars.exp,v
retrieving revision 1.2
diff -u -b -r1.2 exception_vars.exp
--- tests/debugger/exception_vars.exp 1999/12/19 19:02:57 1.2
+++ tests/debugger/exception_vars.exp 2000/07/17 06:37:53
@@ -1,9 +1,7 @@
1: 1 1 CALL pred exception_vars:main/2-0 (det) exception_vars.m:12
mdb> echo on
Command echo enabled.
-mdb> goto 2
- 2: 2 2 CALL pred exception_vars:test/2-0 (det) exception_vars.m:19 (exception_vars.m:12)
-mdb> finish
+mdb> excp
4: 2 2 EXCP pred exception_vars:test/2-0 (det) exception_vars.m:18 (exception_vars.m:12)
mdb> print *
HeadVar__1 42
Index: tests/debugger/exception_vars.exp2
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/exception_vars.exp2,v
retrieving revision 1.3
diff -u -b -r1.3 exception_vars.exp2
--- tests/debugger/exception_vars.exp2 1999/12/19 19:02:57 1.3
+++ tests/debugger/exception_vars.exp2 2000/07/18 01:16:09
@@ -1,9 +1,7 @@
1: 1 1 CALL pred exception_vars:main/2-0 (det) exception_vars.m:12
mdb> echo on
Command echo enabled.
-mdb> goto 2
- 2: 2 2 CALL pred exception_vars:test/2-0 (det) exception_vars.m:19 (exception_vars.m:12)
-mdb> finish
+mdb> excp
6: 2 2 EXCP pred exception_vars:test/2-0 (det) exception_vars.m:18 (exception_vars.m:12)
mdb> print *
HeadVar__1 42
Index: tests/debugger/exception_vars.inp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/exception_vars.inp,v
retrieving revision 1.2
diff -u -b -r1.2 exception_vars.inp
--- tests/debugger/exception_vars.inp 1999/12/19 19:02:57 1.2
+++ tests/debugger/exception_vars.inp 2000/07/17 06:37:53
@@ -1,5 +1,4 @@
echo on
-goto 2
-finish
+excp
print *
continue
Index: tests/debugger/mdb_command_test.inp
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/mdb_command_test.inp,v
retrieving revision 1.7
diff -u -b -r1.7 mdb_command_test.inp
--- tests/debugger/mdb_command_test.inp 1999/11/15 00:43:47 1.7
+++ tests/debugger/mdb_command_test.inp 2000/07/17 06:37:49
@@ -4,6 +4,7 @@
step xyzzy xyzzy xyzzy xyzzy xyzzy
goto xyzzy xyzzy xyzzy xyzzy xyzzy
finish xyzzy xyzzy xyzzy xyzzy xyzzy
+excp xyzzy xyzzy xyzzy xyzzy xyzzy
return xyzzy xyzzy xyzzy xyzzy xyzzy
forward xyzzy xyzzy xyzzy xyzzy xyzzy
mindepth xyzzy xyzzy xyzzy xyzzy xyzzy
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
Index: trace/mercury_trace.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace.c,v
retrieving revision 1.22
diff -u -b -r1.22 mercury_trace.c
--- trace/mercury_trace.c 2000/05/15 16:37:40 1.22
+++ trace/mercury_trace.c 2000/07/17 06:37:40
@@ -170,6 +170,15 @@
goto check_stop_print;
}
+ case MR_CMD_EXCP:
+ port = (MR_Trace_Port) layout->MR_sll_port;
+ if (port == MR_PORT_EXCEPTION) {
+ return MR_trace_event(&MR_trace_ctrl, TRUE,
+ layout, port, seqno, depth);
+ } else {
+ goto check_stop_print;
+ }
+
case MR_CMD_RETURN:
port = (MR_Trace_Port) layout->MR_sll_port;
if (port != MR_PORT_EXIT) {
Index: trace/mercury_trace.h
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace.h,v
retrieving revision 1.12
diff -u -b -r1.12 mercury_trace.h
--- trace/mercury_trace.h 1999/12/14 04:54:38 1.12
+++ trace/mercury_trace.h 2000/07/17 06:37:40
@@ -90,6 +90,7 @@
MR_CMD_GOTO,
MR_CMD_FINISH,
MR_CMD_RESUME_FORWARD,
+ MR_CMD_EXCP,
MR_CMD_RETURN,
MR_CMD_MIN_DEPTH,
MR_CMD_MAX_DEPTH,
Index: trace/mercury_trace_internal.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_internal.c,v
retrieving revision 1.68
diff -u -b -r1.68 mercury_trace_internal.c
--- trace/mercury_trace_internal.c 2000/06/19 07:59:28 1.68
+++ trace/mercury_trace_internal.c 2000/07/17 06:37:41
@@ -642,6 +642,23 @@
cmd->MR_trace_stop_depth = stop_depth;
return STOP_INTERACTING;
}
+ } else if (streq(words[0], "excp")) {
+ cmd->MR_trace_strict = TRUE;
+ cmd->MR_trace_print_level = MR_default_print_level;
+ if (! MR_trace_options_strict_print(cmd, &words, &word_count,
+ "forward", "excp"))
+ {
+ ; /* the usage message has already been printed */
+ } else if (word_count == 1) {
+ if (event_info->MR_trace_port != MR_PORT_EXCEPTION) {
+ cmd->MR_trace_cmd = MR_CMD_EXCP;
+ return STOP_INTERACTING;
+ } else {
+ MR_trace_do_noop();
+ }
+ } else {
+ MR_trace_usage("forward", "return");
+ }
} else if (streq(words[0], "return")) {
cmd->MR_trace_strict = TRUE;
cmd->MR_trace_print_level = MR_default_print_level;
@@ -2477,6 +2494,7 @@
{ "forward", "step" },
{ "forward", "goto" },
{ "forward", "finish" },
+ { "forward", "excp" },
{ "forward", "return" },
{ "forward", "forward" },
{ "forward", "mindepth" },
cvs diff: Diffing trial
cvs diff: Diffing util
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list