4 Commits

Author SHA1 Message Date
Zoltan Somogyi
59b11f84ce Update the debugger test directory.
Replace __ with . as the module qualifier symbol.

Replace references to io.state with just io.

Replace DCGs with state variables.

Replace (C->T;E) syntax for if-then-elses with (if C then T else E) syntax.

Replace if-then-elses with switches when possible and where this does not
affect what is being tested.

Replace separate pred and mode declarations with predmode declarations.

Put predicate and function declarations just before the definition
of the predicate or function.

Delete unneeded module qualifications on predicate and function declarations
and definitions.

Update .exp files (and if needed, .inp files) for the line number changes
that result from the above.

For tests that have more than one .exp file and where one of those files
is affected by the above, add a section to the source file header that says
which .exp file is for what grade, with XXXs for the (as yet) unknown parts.
2018-08-28 21:20:59 +10:00
Zoltan Somogyi
33eb3028f5 Clean up the tests in half the test directories.
tests/accumulator/*.m:
tests/analysis_*/*.m:
tests/benchmarks*/*.m:
tests/debugger*/*.{m,exp,inp}:
tests/declarative_debugger*/*.{m,exp,inp}:
tests/dppd*/*.m:
tests/exceptions*/*.m:
tests/general*/*.m:
tests/grade_subdirs*/*.m:
tests/hard_coded*/*.m:
    Make these tests use four-space indentation, and ensure that
    each module is imported on its own line. (I intend to use the latter
    to figure out which subdirectories' tests can be executed in parallel.)

    These changes usually move code to different lines. For the debugger tests,
    specify the new line numbers in .inp files and expect them in .exp files.
2015-02-14 20:14:03 +11:00
Zoltan Somogyi
6554ef7daa Replace "is" with "=".
Estimated hours taken: 2
Branches: main

Replace "is" with "=".
Add field names where relevant.
Replace integers with counters where relevant.
2003-05-26 09:01:46 +00:00
Zoltan Somogyi
fbfd4970df Make the debugging of minimal model tabling easier by providing a mechanism
Estimated hours taken: 32
Branches: main

Make the debugging of minimal model tabling easier by providing a mechanism
to print the contents of the nondet stack, *including* the values of the
variables in its stack frames, even for frames which are not ancestors
of the currently executing call.

runtime/mercury_stack_trace.[ch]:
	Add functions for traversing the nondet stack, and for keeping track of
	through which label control returns to each nondet stack frame, so that
	we know which label's layout structure to interpret the stack frame's
	contents. For some, this will be the return label of a call; for
	others, it will be the label of a resumption point stored in a
	redoip slot.

	Rename an old function to allow the new one to fit into our naming
	scheme.

runtime/mercury_stack_trace.[ch]:
runtime/mercury_tabling.c:
library/exception.m:
trace/mercury_trace.c:
	Add MR_ prefixes to the values of the enum returned by
	MR_stack_walk_step.

	Rename references to the renamed function.

runtime/mercury_conf_param.h:
	Add macros for debugging label names and for debugging retries (which
	needs label names, just as debugging tabling does).

	Add a macro for controlling whether mercury_debug.c prints raw
	addresses as well as offsets (for stack pointers) or label names (for
	labels). The raw pointers can be useful in debugging, but they need to
	be turned off in test cases one wants to be reproducible.

runtime/mercury_label.h:
runtime/mercury_conf_param.h:
	Move the MR_NEED_ENTRY_LABEL_ARRAY and MR_NEED_ENTRY_LABEL_INFO macros
	from mercury_label.h to mercury_conf_param.h, since mercury_debug.c
	also needs them now.

runtime/mercury_debug.c:
	addresses as well as offsets (for stack pointers) or label names (for
	labels). The raw pointers can be useful in debugging, but they need to
	be turned off in test cases one wants to be reproducible.

runtime/mercury_init.h:
runtime/mercury_wrapper.[ch]:
util/mkinit.c:
	Add a global variable pointing to a function through which the stack
	walk code in runtime/mercury_stack_trace.c can invoke code from the
	debugger to print the values of the variables in nondet stack frames
	without breaking the rule prohibiting references to the trace directory
	from the runtime directory.

runtime/mercury_wrapper.c:
	Define the succip of the dummy frame at the bottom of the nondet stack,
	to avoid dereferencing a garbage pointer during detailed stack dumps.

runtime/mercury_goto.h:
	Add a mechanism for always registering the name of a specific label,
	even if label names are not being registered in general. This mechanism
	is intended to be used for labels such as do_fail, which occur
	frequently in nondet stack traces.

runtime/mercury_context.c:
runtime/mercury_engine.c:
runtime/mercury_ho_call.c:
runtime/mercury_trace_base.c:
runtime/mercury_wrapper.c:
	Use this mechanism for the labels defined in these modules.

library/builtin.m:
	Define type_ctor_infos for the pseudotypes representing nondet stack
	frame slots unconditionally, since the debugger may now need them.

trace/mercury_trace.c:
	Add conditionally enabled to code to make debugging retry easier.

trace/mercury_trace_internal.c:
	Add a -d option to the nondet_stack command that causes it to print
	detailed nondet stack dumps, including the names and values of the
	variables in each nondet stack frame.

trace/mercury_trace_vars.c:
	Provide a mechanism for printing the variables of a stack frame
	even when that stack frame is not an ancestor of the current call.

doc/user_guide.texi:
	Document the new option of the nondet_stack command.

tests/debugger/nondet_stack.{m,inp,exp,exp2}:
	A new test case to test "nondet_stack -d".

tests/debugger/Mmakefile:
	Enable the new test case.
2001-12-04 00:44:41 +00:00