[m-rev.] diff: fix some test case failures in debug grades
Zoltan Somogyi
zs at csse.unimelb.edu.au
Tue Jan 23 14:44:56 AEDT 2007
Fix some test case failures in debug grades.
runtime/mercury_trace_base.h:
Change the macro that wraps around callbacks to Mercury from the
debugger to turn off debugging in the Mercury code. Previously,
this was done inside the code for mdb command handling, but the
printing of variables at spy points that execution is not stopping at
didn't fall under its umbrella. This was a long standing bug, but
only my recent addition of a break_print command to a test case
exposed it.
compiler/mercury_compile.m:
Do not ask simplify to do constant propagation if constant propagation
has been disabled, which one test case asks for.
tests/debugger/queens.exp2:
Update for my recent change.
Zoltan.
cvs diff: Diffing .
cvs diff: Diffing analysis
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/doc
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing boehm_gc/libatomic_ops-1.2
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/doc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/gcc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/hpc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/ibmc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/icc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/msftc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/sunc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/tests
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing boehm_gc/windows-untested
cvs diff: Diffing boehm_gc/windows-untested/vc60
cvs diff: Diffing boehm_gc/windows-untested/vc70
cvs diff: Diffing boehm_gc/windows-untested/vc71
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
Index: compiler/mercury_compile.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/mercury_compile.m,v
retrieving revision 1.425
diff -u -b -r1.425 mercury_compile.m
--- compiler/mercury_compile.m 19 Jan 2007 07:04:18 -0000 1.425
+++ compiler/mercury_compile.m 22 Jan 2007 05:17:20 -0000
@@ -2828,23 +2828,25 @@
find_simplifications(no, Globals, Simplifications0),
SimpList0 = simplifications_to_list(Simplifications0),
+ globals.lookup_bool_option(Globals, constant_propagation, ConstProp),
globals.lookup_bool_option(Globals, profile_deep, DeepProf),
globals.lookup_bool_option(Globals, record_term_sizes_as_words, TSWProf),
globals.lookup_bool_option(Globals, record_term_sizes_as_cells, TSCProf),
-
ProfTrans = bool.or_list([DeepProf, TSWProf, TSCProf]),
- (
+
% Don't run constant propagation if any of the profiling
% transformations has been applied.
%
% NOTE: Any changes here may also need to be made to
% mercury_compile.simplify.
- ProfTrans = yes,
- SimpList1 = list.delete_all(SimpList0, simp_constant_prop)
- ;
- ProfTrans = no,
+ (
+ ConstProp = yes,
+ ProfTrans = no
+ ->
list.cons(simp_constant_prop, SimpList0, SimpList1)
+ ;
+ SimpList1 = list.delete_all(SimpList0, simp_constant_prop)
),
SimpList = [simp_do_once, simp_elim_removable_scopes | SimpList1],
@@ -3237,6 +3239,7 @@
simplify(Warn, SimplifyPass, Verbose, Stats, !HLDS, Specs, !IO) :-
module_info_get_globals(!.HLDS, Globals),
+ globals.lookup_bool_option(Globals, constant_propagation, ConstProp),
globals.lookup_bool_option(Globals, profile_deep, DeepProf),
globals.lookup_bool_option(Globals, record_term_sizes_as_words, TSWProf),
globals.lookup_bool_option(Globals, record_term_sizes_as_cells, TSCProf),
@@ -3271,19 +3274,21 @@
SimplifyPass = ml_backend,
list.cons(simp_do_once, !SimpList)
;
+ SimplifyPass = ll_backend,
% Don't perform constant propagation if one of the
% profiling transformations has been applied.
%
% NOTE: Any changes made here may also need to be made
% to the relevant parts of backend_pass_by_preds_4/12.
- %
- SimplifyPass = ll_backend,
+
(
- IsProfPass = yes,
- list.delete_all(!.SimpList, simp_constant_prop, !:SimpList)
- ;
- IsProfPass = no,
+ ConstProp = yes,
+ IsProfPass = no
+ ->
list.cons(simp_constant_prop, !SimpList)
+ ;
+ !:SimpList = list.delete_all(!.SimpList,
+ simp_constant_prop)
),
list.cons(simp_do_once, !SimpList),
list.cons(simp_elim_removable_scopes, !SimpList)
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing debian/patches
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/base64
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/curs
cvs diff: Diffing extras/curs/samples
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/error
cvs diff: Diffing extras/fixed
cvs diff: Diffing extras/gator
cvs diff: Diffing extras/gator/generations
cvs diff: Diffing extras/gator/generations/1
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/easyx
cvs diff: Diffing extras/graphics/easyx/samples
cvs diff: Diffing extras/graphics/mercury_glut
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/gears
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/lex
cvs diff: Diffing extras/lex/samples
cvs diff: Diffing extras/lex/tests
cvs diff: Diffing extras/log4m
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/moose/tests
cvs diff: Diffing extras/mopenssl
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/net
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/quickcheck
cvs diff: Diffing extras/quickcheck/tutes
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/solver_types
cvs diff: Diffing extras/solver_types/library
cvs diff: Diffing extras/stream
cvs diff: Diffing extras/stream/tests
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/windows_installer_generator
cvs diff: Diffing extras/windows_installer_generator/sample
cvs diff: Diffing extras/windows_installer_generator/sample/images
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing extras/xml_stylesheets
cvs diff: Diffing java
cvs diff: Diffing java/runtime
cvs diff: Diffing library
cvs diff: Diffing mdbcomp
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
Index: runtime/mercury_trace_base.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_trace_base.h,v
retrieving revision 1.58
diff -u -b -r1.58 mercury_trace_base.h
--- runtime/mercury_trace_base.h 3 Jan 2007 07:20:47 -0000 1.58
+++ runtime/mercury_trace_base.h 22 Jan 2007 05:04:05 -0000
@@ -624,21 +624,27 @@
*/
#define MR_TRACE_CALL_MERCURY(STATEMENTS) do { \
+ MR_bool saved_debug_enabled; \
MR_bool saved_io_enabled; \
MR_Unsigned saved_trace_call_seqno; \
MR_Unsigned saved_trace_call_depth; \
MR_Unsigned saved_trace_event_number; \
\
+ saved_debug_enabled = MR_debug_enabled; \
saved_io_enabled = MR_io_tabling_enabled; \
saved_trace_call_seqno = MR_trace_call_seqno; \
saved_trace_call_depth = MR_trace_call_depth; \
saved_trace_event_number = MR_trace_event_number; \
+ MR_debug_enabled = MR_FALSE; \
+ MR_update_trace_func_enabled(); \
MR_io_tabling_enabled = MR_FALSE; \
MR_restore_transient_registers(); \
MR_save_registers(); \
STATEMENTS; \
MR_restore_registers(); \
MR_save_transient_registers(); \
+ MR_debug_enabled = saved_debug_enabled; \
+ MR_update_trace_func_enabled(); \
MR_io_tabling_enabled = saved_io_enabled; \
MR_trace_call_seqno = saved_trace_call_seqno; \
MR_trace_call_depth = saved_trace_call_depth; \
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 slice
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
Index: tests/debugger/queens.exp2
===================================================================
RCS file: /home/mercury/mercury1/repository/tests/debugger/queens.exp2,v
retrieving revision 1.14
diff -u -b -r1.14 queens.exp2
--- tests/debugger/queens.exp2 8 Jan 2007 09:13:11 -0000 1.14
+++ tests/debugger/queens.exp2 22 Jan 2007 05:06:33 -0000
@@ -233,6 +233,9 @@
0: + stop interface pred queens.print_list/3-0 (det)
mdb> break qdelete
1: + stop interface pred queens.qdelete/3-0 (nondet)
+mdb> break_print HeadVar__2^2
+ 1: + stop interface pred queens.qdelete/3-0 (nondet)
+ HeadVar__2^2 (flat)
mdb> continue -a
E35: C8 EXIT queens.m:36 (from queens.m:40)
pred queens.qperm/2-0 (nondet)
@@ -280,9 +283,11 @@
pred queens.qperm/2-0 (nondet)
E57: C13 REDO queens.m:45 (from queens.m:38)
pred queens.qdelete/3-0 (nondet)
+ HeadVar__2^2 []
mdb> break info
0: + stop interface pred queens.print_list/3-0 (det)
1: + stop interface pred queens.qdelete/3-0 (nondet)
+ HeadVar__2^2 (flat)
mdb> enable *
0: + stop interface pred queens.print_list/3-0 (det)
1: + stop interface pred queens.qdelete/3-0 (nondet)
@@ -291,10 +296,13 @@
pred queens.qdelete/3-0 (nondet) c2;d2;
E59: C19 CALL queens.m:45 (from queens.m:47)
pred queens.qdelete/3-0 (nondet)
+mdb: the path 2 does not exist in variable HeadVar__2.
E60: C19 FAIL queens.m:45 (from queens.m:47)
pred queens.qdelete/3-0 (nondet)
+mdb: the path 2 does not exist in variable HeadVar__2.
E61: C13 FAIL queens.m:45 (from queens.m:38)
pred queens.qdelete/3-0 (nondet)
+ HeadVar__2^2 []
E62: C12 FAIL queens.m:36 (from queens.m:40)
pred queens.qperm/2-0 (nondet)
mdb> disable 1
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/general/string_format
cvs diff: Diffing tests/general/structure_reuse
cvs diff: Diffing tests/grade_subdirs
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/mmc_make
cvs diff: Diffing tests/mmc_make/lib
cvs diff: Diffing tests/par_conj
cvs diff: Diffing tests/recompilation
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/trailing
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
cvs diff: Diffing util
cvs diff: Diffing vim
cvs diff: Diffing vim/after
cvs diff: Diffing vim/ftplugin
cvs diff: Diffing vim/syntax
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to: mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions: mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the reviews
mailing list