Commit Graph

21 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
d03ce7dbc0 Fix some bugs in my previous diff that optimized away stack slots storing
Estimated hours taken: 8
Branches: main

Fix some bugs in my previous diff that optimized away stack slots storing
dummy values that manifested themselves as warnings from the C compiler
about integers too big to fit into 8 or 16 bits being implicitly truncated.
They did not lead to the failure of any test case, since it doesn't matter
whether the debugger gets the values it ignores (I/O states or stores)
from valid stack slots or not.

When generating RTTI for gc and the debugger, the compiler had three places
that generated references to stack slots: the return sites of calls, resume
points, and trace events. The previous diff updated only the first of these.
This diff updates the other two, and ensures there are no more.

Since the debugger needs to know whether a procedure has a pair of I/O state
arguments (e.g. when performing a retry), we add a field to proc layouts
to hold this information.

runtime/mercury_grade.h:
	Increment the debug grade runtime compatibility version number
	to reflect the change in layout structures.

runtime/mercury_stack_layout.h:
	Add an extra field to proc layouts to specify flags. At the moment,
	the only flag says whether the procedure has a pair of I/O state
	arguments.

	Add an extra field to proc layouts to specify the trace level of a
	procedure. This used to be the same as the module's trace level,
	but one of my bug fixes a couple of months ago broke that link.
	We don't yet use this field, but it makes sense to do it at the same
	time as the increment of the compatibility version number.

compiler/continuation_info.m:
	Attach to every description of a live value a description of where
	in the compiler that description was created.

	Rename the type involved to avoid an ambiguity.

	Ignore dummy types when generating resume layouts.

	Add some sanity checks.

	Add new fields to the continuation_info data structure to allow
	stack_layout.m to fill in the new fields in proc layout structures.

compiler/trace.m:
	Do not generate references to dummy values at trace events,
	except at call ports. At those ports, all live variables should
	be in registers.

compiler/stack_layout.m:
	Make the check for whether a value fits into an unsigned 8 bit value
	a direct rather than an indirect one. The indirect one assumed that
	stack slot numbers are all positive, which is now a bad assumption.

	Check for negative stack slot numbers in all RTTI stack slot
	descriptions.

	Fill in the two new slots in proc layout structures.

compiler/layout.m:
	Reserve space for the two new slots in proc layout structures.

compiler/layout_out.m:
	Output the two new slots in proc layout structures.

compiler/code_gen.m:
	Preserve the information needed by stack_layout.m for the two new
	fields.

compiler/llds_out.m:
	Add some code that ensures that we never output an integer constant
	that doesn't fit into the range of its type. Since this code is
	executed many millions of times, it is designed to be enabled only
	when the checking is manually enabled. It is normally off, but I got
	a clean bootcheck in the debug grade (which is the best stress test)
	with it enabled.

compiler/trace_params.m:
	Update a comment.

compiler/code_info.m:
	Export a function for use by trace.m.

compiler/hlds_pred.m:
	Export a predicate for use by stack_layout.m.

compiler/Mercury.options:
	Enable inlining for llds_out.m, to get rid of the sanity checking
	overhead if it is not enabled.

tests/debugger/completion.exp*:
tests/debugger/interpreter.exp*:
tests/debugger/multi_parameter.exp*:
tests/debugger/queens.exp*:
tests/debugger/print_goal.exp*:
tests/debugger/tabled_read.exp*:
tests/debugger/tabled_read_decl.exp*:
tests/debugger/declarative/io_stream_test.exp*:
tests/debugger/declarative/tabled_read_decl.exp*:
	Update these expected output files to not expect dummy values that
	aren't kept anymore.
2004-11-19 05:46:25 +00:00
Ian MacLarty
cab3c62fe7 Remove call depth numbers from standardized event printing.
Estimated hours taken: 2
Branches: main

Remove call depth numbers from standardized event printing.  This will make
maintaining the debugger test cases easier since a lot of the expected outputs
differ only in the call depth of their events, because of deep tracing of the
standard library in the decldebug grade.

Not all the debugger tests are run with standardized event printing, so
printing of call depths will still be exercised.

tests/debugger/breakpoints.exp
tests/debugger/breakpoints.exp2
tests/debugger/browser_test.exp
tests/debugger/exception_cmd.exp
tests/debugger/exception_cmd.exp2
tests/debugger/exception_cmd.exp3
tests/debugger/exception_value.exp
tests/debugger/exception_value.exp2
tests/debugger/exception_vars.exp
tests/debugger/existential_type_classes.exp
tests/debugger/existential_type_classes.exp2
tests/debugger/exported_eqv_type.exp
tests/debugger/higher_order.exp
tests/debugger/interpreter.exp2
tests/debugger/lambda_expr.exp
tests/debugger/loopcheck.exp3
tests/debugger/loopcheck.inp2
tests/debugger/nondet_stack.exp
tests/debugger/nondet_stack.exp2
tests/debugger/polymorphic_output.exp
tests/debugger/polymorphic_output.exp2
tests/debugger/polymorphic_output.exp3
tests/debugger/print_goal.exp
tests/debugger/print_table.exp
tests/debugger/queens.exp
tests/debugger/queens.exp2
tests/debugger/resume_typeinfos.exp
tests/debugger/retry.exp
tests/debugger/retry.exp2
tests/debugger/tabled_read.exp
tests/debugger/tabled_read_decl.exp
tests/debugger/tabled_read_unitize.exp
tests/debugger/type_desc_test.exp
tests/debugger/declarative/aadebug.exp
tests/debugger/declarative/app.exp
tests/debugger/declarative/args.exp
tests/debugger/declarative/big.exp
tests/debugger/declarative/filter.exp
tests/debugger/declarative/if_then_else.exp
tests/debugger/declarative/input_term_dep.exp
tests/debugger/declarative/io_stream_test.exp
tests/debugger/declarative/io_stream_test.exp2
tests/debugger/declarative/output_term_dep.exp
tests/debugger/declarative/propositional.exp
tests/debugger/declarative/remember_modes.exp
tests/debugger/declarative/special_term_dep.exp
tests/debugger/declarative/tabled_read_decl.exp
tests/debugger/declarative/trust.exp
	Remove call depth numbers from output run with standardized event
	printing.

trace/mercury_trace_internal.c
	Remove call depth from standardized event printing.
2004-11-16 00:16:44 +00:00
Ralph Becket
a8ffd3680c Change the compiler and tools so that .' and not :' is now used as the
Estimated hours taken: 14
Branches: main

Change the compiler and tools so that `.' and not `:' is now used as the
module separator in all output.

Infix `.' now has associativity yfx and priority 10.

NEWS:
	Report the change.

configure.in:
	Amend the test for an up-to-date Mercury compiler to check whether
	it recognises `.' as a module qualifier.

compiler/code_gen.m:
compiler/error_util.m:
compiler/hlds_out.m:
compiler/prog_out.m:
compiler/prog_util.m:
compiler/rl_exprn.m:
compiler/rl_gen.m:
compiler/source_file_map.m:
compiler/unused_args.m:
library/io.m:
library/rtti_implementation.m:
library/type_desc.m:
runtime/mercury_debug.c:
runtime/mercury_deconstruct.c:
runtime/mercury_stack_trace.c:
	Change `:' to `.' as module separator for output.

compiler/mercury_to_mercury.m:
compiler/prog_io_typeclass.m:
	As above.
	Fixed a bug where `.' was not being recognised as a module separator.

doc/reference_manual.texi:
	Report the change.

library/term_io.m:
	Ensure that infix `.' is written without surrounding spaces.

tests/hard_coded/dot_separator.m:
tests/hard_coded/dot_separator.exp:
tests/hard_coded/Mmakefile:
	Test case added.
2003-01-17 05:57:20 +00:00
Mark Brown
ff53936dbc Print list terms using list syntax when printing in "flat" format.
Estimated hours taken: 3
Branches: main

Print list terms using list syntax when printing in "flat" format.  As
well as the usual functor/arity style abbreviation, list elements can be
replaced by an ellipsis, "...", if beyond the depth or size limit.

browser/browse.m:
	Handle the functors [|]/2 and []/0 specially.

doc/user_guide.texi:
	Be more explicit with the meaning of "depth" and "size".  In
	particular, define what they mean for lists.

tests/debugger/*.exp:
tests/debugger/*.exp2:
tests/debugger/declarative/*.exp:
tests/debugger/declarative/*.exp2:
	Update test outputs to reflect the change.
2002-10-31 08:21:20 +00:00
Zoltan Somogyi
5345fa4643 Fix (most of) the expected outputs of the debugger test cases after my recent
Estimated hours taken: 2
Branches: main

Fix (most of) the expected outputs of the debugger test cases after my recent
changes. In some cases, this involved modifying the input scripts to make tests
less dependent on event numbers.

tests/debugger/Mmakefile:
	Use MDB_STD instead of MDB for more test cases than before.

	Disable the output_term_dep test case, since it doesn't actually test
	anything that the other test cases don't test, and it prints so many
	events that its .exp files depend on event numbers far too much.

tests/debugger/*.exp*:
tests/debugger/*.inp:
	Update expected outputs, and in some cases, the inputs.
2002-09-13 03:37:45 +00:00
Zoltan Somogyi
5f20c37b7a Add a mechanism for standardizing the event and call sequence numbers in
Estimated hours taken: 4
Branches: main

Add a mechanism for standardizing the event and call sequence numbers in
debugger output. The mechanism is a global flag whose value is set from
MERCURY_OPTIONS. It is intended to be used only in our own internal testing.

runtime/mercury_trace_base.[ch]:
	Define the global, MR_standardize_event_details.

	Move the documentation of several globals from the .c to the .h file,
	since that is where their users will look. Put those globals in a
	consistent order.

	Add functions for standardizing event and call sequence numbers,
	and use them when printing event details.

runtime/mercury_wrapper.c:
	Set MR_standardize_event_details when given the option -de.

runtime/mercury_stack_trace.c:
library/exception.m:
trace/mercury_trace_internal.m:
	Respect MR_standardize_event_details.

tests/Mmake.common:
	Define the make variable MDB_STD, which is like MDB except it also
	puts -de in MERCURY_OPTIONS.

tests/debugger/Mmakefile:
	Use MDB_STD instead of MDB for test cases that can benefit from
	standardizing event and call sequence numbers.

	Put the rules for the test cases in alphabetical order.

tests/debugger/*.exp*:
	Update expected outputs after this change.
2002-09-11 07:20:31 +00:00
Simon Taylor
07c0cf8ba6 Improve variable naming in the debugger. Where possible, use
Estimated hours taken: 10
Branches: main

Improve variable naming in the debugger. Where possible, use
the user's argument names rather than `HeadVar__N'.

compiler/clause_to_proc.m:
	Use the user's names for the arguments of
	`:- pragma foreign_proc' procedures.

compiler/simplify.m:
	When performing excess assignment elimination with `--trace deep',
	don't replace a variable with a meaningful name with `HeadVar__N'
	or an unnamed variable.

compiler/trace_params.m:
	Add a predicate `trace_level_needs_meaningful_var_names'
	for use by simplify.m.

compiler/typecheck.m:
	For predicates with a single clause, attempt to replace the
	`HeadVar__N' variables with the user's original head variables.

trace/mercury_trace_declarative.c:
trace/mercury_trace_vars.c:
	Don't assume head variables have names of the form `HeadVar__N'.

	Print the argument number when printing the names of
	head variables.

tests/debugger/browser_test.inp:
tests/debugger/completion.inp:
	Change names of variables in `print' commands.

tests/debugger/*.exp:
tests/debugger/*.exp2:
tests/debugger/declarative/dependency.exp:
tests/invalid/aditi_errors.err_exp:
tests/invalid/mode_inf.err_exp:
tests/invalid/record_syntax_errors.err_exp:
	Update expected output.
2002-06-05 16:41:31 +00:00
Simon Taylor
15ef019bbf Remove a stray newline which was added in my last change.
Estimated hours taken: 0.1
Branches: main

tests/debugger/interpreter.exp2:
	Remove a stray newline which was added in my last change.
2001-09-26 04:33:17 +00:00
Simon Taylor
5544aed7ff Change the list constructor from ./2' to [|]/2'. `./2' will
Estimated hours taken: 3
Branches: main

Change the list constructor from `./2' to `[|]/2'. `./2' will
eventually become the module qualification operator.

library/parser.m:
library/io.m:
library/sparse_bitset.m:
library/std_util.m:
library/term_io.m:
compiler/mercury_to_mercury.m:
compiler/prog_io_dcg.m:
compiler/prog_io_goal.m:
compiler/prog_io_pragma.m:
compiler/prog_io_typeclass.m:
compiler/prog_io_util.m:
browser/interactive_query.m:
extras/moose/grammar.m:
extras/moose/moose.m:
extras/morphine/source/generate_call_site_cov.m:
extras/xml/xml.encoding.m:
samples/muz/higher_order.m:
tests/debugger/declarative/app.m:
tests/dppd/transpose_impl.m:
tests/hard_coded/ground_dd.m:
tests/hard_coded/split_c_files.m:
	Change all references to `./2' to use `[|]/2' instead.

compiler/typecheck.m:
	Handle `./2' as a special case in `report_error_undef_cons'.

	Warn about module list not being imported if `[|]/2' is undefined.

compiler/llds_out.m:
util/mdemangle.c:
profiler/demangle.m:
	Add name conversions for `[|]' (f_cons) and `[]' (f_nil).

NEWS:
doc/reference_manual.texi:
w3/tutorial/lists-n-things.m4:
	Document the changes.

tests/debugger/{,declarative}/*.exp*:
	Update test case results. For some tests the output changed
	because they output lists in the non-pretty format. For others,
	the output changed because the alphabetical ordering of the
	constructors of type `list/1' changed, so the numbering of
	the switch branches in the goal paths changed.
2001-09-25 09:37:12 +00:00
Fergus Henderson
9f3931a8e9 Update to reflect the results of my recent bug fixes.
Estimated hours taken: 0.25

tests/debugger/*.exp:
tests/debugger/*.exp2:
	Update to reflect the results of my recent bug fixes.
1999-11-20 01:03:27 +00:00
Zoltan Somogyi
60238068ac Compile the files in the library directory with --trace minimum by default,
Estimated hours taken: 1

Compile the files in the library directory with --trace minimum by default,
which has no effect in non-debugging grades and causes the library to be
shallow traced, not deep traced, in debugging grades.

This is probably what most users want, and it makes it much easier to
maintain the expected output of the debugging test cases in debugging grades.

library/Mmakefile:
	Add --trace minimum to MCG.

tests/*/*:
	Update the test cases both for this change and for my previous change,
	the addition of line numbers.
1999-11-15 08:14:22 +00:00
Fergus Henderson
303d21820c Adjust the whitespace in the *.exp2 files to match
Estimated hours taken: 0.5

tests/debugger/*.exp2:
        Adjust the whitespace in the *.exp2 files to match
        what the debugger actually outputs.  In particular,
	use spaces rather than tabs.
1999-10-31 22:48:11 +00:00
Fergus Henderson
b729c38bfd Adjust the whitespace in the *.exp2 files to match
Estimated hours taken: 0.5

tests/debugger/*.exp2:
	Adjust the whitespace in the *.exp2 files to match
	what the debugger actually outputs, in line with zs's
	changes to the *.exp files on 1999/05/27.
1999-10-26 07:52:34 +00:00
Fergus Henderson
0bf21c2c6c Update the expected output for these test cases to reflect the
Estimated hours taken: 0.1

tests/debugger/queens.exp:
tests/debugger/browser_test.exp:
tests/debugger/interpreter.exp:
tests/debugger/interpreter.exp2:
	Update the expected output for these test cases to reflect the
	renumbering of mdb variables starting from 1 rather than from 0.
1999-06-30 15:51:01 +00:00
Fergus Henderson
f7df319d0c GNU readline always echos the inputs, so if readline support is
Estimated hours taken: 2

trace/mercury_trace_internal.c:
	GNU readline always echos the inputs, so if readline support is
	enabled, then ignore the MR_echo_commands variable,
	and report an error if the user tries to use `echo off'.
	Also, if we're not using readline, then echo the `echo on' command,
	so that the output will be the same as with readline.

tests/debugger/*.inp:
	Ensure that `echo on' is always the first command.

tests/debugger/*.exp:
tests/debugger/*.exp2:
	Update to reflect the changes to *.inp,
	and to include the echo of the `echo on' command.

	(Also delete the mdb intro banners from *_lib.exp*,
	because mdb is invoked with MERCURY_SUPPRESS_MDB_BANNER=yes.
	The *_lib* files are in fact currently not used, so they should
	probably be just deleted, I think.  But I'll do that as
	a separate change.)
1999-04-08 16:04:27 +00:00
Fergus Henderson
682635a8a7 Fix the test result to match what is actually output:
Estimated hours taken: 0.1

tests/debugger/interpreter.exp2:
	Fix the test result to match what is actually output:
	delete the newline at the end of the file.
1998-11-17 08:32:33 +00:00
Fergus Henderson
6accb8113d Fix some spurious test cases failures for the debugging test cases.
Estimated hours taken: 0.25

Fix some spurious test cases failures for the debugging test cases.

tests/debugger/*.exp2:
	Add alternative expected outputs for the test cases that
	produce different results when built in debug grades (i.e.
	when linked with a library was built with debugging enabled).
1998-11-16 07:26:58 +00:00
Fergus Henderson
1aa8f73934 Change the mdb `print' command so that it invokes the non-interactive
Estimated hours taken: 2.75

Change the mdb `print' command so that it invokes the non-interactive
version of the term browser, and change the way the browser is invoked
so that the browser state is preserved across multiple invocations
of `print' or `browse' in a single mdb session.

browser/browse.m:
	Make `browser_state' an abstract type.
	Add new predicate `browse__init_state' to initialize that ADT.
	Change the interface to `browse__browse' so that it takes and
	returns the old and new browser_states.
	Add a new predicate `browse__print' to replace the old
	`browse__portray_root' predicate; this is the non-interactive
	version of the browser.  It calls io__write_univ if the term
	is small enough, and browse__portray (with flat format) otherwise.
	Export the `browse__print' and `browse__init_state' predicates to C.
	Delete the predicates for formatting terms as strings, since that
	code was a potential double-maintenance problem and was not needed.

library/io.m:
	Export `io__write_univ', for use by browser/browse.m.

trace/mercury_trace_browse.h:
trace/mercury_trace_browse.c:
	New files.  These provide an interface to the browser
	which preserves the browser state in a C static variable.

trace/Mmakefile:
	Add the new files mercury_trace_browse.{h,c} to the appropriate
	file lists.

trace/mercury_trace_internal.c:
	Change the `browse' and `print' mdb commands to use the new
	functions defined in mercury_trace_browse.{h,c} rather than
        calling browser__browse and io__print (respectively), and don't
	print a newline afterwards, since the browser does that itself.
	Delete the old hack to avoid printing out HLDS and ModuleInfo,
	since it's not necessary any more.

doc/user_guide.texi:
	Update the documentation for the `browse' and `print' commands
	to reflect these changes.

tests/debugger/*.exp:
tests/debugger/*.exp2:
	Update the expected output from the debugger to reflect these changes.
1998-11-15 16:47:52 +00:00
Fergus Henderson
f3bd28dc60 Fix some spurious test cases failures for the debugging test cases.
Estimated hours taken: 0.5

Fix some spurious test cases failures for the debugging test cases.

tests/debugger/*.exp2:
	Add alternative expected outputs for the test cases that
	produce different results when built in debug grades (i.e.
	when linked with a library was built with debugging enabled).
1998-11-08 23:42:11 +00:00