Estimated hours taken: 1
Branches: main
Move the code that defines an instance of mercury_edt/2 from
browser/declarative_debugger.m into a module of its own. This section
of code is large and reasonably self-contained, so it makes sense for it
to have its own module. Moreover, declarative_debugger.m contains the
main declarative debugging definitions and the upper levels of code for
the front end, and the mercury_edt/2 instance doesn't fit into either of
these categories.
Add an exception handler to the front end, so that if declarative debugging
fails for whatever reason, the debugging session can at least continue using
the procedural debugger. Rather than calling error in the front end, throw
exceptions that are of a type specific to the front end (so we know which
errors are ours and which aren't).
browser/declarative_debugger.m:
Add a new type, diagnoser_exception/0. Handle these exceptions
but rethrow any other kind.
browser/declarative_debugger.m:
browser/declarative_tree.m:
Move the mercury_edt/2 instance to the new module.
browser/mdb.m:
Add the new module to the mdb library.
browser/declarative_*.m:
Call throw/1 instead of error/1.
tests/debugger/declarative/Mmakefile:
tests/debugger/declarative/catch.exp:
tests/debugger/declarative/catch.inp:
tests/debugger/declarative/catch.m:
A test case for debugging code that catches exceptions. This sort
of code is still not supported by the front end, but at least we
now give a decent error message and allow debugging to resume.