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.
Estimated hours taken: 0.3
Branches: main
Fix failing debugger/cond test in .debug grades by using standardized event
printing and calling `register --quiet' at the start of the test.
tests/debugger/Mmakefile
Use standardized event printing.
tests/debugger/cond.inp
Call `register --quiet' at the start of the session.
tests/debugger/cond.exp
Update expected output.
Estimated hours taken: 16
Branches: main, release
Implement a new mdb command, "condition", which associates a condition with
an existing breakpoint. The condition is a match between a variable live at
the breakpoint, or a part thereof, and a term provided as part of the condition
command. If execution arrives at the breakpoint but the match doesn't have the
required outcome, execution will continue without stopping.
NEWS:
Mention the new capability.
doc/user_guide.texi:
Document the new capability.
runtime/mercury_trace_term.[ch]:
This new module has facilities for converting strings to a structured
representation of terms. The debugger uses this representation for the
term being matched.
runtime/Mmakefile:
Add the new module to the list of modules in the runtime library.
browser/cterm.m:
This new module tests whether a value in the program being debugged
matches a term represented by the data structure defined in
mercury_trace_term.
browser/mdb.m:
Include the new module in the browser library.
trace/mercury_trace_spy.[ch]:
Change the code that checks for breakpoints to check breakpoints'
conditions.
Fix an old bug: set the number of the most recent breakpoint
even when reusing an existing slot.
trace/mercury_trace_vars.c:
Change the code that checks for breakpoints to also evaluate the
condition, if any.
Provide the facilities required to implement conditions. Besides
exporting some previously private functions, this involved breaking up
two existing functions into two pieces each, because condition checking
wanted to reuse only parts of them.
Modify the implementation of the functions manipulating breakpoints
to handle the new parts of spy point structures.
Modify the way we delete spy point structures to make doubly sure
that we don't free memory twice; it is now MR_delete_spy_point that
sets the spy_exists field to FALSE, after checking it.
Give more meaningful names to some variables.
trace/mercury_trace_internal.[ch]:
Implement the condition command.
Conform to the changes in mercury_trace_vars.c
When the condition of a breakpoint cannot be evaluated, print an error
message.
Extend the command parser to support double quotes, since this is now
needed to allow strings in terms in the condition command.
Flush any error messages resulting from an mdb command immediately
after the command. This was useful in debugging the change.
tests/debugger/cond.{m,inp,exp*}:
Add this new test case to test the new capability.
tests/debugger/Mmakefile:
Include the new test case in the list of test cases.
tests/debugger/completion.exp:
tests/debugger/mdb_command_test.inp:
Update to reflect the new command.
tests/debugger/cmd_quote.exp:
Update the error message.