Estimated hours taken: 1
Branches: main
Make smart recompilation work where the module name doesn't
match the file name (e.g. in the compiler).
compiler/modules.m:
Where the module name doesn't match the file name
and there is a Mercury.modules file, pass the
module name to mmc, not the file name.
compiler/source_file_map.m:
Add a predicate `have_source_file_map' for use
by modules.m.
Don't put the Mercury.modules file in the Mercury
subdirectory. It's the user's responsibility to clean
it up, so it should be in the main directory.
compiler/mercury_compile.m:
Suggest creating the Mercury.modules file if passed
a file name which doesn't match the module name.
compiler/Mmakefile:
browser/Mmakefile:
Generate the Mercury.modules file.
tests/hard_coded/Mmakefile:
The Mercury.modules file is no longer generated in
the Mercury subdirectory.
Estimated hours taken: 48
Branches: main
Make I/O actions known to the declarative debugger. The debugger doesn't do
anything with them yet beyond asking about their correctness.
browser/io_action.m:
New module for representing I/O actions, and for constructing the map
from I/O action numbers to the actions themselves.
browser/mdb.m:
Include the new module.
browser/declarative_analysis.m:
Make the map from I/O action numbers to the actions themselves part
of the analyzer state, since conversions from annotated trace nodes
to EDT nodes may now require this information. This information is
stored in the analyzer state because only the analyser needs this
information (when converting annotated trace nodes to EDT tree nodes).
It is not stored in the trace node store because its lifetime is
different: its contents does not change during a tree deepening
operation.
browser/declarative_execution.m:
Store the current value of the I/O action counter with each call and
exit node. The list of I/O actions associated with the atom of the exit
node is given by the I/O actions whose counters lie between these two
values (initial inclusive, final exclusive).
browser/declarative_debugger.m:
browser/declarative_oracle.m:
Distinguish atoms associated with exit nodes from atoms associated with
call nodes, since the former, but not the latter, now have a list of
I/O actions associated with them.
browser/declarative_user.m:
Add mechanisms for printing and browsing the I/O actions associated
with EDT nodes and bugs.
runtime/mercury_trace_base.[ch]:
Move the code for finding an I/O action here from the file
mercury_trace_declarative.c, for use by browser/io_action.m.
runtime/mercury_layout_util.[ch]:
Move a utility function here from mercury_trace_declarative.c,
for use by the code moved to mercury_trace_base.c.
trace/mercury_trace_declarative.c:
When invoking the front end, pass to it the boundaries of the required
I/O action map. Cache these boundaries, so we can tell the front end
when reinvocation of the back end by the front end (to materialize
previously virtual parts of the annotated trace) does not require
the reconstruction of the I/O action map.
trace/mercury_trace_vars.[ch]:
Separate out the code for finding an I/O action from the code for
browsing it, for use in mercury_trace_declarative.c.
Note places where the implementation does not live up to the
documentation.
trace/mercury_trace.[ch]:
Add a parameter to MR_trace_retry that allows retries to cross I/O
actions without asking the user if this is OK.
trace/mercury_trace_internal.c:
trace/mercury_trace_external.c:
Pass MR_FALSE as this new parameter to MR_trace_retry.
tests/debugger/declarative/tabled_read_decl.{m,inp,exp}:
A slightly modified copy of the tests/debugger/tabled_read_decl test
case, to check the declarative debugger's handling of goals with I/O
actions.
tests/debugger/declarative/Mmakefile:
Enable the new test case.
Estimated hours taken: 2
Branches: main
Fix link problems on murlibobo caused by my recent changes
to the way libmer_std.so and libmer_browser.so are built.
The problem was due to shared libraries being renamed
after they were built without telling the linker.
library/mer_std.m:
browser/mer_browser.m:
Empty modules used to generate the libraries with
the correct names.
library/Mmakefile:
browser/Mmakefile:
Build and install libmer_std.* and libmer_browser.*
rather than liblibrary.* and libmdb.*.
Mmake.workspace:
Mmake.common.in:
Make sure SO_LOCATIONS_DIR is in ml's environment
when building the libraries.
Fix the order of the `-l' options.
compiler/Mmakefile:
Make sure `main.o' comes before the library `.a' files
on the ml command line.
doc/Mmakefile:
Add mer_std.m to the list of files for which documentation
should not be generated.
trace/Mmakefile:
Add the grade-specific library directory to the rpath
for libmer_trace.so.
Estimated hours taken: 1
Branches: main
browser/declarative_user.m:
Require users to either type commands in full or to write the minimum
abbreviation. Typing nonsense commands that happen to start with the
same initial letter as a command will no longer "work". This is
necessary because later changes will add more commands.
Make the parsing of user commands higher level and more easily
maintainable.
Estimated hours taken: 10
Branches: main
Implement a committed choice version of 234-trees which uses
compare_representation instead of builtin compare. Use this to implement
the declarative debugger's oracle knowledge base, instead of the standard
library map. We do this because the keys used by the oracle may contain
non-canonical terms, which would cause a runtime abort if used as map
keys.
This completes the changes to the declarative debugger to support the
debugging of higher order code. (There is still a problem in that the
declarative debugger back end does not filter out external events for
higher order calls. This means that the declarative debugger asks
questions about what are effectively calls to call/N, which is not
necessary since we assume that call/N is correct. This is a problem
unrelated to this change, so I will deal with it separately.)
browser/tree234_cc.m:
The new sub-module of mdb, which implements the 234-trees.
browser/declarative_oracle.m:
Use the new module instead of library/map.m. Propagate the
effect of the calls to committed choice code.
browser/mdb.m:
Include the new module.
tests/debugger/declarative/Mmakefile:
Enable two old test cases, higher_order and ite_2, that now work
after this change. Add a new test case that tests closures
with some arguments applied.
tests/debugger/declarative/higher_order.exp:
tests/debugger/declarative/higher_order.inp:
tests/debugger/declarative/ite_2.exp:
tests/debugger/declarative/ite_2.inp:
Provide input and expected output for these tests.
tests/debugger/declarative/ho2.exp:
tests/debugger/declarative/ho2.inp:
tests/debugger/declarative/ho2.m:
New test case.
Estimated hours taken: 24
Branches: main
Change the definitions of decl_question and decl_answer in the declarative
debugger. Each question now contains a reference to the EDT node that
generated the question, and each answer contains the reference from the
question it applies to. Previously, the answers referred to the questions
themselves.
This change means that the analyser no longer needs to unify questions
to determine what to do with an answer. The reason we need to avoid
this is that questions may contain higher order terms, and these will
cause a runtime abort if unified. Also, by using our new approach it is
possible to simplify the analyser in a number of ways.
This is the first part of a larger change to support declarative debugging
of higher order code. The main task remaining is to avoid using comparison
of questions in the oracle. But this will require a different approach
than the one taken here, because the oracle is interested in the value of
the question, not just the identity of it.
browser/declarative_*.m:
Propagate the effect of the changes to decl_question and decl_answer.
Fix some comments which are out of date, and elaborate on some others
which don't give enough information.
browser/declarative_analyser.m:
Remove the definition of the suspect/1 type. Its main purpose
was to associate a question with its EDT node, but this is no
longer required. Update the places that used suspect(T) to instead
use either decl_question(T) or just T, as appropriate.
Separate out the code which calculates the analyser response. This
requires adding some fields to the analyser state, but this in turn
means that the processing of answers can be greatly simplified.
This should also make implementing more sophisticated search
strategies possible, which is something we want to do in the
future.
browser/declarative_debugger.m:
Make the changes to the two exported types. Export a function which
extracts the EDT node from the question.
browser/declarative_oracle.m:
browser/declarative_user.m:
Add a type parameter to oracle_response and user_response, similarly
to the change to the other types.
tests/debugger/declarative/Mmakefile:
tests/debugger/declarative/dependency2.exp:
tests/debugger/declarative/dependency2.inp:
tests/debugger/declarative/dependency2.m:
A test case, which tests for a bug I encountered when developing
this change.
tests/debugger/declarative/family.exp:
Because of the change to the way the analyser matches up the answers
with the EDT, a different but equally valid instance of the same bug
is chosen in part of this test case. Update the expected output to
reflect this.
Estimated hours taken: 8
Branches: main
Factor out the common Mmake code to set up the mmc, mgnuc
and ml flags when building the Mercury compiler and libraries.
Use options, not environment variables. This will make it simpler
to use `mmc --make' to compile the compiler.
Mmake.workspace:
Similar to tools/lmc. Sets up Mmake variables to
use the library files in a workspace rather than
an installed library.
configure.in:
Check for the `--no-mercury-stdlib-dir' mmc option.
Bootstrap CVS tag: bootstrap_20020429_stdlib_dir
Mmake.common.in:
*/Mmakefile:
Move common code into Mmake.workspace.
browser/Mmakefile:
library/Mmakefile:
Avoid invoking the linker explicitly when creating
libraries of Mercury code. That won't work well
with `mmc --make'.
tools/bootcheck:
tests/Mmake.common:
Use Mmake.workspace instead of setting up environment
variables in bootcheck.
scripts/Mmake.vars.in:
mmc compiles split C files to object code itself,
so pass `--cflags "$(ALL_CFLAGS)"' to mmc when
compiling with `--split-c-files'.
browser/interactive_query.m:
Use `mmc --make' when compiling the query. This is needed
to make tests/debugger/interactive_query.m work when linking
against a workspace using options rather than environment
variables. This also fixes a bug -- mmc options were being
passed to ml.
Clean up after the query.
tests/debugger/Mmakefile:
tests/debugger/interactive.inp:
tests/debugger/interactive.inp.subdirs:
tests/debugger/interactive.inp.nosubdirs:
tests/debugger/interactive.exp:
tests/debugger/interactive.exp2:
Generate the input file to this test so that MCFLAGS
and MC_MAKE_FLAGS (from Mmake.workspace) are used when
compiling queries.
tests/debugger/Mmakefile now sets SHELL to /usr/local/bash
to allow the use of $(...) style command substitution
(`...` style command substitution can't be nested).
tests/warnings/Mmakefile:
tests/dppd/Mmakefile:
Include tests/Mmake.common.
tools/*:
scripts/c2init.in:
scripts/ml.in:
Update the lists of files containing the library names.
Estimated hours taken: 0.1
Branches: main
browser/declarative_analyser.m:
Document the type variable naming conventions for mercury_edt.
browser/declarative_execution.m:
Document the type variable naming conventions for annotated_trace.
browser/declarative_debugger.m:
Document the type edt_node/1.
Estimated hours taken: 60
Branches: main
Redesign the way the declarative debugger tracks dependencies, to avoid bugs
and make the code comprehensible. This required tackling an issue we could
ignore before: the typeinfos added to procedure arguments by the compiler.
browsers/declarative_debugger.m:
Rewrite the dependency algorithm from scratch. It now has three phases:
materializing the contour leading up to the relevent point in the
procedure body, using that contour to construct a list of the conjoined
primitive operations executed up to that point by the procedure body,
and tracking the source of the marked subterm in this list of
primitives.
Add a mechanism to print out the result of the dependency tracking
algorithm if a flag is set, for testing and debugging.
browsers/declarative_analyser.m:
Transmit the result of the dependency tracking algorithm to where
it may be printed out.
browsers/declarative_user.m:
Update the user interface to make it switchable between viewing atoms
from the user's perspective (with compiler-generated arguments hidden)
and the implementor's perspective (with compiler-generated arguments
visible). The default view is the user view.
browsers/declarative_execution.m:
Add the immediate parent's goal path to the representation of call
events; this allows us to place the call in the body of its parent.
Expand the representation of atom arguments to include their HLDS
variable numbers, and a boolean that says whether the argument
is a programmer-visible headvar.
Use this extra information to add support for indexing lists of
arguments from either the user view or the implementor view.
Add field names to several types.
browsers/program_representation.m:
Add a field to plain calls, giving the name of the module defining
the called procedure. This is necessary to reliably distinguish
the builtin unify and compare procedures, calls to which must be
handled specially because they generate no events. (They don't need to,
since they are correct by construction.)
Add mechanisms for converting goal paths from strings to structured
terms, for use by the dependency tracking code.
Add tests on atomic goals, for use by the dependency tracking code.
Add a mechanism to let C code retrieve the types of proc_reps as well
as goal_reps.
compiler/prog_rep.m:
Fill in the module name field in plain calls.
trace/mercury_trace_vars.[ch]:
Add functions to get information about a variable specified by HLDS
number.
trace/mercury_trace_declarative.c:
Include typeinfos in the atoms constructed at interface events.
(The same code will work for typeclassinfos as well, once they
become deconstructable and hence printable.)
Fill in the extra slot in call events, and the extra slots in
representations of atom arguments.
trace/mercury_trace_internal.c:
Fix a bug in the implementation of the proc_body command: the
type of the proc_rep slot is proc_rep, not goal_rep.
tests/debugger/declarative/dependency.{m,inp,exp}:
A new test case to exercise dependency tracking. It cooperates with
instrumentation code in the browser directory to print out the result
of each trace_dependency operation.
The test case also tests the proc_body command.
tests/debugger/declarative/Mmakefile:
Enable the new test case.
Estimated hours taken: 3
Branches: main
Make the commands that update the browser parameters within the browser itself
affect the parameter settings only for the current browser caller type (print,
print all, or browse).
browser/browse_info.m:
Add the current call type to the browser state.
Add a more convenient mechanism for setting the parameters only for a
specified caller type.
Make some existing code look nicer.
browser/browse.m:
When setting parameters, set them only for the current caller type.
tests/debugger/browse_pretty.exp:
Update the expected output of this test case.
Estimated hours taken: 2
Branches: main
Add two pieces of information that will be needed to an upcoming change
to the representation of procedure bodies in the declarative debugger.
The first piece is the full list of head vars. This is needed now because the
debugger no longer ignores variables of type type_info, and thus the Nth
headvar is no longer guaranteed to be variable number N. The second piece
is a cut/no_cut indicator in `some' goals. This is needed to allow us to
reconstruct goal paths exactly as we traverse goal representations.
browser/program_representation.m:
Make the two data structure changes described above.
browser/*.m:
Trivial changes to conform to the new data structures.
compiler/prog_rep.m:
Create the updated data procedure representation.
compiler/*.m:
Record and transmit the information needed by the updated procedure
representation.
runtime/mercury_stack_layout.h:
Update the documentation of the relevant field in proc_layouts.
Estimated hours taken: 1
Branches: main
Fix a bug that broke tests/interactive_query in grade
asm_fast.gc.tr.rt.
browser/dl.m:
Change the code for constructing closures so that it does not
assume so much about how Mercury types get layed out in memory.
Previously it was assuming that certain types with only one
functor will have the same representation as closures, and in
particular that they will have the same primary tag (zero),
but that assumption is false with --reserve-tag.
The fix was to write the code to allocate the closure
structure in C rather than Mercury.
Estimated hours taken: 2
Branches: main
Get the debugger's interactive query mechanism to print out details of
non-canonical types (e.g. higher-order types).
browser/interactive_query.m:
Use `io__write_cc' rather than `io__write', and hence declare the
argument passed to `builtin_aggregate' as `cc_multi' rather than `det'.
library/std_util.m:
Add modes to `builtin_aggregate' and `do_while' in which the
collector predicate has determinism `cc_multi'.
library/builtin.m:
Add impure variants of `promise_only_solution' and
`promise_only_solution_io', for use by std_util.m.
Estimated hours taken: 0.1
Branches: main
browser/Mmakefile:
Disable deforestation when compiling browser/declarative_user.m
to work around a bug which causes a compiler abort.
Estimated hours taken: 0.2
Branches: main
browser/declarative_user.m:
Call the cc_multi version of io__write.
library/io.m:
Add a cc_multi mode for io__write_list/6.
NEWS:
Mention the change to io.m.
Estimated hours taken: 1
Branches: main
browser/interactive_query.m:
Use the correct object file name when --use-subdirs is specified.
tests/debugger/Mmakefile:
tests/debugger/interactive.inp:
tests/debugger/interactive.inp.subdirs:
tests/debugger/interactive.inp.nosubdirs:
tests/debugger/interactive.exp:
tests/debugger/interactive.exp2:
Use a different input file for the `interactive' test case
depending on whether `--use-subdirs' is enabled.
The .inp.subdirs file contains the line `mmc_options --use-subdirs'.
We strip this line out of the output before comparing with
the .exp* files.
Estimated hours taken: 50
Branches: main
Allow the debugger to print higher order values and typeinfos, mainly by
making the committed choice modes of the predicates in deconstruct.m to
deconstruct higher order values and typeinfos. (The non committed choice
versions will continue to return only placeholders.)
Having the debugger print typeinfos is occasionally useful but more often
it is just distracting. This change therefore adds a new debugger command,
"print_optionals", that toggles the printing of optional values. For now,
the only optional values are typeinfos.
NEWS:
Mention the new capability and the new predicates in the library.
Mention the predicates added previously that allow the caller to
specify how non-canonical terms should be handled, since the change
in their semantics that we anticipated when they were added has now
happened, and their semantics should now be more stable.
browser/browser_info.m:
Use the predicates in the deconstruct.m instead of std_util,
to make the choice of noncanonical term method handling explicit.
browser/browse.m:
When writing small terms using io__write_univ, explicitly use
the same noncanonical term handling method as browser_info.m
library/io.m:
Add predicates to retrieve the current input and output streams.
Add versions of io__write_univ that specify the stream and maybe
the method of handling noncanonical terms.
Add a mode to io__write_list that allows the closure that prints the
list elements to be cc_multi.
All of these are for the new functionality in the browser.
runtime/mercury_ml_expand_body.h:
In committed choice contexts, deconstruct closures as if they were
ordinary terms, with the function symbol being the name of the
predicate/function and the arguments being the terms stored in
the closure.
In committed choice contexts, deconstruct typeinfos as if they were
ordinary terms, with the function symbol being the name of the type
constructor and the arguments being the type constructor's arguments.
runtime/mercury_type_info.[ch]:
Add a new function, MR_collapse_ctor_equivalences, for use by
mercury_ml_expand_body.h.
Delete a redundant function comment.
library/deconstruct.m:
Document the changes in the behavior of the predicates defined in this
module as a result of the change to mercury_ml_expand_body.h.
runtime/mercury_ho_call.h:
runtime/mercury_stack_layout.h:
Add prefixes on structure field names that did not have them.
browser/dl.m:
Add prefixes where needed by the changes to mercury_ho_call.h.
runtime/mercury_layout_util.[ch]:
Remove the first argument of MR_materialize_closure_typeinfos, since
its correct value is always the same part of the second argument.
runtime/mercury_deep_copy_body.h:
Do not pass the first argument of MR_materialize_closure_typeinfos.
Add field name prefixes where necessary.
compiler/modules.m:
The mercury_builtin module is no longer part of the library.
compiler/pd_debug.m:
compiler/rl_analyze.m:
Minor updates to avoid trying to take the address of io__write_list,
since it now has more than one mode.
runtime/mercury_init.h:
runtime/mercury_wrapper.[ch]:
trace/mercury_trace_vars.[ch]:
Add a parameter to MR_trace_browse_all_on_level that specifies
whether we should print values of type type_info.
trace/mercury_trace_vars.c:
Do not ignore predicates and functions anymore.
runtime/mercury_stack_trace.c:
trace/mercury_trace.c:
trace/mercury_trace_declarative.c:
trace/mercury_trace_external.c:
Pass the new parameter of MR_trace_browse_all_on_level.
trace/mercury_trace_internal.c:
Implement the "print_optionals" command.
doc/user_guide.texi:
Document the "print_optionals" command.
tests/debugger/mdb_command_test.inp:
Test the documentation of "print_optionals".
tests/debugger/higher_order.{m,inp,exp,exp2}:
A new test case to exercise the ability to print higher order values.
Note that the format of the predicate names in the output should be
improved, but that is a separate change since doing it the right way
requires bootstrapping.
tests/debugger/Mmakefile:
Enable the new test case.
tests/debugger/nondet_stack.exp*:
Update the expected output to reflect the fact that nondet stack dumps,
being intended for debugging, include type_infos.
tests/debugger/tabled_read_decl.exp*:
Update the expected output to reflect the fact that for maximum
usefulness, the printing of I/O action atoms prints meaningful
type_infos.
tests/hard_coded/deconstruct_arg.*:
tests/hard_coded/write_reg1.*:
Expand these tests to check that we handle higher order values
correctly not just when canonicalizing but also in committed choice
modes.
Estimated hours taken: 4
Branches: main
Add MR_ prefixes to the remaining non-prefixed symbols.
This change will require all workspaces to be updated
The compiler will start generating references to MR_TRUE,
MR_bool, etc., which are not defined in the old runtime
header files.
runtime/mercury_std.h:
Add MR_ prefixes to bool, TRUE, FALSE, max, min,
streq, strdiff, strtest, strntest, strneq, strndiff,
strntest, NO_RETURN.
Delete a commented out definition of `reg'.
runtime/mercury_tags.h:
Add an MR_ prefix to TAGBITS.
configure.in:
runtime/mercury_goto.h:
runtime/machdeps/i386_regs.h/mercury_goto.h:
Add an MR_ prefix to PIC.
runtime/mercury_conf_param.h:
Allow non-prefixed PIC and HIGHTAGS to be defined on
the command line.
runtime/mercury_bootstrap.h:
Add backwards compatibility definitions.
RESERVED_MACRO_NAMES:
Remove the renamed macros.
compiler/export.m:
compiler/ml_code_gen.m:
Use MR_bool rather than MR_Bool (MR_Bool is
meant to be for references to the Mercury type
bool__bool).
runtime/mercury_types.h:
Add a comment the MR_Bool is for references to
bool__bool.
*/*.c:
*/*.h:
*/*.m:
Add MR_ prefixes.
Estimated hours taken: 2.5
Branches: main
Add MR_ prefixes to uses of configuration macros.
Bootcheck now succeeds with MR_NO_CONF_BACKWARDS_COMPAT.
Mmake.common.in:
Define MR_NO_CONF_BACKWARDS_COMPAT when checking
for namespace cleanliness.
RESERVED_MACRO_NAMES:
Remove the configuration macros.
runtime/mercury_conf_bootstrap.h:
Remove a duplicate definition of BOXED_FLOAT.
configure.in:
*/*.c:
*/*.h:
*/*.m:
Add MR_ prefixes.
Estimated hours taken: 2
Branches: main
browser/*.m:
Make the debugger use the committed choice versions of the
deconstruction predicates, and propagate the committed choice
environment up the call chain as far as necessary.
Estimated hours taken: 8
Branches: main
Soon foreign_proc will be impure by default unless given a promise_pure
or promise_semipure attribute. The syntax has been accepted for some
time, we now add the necessary declarations.
browser/dl.m:
compiler/timestamp.m:
library/*.m:
tests/hard_coded/unused_float_box_test.m:
Add promise_pure and promise_semipure declarations for foreign_procs.
Estimated hours taken: 20
Branches: main
Give the debugger the ability to print goals.
NEWS:
Mention the new ability.
browser/browser_info.m:
Define a new type, browser_term, which represents either a plain term,
or a "synthetic term", which is a string (predicate or function name),
a list of argument values, and an indication of whether the synthetic
term is a predicate goal (i.e. of the form p(a1, ..., an)) or a
function goal (i.e. of the form f(a1, ..., an-1) = an).
Add utility predicates for processing browser_terms.
browser/browse.m:
Add predicates for printing and browsing synthetic terms, and export
them to C code.
browser/browse.m:
browser/size_pretty.m:
Generalize lots of predicates to handle browser_terms, not just plain
terms.
browser/util.m:
Add a new type, "unbound", for use by mercury_trace_vars.c.
library/pprint.m:
Add functions for converting synthetic terms to docs.
Fix a potential efficiency problem: an unnecessary deconstruct.
runtime/mercury_type_info.h:
Add macros for defining static type_infos in C code.
Add macros for computing the names of type_ctor_infos even in non-hlc
grades.
Give C code access to the representation of bools and of values of
the new type "unbound".
trace/mercury_trace_browse.[ch]:
Add functions for printing goals.
trace/mercury_trace_internal.c:
Add code to recognize and handle the commands "print goal" and
"browse goal".
doc/user_guide.texi:
Document the new commands.
trace/mercury_trace_vars.[ch]:
Add a function to compute the components of synthetic terms.
tests/debugger/browse_pretty.{inp,exp*}:
Add new commands to the input to test the printing and browsing of
predicate goals, and update the expected outputs accordingly.
tests/debugger/polymorphic_output.{inp,exp*}:
Add new commands to the input to test the printing and browsing of
function goals, and update the expected outputs accordingly.
Estimated hours taken: 8
Branches: main
Allow the browser to refer to fields by name.
browser/browser_info.m:
Generalize the data structure for recording paths within terms to allow
navigation by field names.
browser/browse.m:
browser/program_representation.m:
Update the algorithms for navigation in terms accordingly.
browser/parse.m:
Update the algorithm for reading in navigation terms.
Allow digits as well as letters and underscores in "names", since
field names may contain digits as well. This should not impact
other uses of names by the other parts of the debugger.
library/std_util.m:
Add new predicates named_argument and det_named_argument. They are
implemented using ML_named_arg, a new C function which is the same
as ML_arg except that it specifies the selected argument by name.
NEWS:
Mention the new predicates.
runtime/mercury_ml_expand_body.h:
Add a new alternative, EXPAND_NAMED_ARG, for use in implementing
ML_named_arg.
tests/debugger/field_names.{m,inp,exp,exp2}:
Expand this test case to exercise the browser.
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.
Estimated hours taken: 4
Branches: main
Improve the code handling foreign_proc_attribute parsing. This is in
anticipation of my next change which will add another attribute.
browser/dl.m:
Fix an incorrect pragma foreign_code that should have been
pragma foreign_proc.
compiler/prog_io_pragma.m:
Improve the error handling when parsing attributes.
Also improve the code for detecting conflicting attributes (e.g.
thread_safe and not_thread_safe).
This fixes an XXX in parse_pragma_foreign_proc_attributes_term
concerning the lack of error return mechanisms in the code.
Estimated hours taken: 7
branches: main.
Add a post-process predicate in collect. This predicate is optional
and automatically added if the collect user do not define it.
browser/collect_lib.m:
Add support for dynamically link the post_process/2 predicates.
extras/morphine/source/collect.in:
extras/morphine/source/collect.op
Add support for automatically add a post_process predicate definition
as well as a accumulator_type definition.
trace/mercury_trace_external.h:
trace/mercury_trace_external.c:
Change the name of the accumulator variable type from
MR_collecting_variable to MR_accumulator variable. Also Add a new
variable type MR_collected_variable that contains the value that
is sent to the collect caller process (instead of
MR_collecting_variable).
Apply (post_process_ptr) (which points to
collect__post_process/2) to the accumulator variable before
sending the collect result.
extras/morphine/non-regression-tests/solutions:
Replace collected_type by accumulator_type.
extras/morphine/non-regression-tests/queens.exp:
extras/morphine/non-regression-tests/queens.in:
extras/morphine/non-regression-tests/test_ln:
Add a new test case entry to test line numbers and the use of
post_process/2 with collect.
Estimated hours taken: 3
branches: main.
Make line numbers available for collect.
browser/collect_lib.m:
Minor comment fixes.
extras/morphine/source/collect.in:
extras/morphine/source/collect.op
Add the line number event attribute.
trace/mercury_trace.h:
trace/mercury_trace.c:
Add the line number as argument of MR_COLLECT_filter.
trace/mercury_trace_external.h:
trace/mercury_trace_external.c:
Put the code that computes the line number in a function called
MR_get_line_number() to be able to call it in mercury_trace.c
to avoid duplicated code.
Estimated hours taken: 400
Smart recompilation. Record version numbers for each item
in interface files. Record which items are used in each compilation.
Only recompile a module if the output file does not exist or
nothing has changed.
There is still some work to do on this:
- it doesn't work with inter-module optimization.
- it doesn't work when the module name doesn't match the file name.
(this problem will go away when mmake functionality is moved into
the compiler.
I'll hold off documenting this change in the NEWS file and
on the web page for a month or so, until I've had a bit more
experience using it.
compiler/options.m:
compiler/handle_options.m:
doc/user_guide.texi:
Add an option `--smart-recompilation', currently off by default.
Add an internal option `--generate-version-numbers' to control
whether version numbers are written to the interface files. If
`--smart-recompilation' is disabled because the module
is being compiled with `--intermodule-optimization' (e.g. in the
standard library), we still want to write the version numbers
to the interface files.
Add an option `--verbose-recompilation' (default off)
to write messages describing why recompilation is needed.
Add an option `--warn-smart-recompilation' (default on)
to control warnings relating to the smart recompilation
system. Warn if smart recompilation will not work with
the output and inter-module optimization options given.
compiler/recompilation.m:
Type declarations for smart recompilation.
Predicates to record program items used by compilation.
compiler/recompilation_version.m:
Compute version numbers for program items in interface files.
compiler/recompilation_usage.m:
Find all items used by a compilation.
compiler/recompilation_check.m:
Check whether recompilation is necessary.
compiler/timestamp.m:
Timestamp ADT for smart recompilation.
compiler/mercury_compile.m:
Invoke the smart recompilation passes.
compiler/modules.m:
compiler/prog_io.m:
Return timestamps for modules read.
When reading a module make sure the current input stream
is reset to its old value, not stdin.
Handle version number items in interface files.
compiler/module_qual.m:
compiler/unify_proc.m:
compiler/make_hlds.m:
Record all items used by local items.
compiler/make_hlds.m:
Process `:- pragma type_spec' declarations in
add_item_list_clauses. The qual_info is needed
when processing `:- pragma type_spec' declarations
so that any equivalence types used by the declaration
can be recorded as used by the predicate or function to
which the `:- pragma type_spec' applies.
compiler/equiv_type.m:
For each imported item, record which equivalence types
are used by that item.
compiler/hlds_module.m:
Add a field to the module_info to store information about
items used during compilation of a module.
compiler/check_typeclass.m:
Make sure any items used in clauses for typeclass method
implementations are recorded in the `.used' file.
compiler/prog_data.m:
compiler/*.m:
Factor out some duplicated code by combining the
pred and func, and pred_mode and func_mode items.
Make it easier to extract the name of a type, inst or mode
from its declaration.
Add an item type to hold the version numbers for an interface file.
Allow warnings to be reported for `nothing' items (used for
reporting when version numbers are written using an
obsolete format).
compiler/prog_io.m:
compiler/prog_io_util.m:
compiler/typecheck.m:
compiler/type_util.m:
compiler/*.m:
Strip contexts from all types, not just those in class constraints.
This makes it possible to use ordinary unification to check
whether items have changed (with the exception of clauses).
Remove code to create types with contexts in typechecking.
Remove code scattered through the compiler to remove contexts
from types in class constraints.
compiler/hlds_pred.m:
compiler/prog_util.m:
Move hlds_pred__adjust_func_arity to prog_util, so that it
can be used by the pre-hlds passes.
compiler/typecheck.m:
compiler/hlds_module.m:
Move typecheck__visible_modules to hlds_module.m, so it can
be used by recompilation_usage.m.
compiler/typecheck.m:
Add a comment telling where updates may be required if the
code to typecheck a var-functor unification changes.
compiler/error_util.m:
Allow writing messages without contexts (used for the verbose
recompilation messages).
Add functions to format sym_name and sym_name_and_arity,
and to add punctuation to the end of an error message
without unwanted line breaks before the punctuation.
scripts/Mmake.rules:
compiler/modules.m:
Don't remove the output file before running the compiler. We need
to leave the old output file intact if smart recompilation detects
that recompilation is not needed.
compiler/notes/compiler_design.html:
Document the new modules.
library/io.m:
NEWS:
Add predicates to find the modification time of files
and input_streams.
library/set.m:
NEWS:
Add a predicate version of set__fold
Don't sort the output of set__filter, it's already sorted.
library/std_util.m:
NEWS:
Add a predicate `std_util__map_maybe/3' and a function
`std_util__map_maybe/2' to apply a predicate or a function to
a value stored in a term of type `std_util__maybe'.
configure.in:
runtime/mercury_conf.h.in:
runtime/RESERVED_MACRO_NAMES:
When checking whether the compiler is recent enough, check for
the --warn-smart-recompilation option.
Check for stat().
library/Mmakefile:
Disable warnings about smart recompilation not working with
`--intermodule-optimization'.
browser/Mmakefile:
Disable warnings about smart recompilation not working when
the module name doesn't match the file name.
runtime/mercury_string.h:
Add a macro MR_make_string_const() which automates computation
of the length of string argument to MR_string_const().
tests/recompilation/Mmakefile:
tests/recompilation/runtests:
tests/recompilation/test_functions:
tests/recompilation/TESTS:
tests/recompilation/README:
A framework for testing smart recompilation.
The option currently only works for the recompilation directory.
tests/recompilation/TEST.m.{1,2}:
tests/recompilation/TEST_2.m.{1,2}:
tests/recompilation/TEST.exp.{1,2}:
tests/recompilation/TEST.err_exp.2:
Test cases, where TEST is one of add_constructor_r, add_instance_r,
add_instance_2_r, add_type_nr, change_class_r, change_instance_r,
change_mode_r, field_r, func_overloading_nr, func_overloading_r,
lambda_mode_r, nested_module_r, no_version_numbers_r,
pragma_type_spec_r, pred_ctor_ambiguity_r, pred_overloading_r,
add_type_re, remove_type_re, type_qual_re.
tests/handle_options:
Add an option `-e' to generate any missing expected output files.
Estimated hours taken: 0.5
Branches: main
browser/sized_pretty.m:
Avoid the term "Flag" as a variable name, since in this context
it is inaccurate and uninformative.
Clarify the comment for the measured_split typeclass method.
Estimated hours taken: 0.1
Branches: main
browser/sized_pretty.m:
Shorten dividing lines of the form '%---- ... ----%' so they
don't wrap around in diffs (or replies to diffs).
Estimated hours taken: 4
Branches: main
Make mdb's term browser use limited_deconstruct/5 instead of deconstruct/4,
to avoid performance problems with large arrays.
browser/sized_pretty.m:
Add a new function, maximum_functors, to the measure_with_params
typeclass. This calculates an upper bound for the number of
functors that could be displayed within the given measurement.
Implement this function for each of the typeclass instances.
In the first pass, use this new function to calculate the limit for
limited_deconstruct. If this predicate fails, then the term is
flagged as 'not_deconstructed'. This means we won't attempt to
deconstruct the term in the second pass, either.
Replace deconstruct/4 with functor/3 in cases where the
arguments are not required.
Remove flag_with, which adds the same flag to each of a list of
arguments. Instead, pass the flag itself to
annotate_args_with_size, which was the only predicate to use the
arguments flagged in this way.
Remove annotate_args_with_zero_size, since it is not used.
Estimated hours taken: 3
Branch: main
Add line numbers in Morphine.
trace/mercury_trace_external.c
Modify MR_output_current_slots() so that it takes a MR_Event_Info *
rather than a MR_Label_Layout *. The reason is that I need it to
get the parent of the current event. I need the parent of the current
goal because I want the line number where the call is made,
not the one where the procedure is defined.
Add the line number as an output of ML_DI_output_current_slots_*.
browser/util.m
Define the line_number type.
browser/debugger_interface.m
Add the line number as argument of output_current_slots/13.
extras/morphine/source/current_slots.op
Add the line number as argument of current_attributes/12.
extras/morphine/source/display.op
Add the line number as argument of attribute_display/12 and
of the attribute_display parameter.
extras/morphine/source/event_attributes.op
Define the new event attribute alias.
extras/morphine/non-regression-tests/test_vars.exp:
extras/morphine/non-regression-tests/queens.exp:
Update the expected output of the non-regression test.
extras/morphine/non-regression-tests/queens.in:
Disable the testing of the browser as it is currently broken.
Estimated hours taken: 0.2
Branches: main
browser/browse.m:
Make the prettyprinters in this file use limited_deconstruct to avoid
performance problems with large arrays.
Estimated hours taken: 4 + 4 in mail
Branches: main
Allow the RTTI routines and the debugger to treat arrays as other types.
The RTTI routines used to pretend that terms of array type had no arguments.
This led the browser to believe that their size was small, and handed them
over to io__write, which then printed the entire array. For large arrays,
this could take minutes. It also led the browser to believe that you can't
"cd" to an element of an array.
The RTTI routines now treat arrays mostly like they treat tuples, which fixes
both problems.
The debugger's prettyprinters do not yet use limited_deconstruct; that is
future work.
library/std_util.m:
Add a new predicate, limited_deconstruct, which usually does what
deconstruct does, but fails (and does not allocate any memory) if
the arity of the supplied term is beyond a given limit. With normal
terms, the memory allocated by deconstruct to hold the typeinfos
of the arguments is not a problem. However, arrays can have millions
of elements, and for them this *is* a problem. Programmers can avoid
this problem by using limited_deconstruct instead of deconstruct.
Make ML_arg (used by the arg and argument predicates) avoid the
construction of a typeinfo vector for all the arguments, for the same
reason.
Since we now need more variants of ML_expand than ever, and we don't
want the new, relatively rarely used functionality to slow down the old
functionality, create several variants of ML_expand, each specialized
to a given use, and choose between them at compile time, not run time.
This should actually speed up the old functionality.
runtime/mercury_ml_expand_body.h:
A new file which is included several times in library/std_util.m,
containing the bodies of the several variants of the old ML_expand.
runtime/Mmakefile:
Mention the new file.
browser/browse.m:
Avoid unlimited deconstructions when checking whether the term fits
within the size range we give to io__write.
Special case path resolution on terms of type array, because while
in the debugger we count arguments from one, array elements start at
index zero, and any other behavior would be misleading.
tests/hard_coded/deconstruct_arg.{m,exp}:
A new test case to check the various variants of ML_expand through
its callers, the predicates functor, argument, deconstruct and
limited_deconstruct, on all kinds of data types.
tests/hard_coded/Mmakefile:
Enable the new test case.
Estimated hours taken: 0.5
Branches: main
trace/mercury_trace_browse.c:
trace/mercury_trace_browse.h:
trace/mercury_trace_internal.c:
Set the pretty printing flags (which represent Mercury bools) using
functions exported from Mercury code, rather than using TRUE and
FALSE. This removes the assumption that Mercury bools have the
same representation as C bools, which was causing a problem when
--reserve-tag was used.
Change the type of these flags to MR_Word. According to the
reference manual, this is the type Mercury bools have when passed
to C code.
browser/browser_info.m:
Export functions that construct Mercury bools.
Estimated hours taken: 0.5
Branches: main
Remove the RM_C mmake variable, which controlled whether the intermediate
`.c' files were removed (now they never are).
The implementation was buggy (it didn't work with parallel makes), and
made it difficult to avoid always recompiling the `.c' file with smart
recompilation.
Mmake.common.in:
configure.in:
README.AIX:
bindist/bindist.build_vars.in:
bindist/bindist.configure.in:
scripts/Mmake.vars.in:
scripts/Mmake.rules:
compiler/modules.m:
tools/bootcheck:
tools/binary_step:
*/Mmakefile:
Remove references to RM_C, DEFAULT_RM_C and LIBRARY_RM_C.
compiler/modules.m:
The `.o' and `.pic_o' file now depends only on the `.c' file,
not on everthing the `.c' file depends on. The extra dependencies
were only needed because the intermediate `.c' file could
be removed by RM_C. This change is needed to avoid recompiling
unchanged `.c' files with smart recompilation.
Estimated hours taken: 40
Branches: main
This is the second part of a change to support term dependency analysis
in the declarative debugger. A `mark' command is implemented for the
term browser, which allows a particular subterm to be selected and
returned from the browser. The declarative debugger interprets this as
a suspicious subterm, and tries to find a child or sibling node from which
this subterm comes. This is used to determine the next question to be
asked of the oracle.
browser/browse.m:
Update the browser interface to allow for marked subterms being
returned from the browser.
Implement and document the mark command.
Rewrite run_command as a switch instead of a chain of if-then-elses.
This forces all unimplemented commands to be explicitly listed,
and gives better error checking.
browser/browser_info.m:
Add a maybe_mark field to the browser_info. It is initially `no',
but is updated when the mark command is given.
browser/declarative_analyser.m:
Select which child or sibling node to ask about next by searching
for the origin of the suspicious subterm. If the subterm has mode
`out' we act as if the oracle had answered no, and if the subterm
has mode `in' we act as if the oracle had answered yes. In future
we may not wish to presume this -- we do so now mainly to keep the
analysis algorithm simpler.
browser/declarative_debugger.m:
Add a functor for suspicious subterms to the decl_answer type.
browser/declarative_oracle.m:
Accommodate the changed answer type. The oracle does not try to
store information about suspicious subterms in the knowledge base,
because in principle this could lead to infinite loops (although
currently this wouldn't be a problem since we don't ever use the
information to move upward in the tree, so no cycle could be
formed).
browser/declarative_user.m:
Accommodate the changed answer type, and interpret marked terms
from the browser as suspicious subterms.
browser/parse.m:
Add the new command.
browser/program_representation.m:
Add a procedure to convert the browser's list(dir) to a term_path.
Change atomic_goal_rep_is_call/2 so it fails for special predicates,
which was originally intended.
trace/mercury_trace_browse.c:
Ignore the extra argument -- marked terms are not currently used in
the main debugger.
tests/debugger/declarative/Mmakefile:
tests/debugger/declarative/input_term_dep.*:
tests/debugger/declarative/output_term_dep.*:
tests/debugger/declarative/special_term_dep.*:
New test cases.
Estimated hours taken: 1
Branches: main release
boehm_gc/Mmakefile:
browser/Mmakefile:
trace/Mmakefile:
Modify Mmakefiles so that we don't try to install unnecessary
subsystems in IL grades.
runtime/Mmakefile:
Add some support for installing the MCPP_HDRS and the DLLs in IL
grades (largely untested).
Fix some missing dependencies on the 'install_dirs' target.
library/Mmakefile:
scripts/Mmake.rules:
Remove the check for ils_subdir, as this appears to be a
cut-and-paste error -- the rules it surrounds are not for doing
subdir builds.
Use a clearer test for il as a substring in GRADE.
Estimated hours taken : 185
Added a new pretty printing format to the term browser. This new format
helps put a limit on the size of the term printed during debugging.
This limit is specified by setting the number of lines you want the term
to be printed on and the width of these lines. Refer to sized_pretty.m for
Examples.
browser/sized_pretty.m:
New file that does what's described above.
browser/browse.m:
browser/browser_info.m:
browser/mdb.m:
browser/parse.m:
trace/mercury_trace_browse.c:
trace/mercury_trace_browse.h:
trace/mercury_trace_internal.c:
Modified to accommodate the new format.
tests/debugger/browse_pretty.inp:
tests/debugger/browser_test.inp:
Included test cases for the new pretty printing format.
tests/debugger/browse_pretty.exp:
tests/debugger/browser_test.exp:
Changed the expected output.
Estimated hours taken: 1.5
Address Fergus's late review comments on a previous change.
browser/dl.m:
Allocate closures on the heap.
runtime/mercury_heap.h:
Add a mechanism to allocate C structures on the heap.
runtime/mercury_stacks.h:
runtime/mercury_types.h:
Move a macro from mercury_stacks.h to mercury_types.h, to give
mercury_heap.h access to it.
Estimated hours taken: 0.25
browser/interactive_query.m:
Pass `--allow-undefined' to ml when building libquery.so;
this is needed now that `--no-allow-undefined' is the default,
since the query will refer to symbols in the executable that
it gets loaded into.
Estimated hours taken: 2
On platforms which support it, check that there are no undefined
symbols when linking the Mercury shared libraries.
Some platforms (AIX, Windows, and BeOS) require this when building
shared libraries. This change means that we check it on our usual
platforms, including Linux.
configure.in:
Set ERROR_UNDEFINED to `-Wl,--no-undefined' on x86 Linux.
Using --no-undefined on Linux requires linking in ld-linux.so,
so add some code to figure out the right version of that to
link with.
Mmake.common.in:
Set ALLOW_UNDEFINED and ERROR_UNDEFINED to the values
determined by configure.in. Also pass down the values of
SOCKET_LIBRARY, NSL_LIBRARY, and DL_LIBRARY, since we need
to link with those libraries to resolve all the undefined
symbols.
runtime/Mmakefile:
library/Mmakefile:
browser/Mmakefile:
trace/Mmakefile:
Pass $(ERROR_UNDEFINED) to $(LINK_SHARED_OBJ).
browser/Mmakefile:
trace/Mmakefile:
Link in SOCKET_LIBRARY, NSL_LIBRARY, and DL_LIBRARY.