[m-rev.] for review: fix some failing decl debugger test cases
Ian MacLarty
maclarty at cs.mu.OZ.AU
Sun Jan 16 13:48:59 AEDT 2005
I will submit a report to mercury-bugs shortly.
Estimated hours taken: 12
Branches: main
Disable higher order specialization for the mdb.declarative_edt module
since mdb.declarative_edt.revise_root/3 exposes a bug in this optimization.
Allow the declarative debugger to continue to be debugged after a new portion
of the annotated trace has been generated.
browser/Mercury.options
Disable higher order specialization for the mdb.declarative_edt module.
trace/mercury_trace_declarative.c
trace/mercury_trace_declarative.h
Add a global variable MR_trace_decl_in_dd_dd_mode to indicate when
the declarative debugger was invoked with the dd_dd command. A
seperate variable must be used to trace_mode, since trace_mode
is changed to MR_TRACE_INTERACTIVE when the declarative debugger
is started, so it's not possible to tell that it was invoked with the
dd_dd command when diagnosis is restarted after a new portion of the
annotated trace has been generated.
trace/mercury_trace_internal.c
Set MR_trace_decl_in_dd_dd_mode appropriately depending on whether
`dd' or `dd_dd' was used to invoke the declarative debugger.
When the dd_dd command is used set the trace_mode to
MR_TRACE_DECL_DEBUG instead of MR_TRACE_DECL_DEBUG_DEBUG since the
value of MR_trace_decl_in_dd_dd_mode is now used instead to determine
if the dd_dd command was given.
trace/mercury_trace_internal.h
Remove the MR_TRACE_DECL_DEBUG_DEBUG trace mode option since it is
no longer used.
Index: browser/Mercury.options
===================================================================
RCS file: /home/mercury1/repository/mercury/browser/Mercury.options,v
retrieving revision 1.4
diff -u -r1.4 Mercury.options
--- browser/Mercury.options 19 Oct 2004 06:01:36 -0000 1.4
+++ browser/Mercury.options 14 Jan 2005 04:33:22 -0000
@@ -9,5 +9,10 @@
MCFLAGS-mer_browser = --no-warn-nothing-exported
MCFLAGS-mer_mdbcomp = --no-warn-nothing-exported
+# XXX Disable higher order specialization for declarative_edt since this
+# optimization has a suspected bug that mdb.declarative_edt.revise_root/3
+# exposes.
+MCFLAGS-mdb.declarative_edt = --no-optimize-higher-order
+
EXTRA_LIBRARIES-libmer_browser.so = mer_mdbcomp
EXTRA_LIBRARIES-libmer_browser.dylib = mer_mdbcomp
Index: trace/mercury_trace_declarative.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_declarative.c,v
retrieving revision 1.76
diff -u -r1.76 mercury_trace_declarative.c
--- trace/mercury_trace_declarative.c 9 Jan 2005 01:14:09 -0000 1.76
+++ trace/mercury_trace_declarative.c 14 Jan 2005 04:43:03 -0000
@@ -290,6 +290,8 @@
MR_Integer MR_edt_depth_step_size = MR_TRACE_DECL_INITIAL_DEPTH;
+MR_bool MR_trace_decl_in_dd_dd_mode = MR_FALSE;
+
/*
** This function is called for every traced event when building the
** annotated trace. It must decide which events are included in the
@@ -1552,7 +1554,7 @@
return MR_trace_event_internal(cmd, MR_TRUE, event_info);
}
- if (MR_trace_decl_mode == MR_TRACE_DECL_DEBUG_DEBUG) {
+ if (MR_trace_decl_in_dd_dd_mode) {
/*
** This is a quick and dirty way to debug the front end.
*/
@@ -1600,6 +1602,15 @@
(MR_Integer *) &topmost_seqno);
);
+ /*
+ ** Turn off interactive debugging after the diagnosis in case a new
+ ** explicit subtree or supertree needs to be constructed.
+ */
+ if (MR_trace_decl_in_dd_dd_mode) {
+ MR_debug_enabled = MR_FALSE;
+ MR_trace_decl_mode = MR_TRACE_DECL_DEBUG;
+ }
+
MR_trace_call_seqno = event_details->MR_call_seqno;
MR_trace_call_depth = event_details->MR_call_depth;
MR_trace_event_number = event_details->MR_event_number;
Index: trace/mercury_trace_declarative.h
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_declarative.h,v
retrieving revision 1.21
diff -u -r1.21 mercury_trace_declarative.h
--- trace/mercury_trace_declarative.h 9 Jan 2005 01:14:09 -0000 1.21
+++ trace/mercury_trace_declarative.h 14 Jan 2005 04:44:37 -0000
@@ -127,4 +127,13 @@
extern MR_Integer MR_edt_depth_step_size;
+/*
+** The following variable indicates whether the declarative debugger was
+** invoked using the dd_dd command and is needed so that the declarative
+** debugger can continue to be debugged after a new portion of the
+** annotated trace has been generated.
+*/
+
+extern MR_bool MR_trace_decl_in_dd_dd_mode;
+
#endif /* MERCURY_TRACE_DECLARATIVE_H */
Index: trace/mercury_trace_internal.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_internal.c,v
retrieving revision 1.186
diff -u -r1.186 mercury_trace_internal.c
--- trace/mercury_trace_internal.c 9 Jan 2005 01:14:09 -0000 1.186
+++ trace/mercury_trace_internal.c 13 Jan 2005 07:59:51 -0000
@@ -5517,6 +5517,7 @@
MR_trace_decl_assume_all_io_is_tabled = MR_FALSE;
MR_edt_depth_step_size = MR_TRACE_DECL_INITIAL_DEPTH;
search_mode = MR_trace_get_default_search_mode();
+ MR_trace_decl_in_dd_dd_mode = MR_FALSE;
if (! MR_trace_options_dd(&MR_trace_decl_assume_all_io_is_tabled,
&MR_edt_depth_step_size, &search_mode,
@@ -5558,6 +5559,7 @@
MR_trace_decl_assume_all_io_is_tabled = MR_FALSE;
MR_edt_depth_step_size = MR_TRACE_DECL_INITIAL_DEPTH;
search_mode = MR_trace_get_default_search_mode();
+ MR_trace_decl_in_dd_dd_mode = MR_TRUE;
if (! MR_trace_options_dd(&MR_trace_decl_assume_all_io_is_tabled,
&MR_edt_depth_step_size, &search_mode,
@@ -5569,7 +5571,7 @@
trace_mode = MR_TRACE_DECL_DEBUG_DUMP;
filename = (const char *) words[1];
} else {
- trace_mode = MR_TRACE_DECL_DEBUG_DEBUG;
+ trace_mode = MR_TRACE_DECL_DEBUG;
filename = (const char *) NULL;
}
Index: trace/mercury_trace_internal.h
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_internal.h,v
retrieving revision 1.17
diff -u -r1.17 mercury_trace_internal.h
--- trace/mercury_trace_internal.h 16 Oct 2002 05:45:32 -0000 1.17
+++ trace/mercury_trace_internal.h 13 Jan 2005 07:42:45 -0000
@@ -22,13 +22,9 @@
typedef enum {
MR_TRACE_INTERACTIVE, /* Use internal debugger. */
MR_TRACE_DECL_DEBUG, /* Normal declarative debugging. */
- MR_TRACE_DECL_DEBUG_DUMP, /*
+ MR_TRACE_DECL_DEBUG_DUMP /*
** Output debugging info to a file
** for separate analysis.
- */
- MR_TRACE_DECL_DEBUG_DEBUG /*
- ** Generate trace events for the
- ** debugging front end.
*/
} MR_Trace_Mode;
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list