[m-dev.] for review: print/browse exceptions in the debugger
Fergus Henderson
fjh at cs.mu.OZ.AU
Sat Jun 17 07:34:21 AEST 2000
On 17-Jun-2000, Mark Anthony BROWN <dougl at cs.mu.OZ.AU> wrote:
> Allow the value of an exception to be printed and browsed
> at EXCP events in the internal debugger. Two new commands
> are added to the debugger:
>
> print exception
> browse exception
That looks great, Mark. Just one comment:
> @@ -836,6 +862,9 @@
> if streq(words[1], "*") {
> problem = MR_trace_browse_all(MR_mdb_out,
> MR_trace_print_var);
> + } else if streq(words[1], "exception") {
> + problem = MR_trace_browse_exception(event_info,
> + MR_trace_print_var);
> } else if (MR_trace_is_number(words[1], &n)) {
> var_spec.MR_var_spec_kind = MR_VAR_SPEC_NUMBER;
> var_spec.MR_var_spec_number = n;
> @@ -861,7 +890,10 @@
> const char *problem;
> int n;
>
> - if (MR_trace_is_number(words[1], &n)) {
> + if streq(words[1], "exception") {
> + problem = MR_trace_browse_exception(event_info,
> + MR_trace_browse_var);
> + } else if (MR_trace_is_number(words[1], &n)) {
> var_spec.MR_var_spec_kind = MR_VAR_SPEC_NUMBER;
> var_spec.MR_var_spec_number = n;
> problem = MR_trace_browse_one(NULL, var_spec,
It would be a good idea to put the conditions of those
of-then-elses inside parentheses. Otherwise it may break
if the definition of `streq' is changed.
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3 | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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