Commit Graph

3 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
74645f2293 Fix a bug that caused a core dump if the debugger attempted to look at stack
Estimated hours taken: 6
Branches: main

Fix a bug that caused a core dump if the debugger attempted to look at stack
frames with more than 64 live variables on the stack.

runtime/mercury_stack_layout.h:
	Fix a bug. The array of lval descriptors in a label layout structures
	has two components: the long descriptors and the short descriptors.
	The bug was that we were using an index with respect to the start
	of the first subarray to index into the second subarray. The fix is
	to subtract the length of the first subarray from the index first.
	(This problem rarely bit before because the first subarray's length
	is almost always zero.)

runtime/mercury_layout_util.c:
	Improve existing debugging code, but make its compilation conditional.
	The difference this makes in runtime is not significant for the
	debugger, but would be significant for native gc.

runtime/mercury_conf_param.h:
	Document the macro the debugging code is conditional on.

trace/mercury_trace_vars.c:
	Set unused fields of Var_Spec structures to explicitly invalid values,
	to avoid possible misinterpretation when using gdb.

tests/debugger/lval_desc_array.{m,inp,exp,exp2}:
	A regression test to check for the presence of the bug.

tests/debugger/Mmakefile:
	Enable the new test case.
2001-12-10 06:50:15 +00:00