Estimated hours taken: 12
Clean up the declarative debugger.
browser/declarative_debugger.m:
browser/declarative_oracle.m:
- Add a new type, oracle_data, to store the oracle database.
- Thread an oracle database through a single call to the
front end.
- Replace `unknown' with a less overloaded name in
some type definitions.
trace/mercury_trace_declarative.c:
trace/mercury_trace_declarative.h:
browser/declarative_debugger.m:
- Improve documentation.
browser/declarative_debugger.m:
- Export new type, edt_truth.
- Improve the interface to the oracle.
- Add a new typeclass, evaluation_tree, and update the
previous interface to reflect this.
- Make declarative_bug a polymorphic type, and change the
constructor for buggy nodes from `wrong' to `e_bug'.
Estimated hours taken: 2
Add the option `--enable-decl-debug' to configure, which enables
declarative debugging support in the internal debugger.
configure.in:
Add the option to configure.
browser/declarative_debugger.m:
runtime/mercury_wrapper.c:
Avoid using MR_address_of_edt_root_node unless configured
for declarative debugging.
runtime/mercury_conf.h.in:
runtime/mercury_conf_param.h:
Move the configuration macro to mercury_conf.h.in.
trace/mercury_trace_declarative.c:
Define MR_edt_root_node only if configured for declarative
debugging, thereby undoing a previous change.
Estimated hours taken: 3
Fix a bug causing the debugger tests to get link errors.
browser/declarative_debugger.m:
Call MR_edt_root_node indirectly via MR_address_of_edt_root_node.
runtime/mercury_wrapper.{c,h}:
Add a global function pointer, MR_address_of_edt_root_node.
util/mkinit.c:
Make sure MR_address_of_edt_root_node is initialized.
trace/mercury_trace_declarative.c:
Define MR_edt_root_node even if the declarative debugger is not
used.
Estimated hours taken: 80
Add a front end to the declarative debugger, written in Mercury. Modify
the back end to call this whenever an EDT is built. Also, various
bug fixes and improvements.
browser/declarative_debugger.m:
New module. This is a first implementation of the front end of
the declarative debugger. It uses a simple top-down algorithm
to search the EDT for a buggy node. The results are printed
in a simple format to the output stream. It is called from the
back end, in trace/mercury_trace_declarative.c.
browser/declarative_oracle.m:
New module. This is a first implementation of an oracle for the
declarative debugger. It simply passes all queries directly
on to the user.
browser/browser_library.m:
Import the new modules.
trace/mercury_trace_declarative.c:
- Various fixes/improvements of comments.
- Fix bugs where `int' is used instead of `Unsigned'.
- Pass the event_info structure to MR_trace_decl_update_path,
rather than passing various components of it.
- Use the copy of MR_trace_event_number in the event_info structure
rather than referring to the global variable directly.
- Remove the EDT printing functions, as they have been superseded by
the new front end. Call the new front end instead of these old
functions.
- Provide an interface to the EDT nodes that is imported by the
front end.
- Ensure that, after diagnosis, we end up at the same event we
started at.
- Fix a bug where it was assumed all procedures had at least one
argument.
- Ensure that the user is notified if the dd_wrong operation cannot
be started due to MR_trace_retry failing.
trace/mercury_trace_declarative.h:
- Move a #include to the correct place.
- Declare the interface to the EDT nodes.
trace/mercury_trace_internal.c:
Fix a bug introduced earlier.
runtime/mercury_conf_param.h:
Add a new configuration macro, MR_DEBUG_DD_BACK_END. When defined
this causes information about the declarative debugger back end
to be printed out during operation.