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.
Estimated hours taken: 12
Get the debugger to sort variables better.
trace/mercury_trace_vars.[ch]:
A new module to manage the debugger's information about the variables
live at the current program point (which can be defined as the
combination of a specific event and an ancestor level).
This new module centralizes the management of the (sorted) list of
current variables. This in turn allows us to use a better sorting
method, one that orders VarName15 correctly wrt both VarName2 and
VarName.
The new module also uses the type, not the name, of a variable
to decide whether to exclude it from the list of variables
that may be presented to the user (e.g. if it is a typeinfo
or a typeclassinfo).
trace/mercury_trace_internal.c:
trace/mercury_trace_external.c:
Use the new module's facilities. This factors out some "mostly"
common code.
trace/Mmakefile:
Add the new module.
runtime/mercury_layout_util.[ch]:
Remove the code recently moved here from trace/mercury_trace_internal,
as well as the filtered versions of some functions, since they are
not needed anymore.
Move the code for MR_make_var_list to trace/mercury_trace_external,
since that is the only place where it is used (or is at all likely
to be used). Since its new home is next to several very similar
functions, this should also reduce the probability that any required
maintenance will be overlooked. Also alter its coding style to conform
to its new neighbours.
Move the definition of MR_Var_Spec to trace/mercury_trace_vars.h.
tests/debugger/*.exp:
Update the expected output files. In most cases, this is just because
the new module outputs different white space, but in some cases, it
also reflects that the debugger now prints variables in a different
order.
Estimated hours taken: 5
Use the same method of input for the browser as for the internal
tracer. Previously, the browser did input via the Mercury library
and the internal tracer did input via readline (if available). This
did not work properly if files were redirected into stdin, which meant
that test cases could not be written for the browser. This change
also adds a test case.
browser/util.m:
Add a predicate, util__trace_getline/4, which does input via
the same method used by the internal debugger.
browser/parse.m:
Call util__trace_getline/4 instead of io__read_line/3.
browser/browse.m:
Pass the prompt to browser/parse.m as a string, rather than
printing it before calling.
trace/mercury_trace_internal.c:
trace/mercury_trace_internal.h:
Declare MR_trace_getline extern.
runtime/mercury_init.h:
runtime/mercury_wrapper.c:
runtime/mercury_wrapper.h:
util/mkinit.c:
Make MR_trace_getline available to the browser via a function
pointer.
tests/debugger/Mmakefile:
Add the new test case.
tests/debugger/browser_test.m:
tests/debugger/browser_test.inp:
tests/debugger/browser_test.exp:
The new test case.
runtime/mercury_trace_base.c:
runtime/mercury_trace_base.h:
Export MR_tracing_not_enabled() for use by browser/util.m.