Discussion of these changes can be found on the Mercury developers
mailing list archives from June 2018.
COPYING.LIB:
Add a special linking exception to the LGPL.
*:
Update references to COPYING.LIB.
Clean up some minor errors that have accumulated in copyright
messages.
browse.m:
Remove the correct temporary file in
save_and_browse_browser_term_web.
Reword instructions when web_browser_cmd is not set.
term_to_html.m:
Reword a comment.
browser/browse.m:
Add save_and_browse_browser_term_web to be called when
"browse --web" is entered at the mdb prompt.
Add browser_term_to_html_flat_string, a helper predicate for
term_to_html.
Make portray_flat_write_browser_term work take a stream parameter
instead of writing to the current output stream. It is called by
browser_term_to_html_flat_string, writing to a string builder
stream.
browser/browser_info.m:
Add web_browser_cmd field to browser_persistent_state.
browser/mdb.m:
browser/term_to_html.m:
Add new module to generate an HTML document. The document contains a
JavaScript represention of a Mercury term.
(The JavaScript string escaping code is adapted from Julien's
mercury-json project.)
browser/percent_encoding.m:
Add new module to perform percent-encoding.
scripts/mdb_term_browser.css:
scripts/mdb_term_browser.js:
Add JavaScript and CSS files referenced by the generated HTML file
to create a tree view of a Mercury term using jstree.
scripts/32px.png:
scripts/40px.png:
scripts/throbber.gif:
scripts/jstree.min.js:
scripts/jstree.style.min.css:
Add local copy of jstree files <https://www.jstree.com/>
scripts/jquery.slim.min.js:
Add local copy of jquery <https://jquery.com/>
scripts/Mmakefile:
Install the new files into the same directory as mdbrc and other
mdb-related files.
trace/mercury_trace_browse.c:
trace/mercury_trace_browse.h:
trace/mercury_trace_cmd_browsing.c:
trace/mercury_trace_cmd_parameter.c:
trace/mercury_trace_cmd_parameter.h:
trace/mercury_trace_internal.c:
Add "browse --web" and "web_browser_cmd" commands.
doc/user_guide.texi:
Document "browse --web" and "web_browser_cmd" commands.
configure.ac:
scripts/mdbrc.in:
Set a reasonable default command to launch a web browser from mdb.
(Only tested on Linux.)
NEWS:
Announce the new feature.
.README.in:
Mention jquery and jstree licensing.
tests/debugger/Mmakefile:
tests/debugger/completion.exp:
tests/debugger/mdb_command_test.inp:
tests/debugger/save.exp2:
Update debugger tests for new commands.
browser/browse.m:
browser/browser_info.m:
browser/collect_lib.m:
browser/debugger_interface.m:
browser/declarative_analyser.m:
browser/declarative_debugger.m:
browser/declarative_edt.m:
browser/declarative_execution.m:
browser/declarative_oracle.m:
browser/declarative_test.m:
browser/declarative_tree.m:
browser/declarative_user.m:
browser/diff.m:
browser/dl.m:
browser/frame.m:
browser/help.m:
browser/interactive_query.m:
browser/io_action.m:
browser/listing.m:
browser/mdb.m:
browser/mer_browser.m:
browser/name_mangle.m:
browser/term_rep.m:
browser/tree234_cc.m:
Fix inconsistencies between (a) the order in which functions and predicates
are declared, and (b) the order in which they are defined.
In most modules, either the order of the declarations or the order
of the definitions made sense, and I changed the other to match.
In some modules, neither made sense, so I changed *both* to an order
that *does* make sense (i.e. it has related predicates together).
In some places, put dividers between groups of related
functions/predicates, to make the groups themselves more visible.
In some places, fix comments or programming style.
browser/MDB_FLAGS.in:
Since all the modules in this directory are now free from any warnings
generated by --warn-inconsistent-pred-order-clauses, specify that option
by default in this directory to keep it that way.
library/pretty_printer.m:
Make the changes indicated by the NOTE_TO_IMPLEMENTORS notes
in my previous change.
NEWS:
Announce the changes.
browser/browse.m:
tests/hard_coded/test_pretty_printer.m:
Conform to the above change.
This fixes Mantis bug #412.
compiler/unused_imports.m:
Consider that an instance declaration makes a module "used" only if
it occurs in the module being compiled, not in an imported or ancestor
module. (Mantis bug 412 was caused by instance declarations in implicitly
imported modules.)
Fixing #412 also exposed another bug. When computing the set of modules
used by predicates, we considered (besides some non-type entities)
only the types of the predicate's arguments, not the types of non-argument
variables. In one case in the compiler (mmc_analysis.m), this lead to
some actually-used modules not being marked as such, which lead to
false unused-import warnings to be generated for them. Fix this by scanning
the types of all variables in all of a predicate's procedures, not just
the arguments.
Improve the infrastructure for debugging similar problems.
Note some possibilities for future improvement.
Change a predicate name to fit the naming scheme.
compiler/analysis.m:
Add an XXX about a possible improvement.
compiler/hlds_out_module.m:
Make the output we generate for instance methods more readable.
As part of this, fix an old bug in the printing of the instance table:
the first line of the first method of each concrete instance declaration
was accidentally commented out.
compiler/parse_tree_out.m:
Export a different utility predicate for hlds_out_module.m. Make its name
conform to the scheme used by related predicates.
browser/browse.m:
compiler/add_mutable_aux_preds.m:
compiler/add_pred.m:
compiler/add_special_pred.m:
compiler/check_for_missing_type_defns.m:
compiler/check_promise.m:
compiler/exception_analysis.m:
compiler/handle_options.m:
compiler/inst_match.m:
compiler/mercury_to_mercury.m:
compiler/ml_tailcall.m:
compiler/module_qual.m:
compiler/op_mode.m:
compiler/parse_inst_mode_defn.m:
compiler/parse_tree_out_clause.m:
compiler/parse_tree_out_info.m:
compiler/parse_tree_out_inst.m:
compiler/parse_tree_out_pragma.m:
compiler/parse_tree_out_pred_decl.m:
compiler/parse_tree_out_term.m:
compiler/parse_type_defn.m:
compiler/parse_type_name.m:
compiler/parse_util.m:
compiler/parse_vars.m:
compiler/prog_ctgc.m:
compiler/recompilation.usage.m:
compiler/resolve_unify_functor.m:
compiler/term_constr_main.m:
compiler/term_constr_main_types.m:
compiler/write_deps_file.m:
library/bt_array.m:
Delete unused imports.
compiler/module_qual.qual_errors.m:
Import a module that the parent module_qual.m doesn't import anymore.
tests/warnings/bug412.{m,exp}:
The test case for this bug.
tests/warnings/Mmakefile:
tests/warnings/Mercury.options:
Enable the new test case.
tests/invalid/import_in_parent.err_exp:
Update the expected output for this test case. The parent module
does not use the imported module (bool) at all, so this is what the
error message says after this diff, though its submodule does use bool.
browser/browser_info.m:
Avoid using "output" (and "input", for the sake of symmetry)
as function symbols.
browser/debugger_interface.m:
Avoid using "pred" and "func" as function symbols by putting a prefix
before each function symbol in the affected type.
browser/dl.m:
Avoid using "local" (and "global", again for symbols) as function symbols.
profiler/output_prof_info.m:
Avoid using "output" as a type name and as a function symbol.
browser/browse.m:
browser/collect_lib.m:
browser/declarative_user.m:
browser/interactive_query.m:
profiler/generate_output.m:
profiler/output.m:
Conform to the changes above.
extras/morphine/source/browse.op:
extras/morphine/source/collect.op:
extras/morphine/source/current_arg.op:
extras/morphine/source/current_slots.op:
extras/morphine/source/exec_control.op:
extras/morphine/source/forward_move.op:
extras/morphine/source/interactive_queries.op:
Conform to the renames of the function symbols in debugger_interface.m.
Since this code is in Prolog, I cannot be sure that I changed all the
places that should be changed, but that does not matter much.
Since Morphine was designed to work with the Prolog dialects of 1999,
had its last update in 2002, and we never test it, it is very likely
that it hasn't worked in a long time. We keep it around because
(a) it may interest someone, and (b) it doesn't require significant
maintenance. The fact that it does not run may be regrettable, but
it is not actually regretted by many would-be users, or (even) any at all.
(I actually noticed and fixed a bug while doing the above change:
it was a typo in a function symbol name.)
browser/browse.m:
Rename the version of the I/O state used inside a trace goal
in order to avoid a warning about it shadowing the version in
the enclosing scope.
browser/browse.m:
browser/declarative_edt.m:
compiler/continuation_info.m:
compiler/hlds_out_goal.m:
compiler/llds_out_file.m:
compiler/make.dependencies.m:
compiler/ml_closure_gen.m:
compiler/ml_elim_nested.m:
compiler/options_file.m:
compiler/prog_io_pragma.m:
deep_profiler/html_format.m:
Delete some dead predicates that won't be needed anymore.
compiler/hlds_goal.m:
compiler/jumpopt.m:
Comment out some dead predicates that may be needed later.
compiler/matching.m:
compiler/typecheck.m:
compiler/write_deps_file.m:
compiler/write_module_interface_files.m:
Convert some dead predicates into live predicates by adding calls to them
at their intended call sites. In some cases the missing call was a sort-of
bug (the code worked, but not as well as it should have). In others, the
call was intended only for debugging, and the new call is in a trace scope
that is disabled by default.
compiler/ml_foreign_proc_gen.m:
Add an XXX comment about a dead procedure.
browser/browser_info.m:
Replace the old "dir" type and "dir_no_parent" inst with
two distinct types: up_down_dir and down_dir.
browser/browse.m:
browser/declarative_user.m:
browser/parse.m:
Replace uses of the old dir type with one of the new types,
adding conversions as needed. The separate types make it much clearer
where ".." dir steps may appear and where they may not.
In one case, this extra clarity allows us to avoid calling simplify_dirs
(which eliminates ".." dir steps) twice in a row.
In some other cases, it allows us to replace three-way switches
in which the .. case contained a "this can't happen" assertions
with a two-way switch (between numbered and named child directories).
This should be faster as well as safer. We now allow ".." dir steps
only when the user types in directory paths, and we convert them to
downward-only directory paths immediately afterward.
Simplify the code that writes out directory paths.
Estimated hours taken: 2
Branches: main, release
Make the system compiler with --warn-unused-imports.
browser/*.m:
library/*.m:
compiler/*.m:
Remove unnecesary imports as flagged by --warn-unused-imports.
In some files, do some minor cleanup along the way.
Branches: main, 10.04
ssdebug enhancements.
ssdb/ssdb.m:
Make `print' (no arguments) print the goal, like mdb, instead of
printing all variables.
Make `print *' print all variables. Add `P' as an alias.
Use browser to print terms.
Add `format' and `format_param' commands to set browser parameters.
Support browsing the goal term with `browse' (no argument).
Add `return', `level' and `current' commands.
Support an optional line limit for the `stack' command.
Support compressing duplicate stack frames in stack traces.
Support an integer argument to `step' command.
Treat a bare integer as a `step N' command.
Support `quit -y' option.
browser/browse.m:
browser/util.m:
trace/mercury_trace_vars.c:
Move definition of type `unbound' to a public module.
README.ssdebug:
Note down two more limitations.
Estimated hours taken: 2
Branches: main
Get the java.ssdebug grade installing and compiling hello world.
Note that currently the jars for the java.ssdebug grade are installed in the
same location as the non-ssdebug jars. That's not a problem for now,
because the standard library currently has the ssdebug transformations
turned off when it's compiled in the ssdebug grade, so the java.ssdebug
jars are the same as the java jars. Changing it so that the java.ssdebug
jars are installed in a different location requires getting mmc to
adjust the classpath depending on the grade, which doesn't seem worth
it at this stage.
Also note that the interface files for the ssdb, browser and mdbcomp
libraries need to be installed in the ssdebug grade otherwise mmc
complains that it cannot find files like ssdb.m when compiling
a program. These interface files are currently only installed
when there is an ssdebug grade.
browser/MDB_FLAGS.in:
mdbcomp/MDBCOMP_FLAGS.in:
ssdb/SSDB_FLAGS.in:
Generate .module_dep files (needed to compile ssdebug transformed
programs).
browser/Mmakefile:
Build and install mer_browser.jar.
Install the interface files when in an ssdebug grade.
browser/browse.m:
Avoid a determinism warning.
browser/cterm.m:
browser/declarative_execution.m:
browser/listing.m:
Get this code compiling in java grades.
The "if (1 == 1)" before throwing an exception is to avoid
"unreachable code" errors from the Java compiler.
library/Mmakefile:
Mention that the ssdebug jars are installed in the
same spot as the non-ssdebug jars.
mdbcomp/Mmakefile:
Build and install mer_mdbcomp.jar.
Install the interface files when in an ssdebug grade.
mdbcomp/rtti_access.m:
Get this code compiling in Java grades.
scripts/Mercury.config.in:
Add the ssdb, mdbcomp and browser jars to the classpath.
If they are not installed they will just be ignored.
ssdb/Mmakefile:
Build and install mer_ssdb.jar.
Install the interface files when in an ssdebug grade.
ssdb/ssdb.m:
Get this code compiling in java grades.
Flush the output buffers after displaying the prompt so that
it's always displayed.
Estimated hours taken: 0.3
Branches: main
browser/browse.m:
Document recently added commands.
browser/parse.m:
Document the location of the documentation.
Put the code in more logical order.
Estimated hours taken: 3
Branches: main
Implement a command within the term browser that prints the representation
of the selected term. The command is named "addr" or "memory_addr", since
it adds new functionality only if the term is a possibly tagged pointer.
(If it is an integer or character, a plain "print" command would already
do the job.) This is intended mainly for Mercury system developers.
Note that this diff does not add documentation of the new browser command,
because I cannot find anyplace the existing browser commands are documented,
so I do not know where to add the documentation to.
browser/parse.m:
Put the browser command types in a logical order, with related commands
being together.
Make the code that recognizes browser command types have the same order
as the definition of the browser command type.
Add code to recognize the new command for the new functionality.
Add prefixes to the function symbols of the command and token types
to avoid ambiguities, and avoid using graphic characters that need to
be quoted.
browser/browser_info.m:
Add prefixes to the function symbols of the debugger type
to avoid using the keyword "external" as a function symbol.
browser/browse.m:
Make the switch on the browser command type have the same order as the
definition of the browser command type.
Add code to implement the new command.
browser/declarative_user.m:
Conform to the changes above.
Estimated hours taken: 20
Branches: main
Add a new compiler option. --inform-ite-instead-of-switch. If this is enabled,
the compiler will generate informational messages about if-then-elses that
it thinks should be converted to switches for the sake of program reliability.
Act on the output generated by this option.
compiler/simplify.m:
Implement the new option.
Fix an old bug that could cause us to generate warnings about code
that was OK in one duplicated copy but not in another (where a switch
arm's code is duplicated due to the case being selected for more than
one cons_id).
compiler/options.m:
Add the new option.
Add a way to test for the bug fix in simplify.
doc/user_guide.texi:
Document the new option.
NEWS:
Mention the new option.
library/*.m:
mdbcomp/*.m:
browser/*.m:
compiler/*.m:
deep_profiler/*.m:
Convert if-then-elses to switches at most of the sites suggested by the
new option. At the remaining sites, switching to switches would have
nontrivial downsides. This typically happens with the switched-on type
has many functors, and we treat one or two specially (e.g. cons/2 in
the cons_id type).
Perform misc cleanups in the vicinity of the if-then-else to switch
conversions.
In a few cases, improve the error messages generated.
compiler/accumulator.m:
compiler/hlds_goal.m:
(Rename and) move insts for particular kinds of goal from
accumulator.m to hlds_goal.m, to allow them to be used in other
modules. Using these insts allowed us to eliminate some if-then-elses
entirely.
compiler/exprn_aux.m:
Instead of fixing some if-then-elses, delete the predicates containing
them, since they aren't used, and (as pointed out by the new option)
would need considerable other fixing if they were ever needed again.
compiler/lp_rational.m:
Add prefixes to the names of the function symbols on some types,
since without those prefixes, it was hard to figure out what type
the switch corresponding to an old if-then-else was switching on.
tests/invalid/reserve_tag.err_exp:
Expect a new, improved error message.
Estimated hours taken: 1
Branches: main
library/pretty_printer.m:
Rename the format preds to write_doc.
Add an argument to the fully parameterised version of write_doc
specifying whether non-canonical terms should be handled by
just printing the type name and arity (`canonicalize') or by
showing their structure (`include_details_cc').
Make the canonicalize version det and the include_details_cc version
cc_multi and propagate the mode changes and extra argument
through the code.
browser/browse.m:
Call the new version of write_doc with include_details_cc in a
promise_equivalent_solutions scope (this is sound because we're writing
to stdout).
tests/hard_coded/test_pretty_printer.exp:
tests/hard_coded/test_pretty_printer.m:
Update the test case to include a non-canonical type.
Estimated hours taken: 5 (mostly testing)
Branches: main
browser/browse.m:
Try to handle pretty-printing of functor names containing '.'s
correctly (the default pretty-printer formatting escapes names
containing '.'s).
library/list.m:
Improve the pretty-printer formatting of lists by preventing
the output of ellipsis when all items in the list have been
printed.
library/pretty_printer.m:
Special-case printing of "." as an infix operator by not
surrounding it by spaces.
tests/debugger/browse_pretty.exp:
tests/debugger/browser_test.exp:
tests/debugger/declarative/change_search.exp:
Updated to reflect output of new pretty printer.
tests/debugger/browser_test.exp3:
Added a new possible output (for new pretty printer).
Estimated hours taken: 3
Branches: main
Use the pretty_print module to pretty print terms in
the debugger, rather than pprint.
browser/browse.m:
Use the new pretty_printer.
browser/browser_info.m:
Make the debugger type a member of the stream
typeclass, so that we can use it from the new
pretty printer.
Estimated hours taken: 3
Branches: main
Use the pretty_print module to pretty print terms in
the debugger, rather than pprint.
browser/browse.m:
Use the new pretty_printer.
browser/browser_info.m:
Make the debugger type a member of the stream
typeclass, so that we can use it from the new
pretty printer.
Estimated hours taken: 25
Branches: main
Implement io.write for arbitrary streams. With type specialization
this is only slightly slower than the original.
library/stream.string_writer.m:
library/library.m:
A module containing predicates for writing to streams
which accept strings.
library/stream.m:
Move stream.format to stream.string_writer.m.
Add stream.put_list, which is like io.write_list.
library/io.m:
Move io.write and io.print to stream.string_writer.m.
library/term_io.m:
Add stream versions of predicates used by io.write.
library/ops.m:
Move io.adjust_priority_for_assoc to here (private
predicate used only by library modules).
Export ops.mercury_max_priority for use by
stream.string_writer.write.
Mmake.common.in:
compiler/modules.m:
compiler/mlds.m:
compiler/mlds_to_c.m:
compiler/mlds_to_java.m:
compiler/mlds_to_managed.m:
compiler/prog_util.m:
compiler/format_call.m:
mdbcomp/prim_data.m:
Allow sub-modules in the standard library.
compiler/polymorphism.m:
Fix a bug which caused tests/hard_coded/print_stream.m to
fail with this change. The wrong argument type_info would
be extracted from a typeclass_info if the constraints of the
typeclass-info were not all variables.
browser/browse.m:
tests/hard_coded/stream_format.m:
tests/hard_coded/test_injection.m:
tests/invalid/string_format_bad.m:
tests/invalid/string_format_unknown.m:
Updated for predicates moved between library modules.
util/mdemangle.c:
The demangler doesn't properly handle the arguments MR_DECL_LL*
and various other recently added macros for type specialized
procedures. It's still broken (it doesn't handle mode and label
suffixes properly), but the output is at least more readable.
Estimated hours taken: 3
Branches: main
Clean up in unused module imports in the Mercury system detected
by --warn-unused-imports.
analysis/*.m:
browser/*.m:
deep_profiler/*.m:
compiler/*.m:
library/*.m:
mdbcomp/*.m:
profiler/*.m:
slice/*.m:
Remove unused module imports.
Fix some minor departures from our coding standards.
analysis/Mercury.options:
browser/Mercury.options:
deep_profiler/Mercury.options:
compiler/Mercury.options:
library/Mercury.options:
mdbcomp/Mercury.options:
profiler/Mercury.options:
slice/Mercury.options:
Set --no-warn-unused-imports for those modules that are used as
packages or otherwise break --warn-unused-imports, e.g. because they
contain predicates with both foreign and Mercury clauses and some of
the imports only depend on the latter.
Estimated hours taken: 5
Branches: main
Use the new stream typeclass in the term_to_xml standard library module.
In the process remove some clutter from the interface by marking as obsolete
the predicates that do not take a stream argument and remove the
"_to_stream" suffix from those predicates that do take a stream
argument.
library/term_to_xml.m:
Use the stream.writer/3 typeclass where appropriate.
Make all XML writer predicates require a stream argument
and remove the "_to_stream" suffix from these predicates.
Move all deprecated predicates to the end of the interface and
pragma obsolete them.
Reword some comments.
Remove the behaviour of replacing "]]>" with "]]>" in CDATA
elements, since that behaviour is a bit misleading, because ">"
has no special meaning in CDATA. Instead just document that "]]>"
is not allowed in CDATA elements.
browser/browse.m:
tests/hard_coded/write_xml.m:
tests/hard_coded/xmlable_test.m:
Conform to the above changes.
Estimated hours taken: 6
Branches: main
browser/*.m:
compiler/*.m:
Rename a bunch of predicates and function symbols to eliminate
ambiguities.
The only real change is factoring out some common code in the mlds
and llds code generators, replacing them with single definitions
in switch_util.m.
Estimated hours taken: 3
Branches: main
library/term_to_xml.m:
library/rtti_implementation.m:
Rename some function symbols and predicates to eliminate a bunch
of ambiguities.
browser/browse.m:
tests/hard_coded/write_xml.m:
tests/hard_coded/xmlable_test.m:
Conform to the change above.
Estimated hours taken: 1
Branches: main
Use `pragma foreign_export' in preference to `pragma export' throughout
the Mercury distribution.
Convert more of the extras distribution to four-space indentation and
other minor cleanups.
browser/*.m:
library/*.m:
samples/*:
extras/*:
As above.
Estimated hours taken: 16
Branches: main, release
Replace the "set" command of mdb with a bunch of commands: the `format',
`format_param', `list_context_lines', `list_path', `xml_browser_cmd',
`xml_tmp_filename', `fail_trace_counts', `pass_trace_counts' and
`max_io_actions' commands. Each of these set just one parameter
or one of set of closely related parameters.
Move all these commands, and some existing commands that set parameters
that were elsewhere, to the "parameter" command category.
Extend some of these commands so that if given no arguments, they report
the current values of the parameters they would otherwise set.
Replace the "set" commands of the mdb browser and of the declarative debugger
with a bunch of commands: "format", "depth", "size", "width", "lines",
"actions" and "params" (the last prints the current value of the parameters).
For each category of mdb commands, create files mercury_trace_cmd_<cat>.[ch],
and move the functions dealing with that category of commands there from
mercury_trace_internal.c. Give each of these new files a logical structure
that was sometimes missing from the relevant parts of mercury_trace_internal.c.
NEWS:
Mention these changes.
doc/mdb_categories:
Document these changes.
doc/user_guide.texi:
Document these changes.
Fix an old documentation bug: you couldn't set listing paramaters
from a declarative debugger command.
Fix an old documentation bug: the description of the goal_path step
for scopes was obsolete.
Fix some obsolete references to : as module qualifier.
browser/parse.m:
Update the browser command set along the lines at the top.
browser/declarative_user.m:
Update the declarative debugger command set along the lines at the top.
Move the declaration for the type representing declarative debugger
commands to near the top of the file.
browser/browser_info.m:
Provide some access predicates.
Update the predicate that generates mdb commands to save the persistent
state of the debugger to generate the new forms of parameter commands.
Move types and predicates for dealing with browser parameters from
browse.m to here, so that declarative_user.m can use them too.
browser/browse.m:
Delete the code moved to browser_info.m, and conform to the other
changes in the other modules.
browser/listing.m:
Provide a predicate to return the type of listing paths.
scripts/mdbrc.in:
Update the commands that set the XML parameters.
scripts/Mmakefile:
Get mmake to rebuild mdbrc from mdbrc.in when mdbrc.in changes.
trace/mercury_trace_internal.c:
trace/mercury_trace_cmds.h:
trace/mercury_trace_cmd_*.[ch]:
Implement the changes described at the top.
Fix an old bug: the commands that update the search path for the "list"
command don't make the search path term permanent, which is needed in
non-conservative-gc grades.
trace/mercury_trace_spy.c:
Fix some obsolete references to : as module qualifier.
trace/mercury_trace_browse.[ch]:
Delete the functionality now moved to mercury_trace_cmd_parameter.c.
tests/debugger/mdb_command_test.inp:
Update the set of commands being tested.
tests/debugger/save.{inp,exp}:
Update the parameter commands in this test case.
Estimated hours taken: 3
Branches: main
XXX: the change to the mdb "set" command is not yet documented; that will be
addressed in the next change.
Fix the debugger's save command so that it saves everything it should save
(with one unavoidable exception). Rename the "save_to_file" command to "dump",
as we agreed.
NEWS:
doc/user_guide.texi:
doc/mdb_categories:
Document these facts.
browser/browser_info.m:
Provide a predicate to save the entire persistent state of the browser.
Provide a predicate to set the number of I/O actions printed by the
declarative debugger.
Check that the XML browser command and temp file name being set aren't
empty, since those are not meaningful.
Rename predicates to avoid ambiguities and excessively long names.
Simplify some code.
browser/browse.m:
Generate better error messages if the user tries to use XML browsing
without setting it up.
browser/browse.m:
browser/declarative_user.m:
Conform to the changes in browser_info.m
browser/listing.m:
Use the correct prefix on global C symbols.
trace/mercury_trace_internal.c:
Change the save command to save everything of the persistent debugger
state that can be saved.
Allow the set command to set the number of I/O actions printed by the
declarative debugger. Without this, there would be no way to restore
this part of the debugger persistent state, since a source command
cannot start the declarative debugger.
Rename save_to_file as dump.
Use the correct prefix on global C symbols.
Avoid misleading capitalization.
trace/mercury_trace_spy.c:
Extend the code that saves the state of breakpoints to save conditions
on breakpoints as well.
trace/mercury_trace_browser.[ch]:
Add a utility function for saving the persistent browser state.
Conform to the changes in browser/browser_info.m.
trace/mercury_trace_alias.[ch]
Convert to four-space indentation.
tests/debugger/browser_test.{inp,exp}:
tests/debugger/mdb_command_test.inp:
Use dump instead of save_to_file.
tests/debugger/save.{m,inp,exp}:
New test case to test the new behavior of the save command.
tests/debugger/Mmakefile:
Enable the new test case.
Estimated hours taken: 18
Branches: main
Move the univ, maybe, pair and unit types from std_util into their own
modules. std_util still contains the general purpose higher-order programming
constructs.
library/std_util.m:
Move univ, maybe, pair and unit (plus any other related types
and procedures) into their own modules.
library/maybe.m:
New module. This contains the maybe and maybe_error types and
the associated procedures.
library/pair.m:
New module. This contains the pair type and associated procedures.
library/unit.m:
New module. This contains the types unit/0 and unit/1.
library/univ.m:
New module. This contains the univ type and associated procedures.
library/library.m:
Add the new modules.
library/private_builtin.m:
Update the declaration of the type_ctor_info struct for univ.
runtime/mercury.h:
Update the declaration for the type_ctor_info struct for univ.
runtime/mercury_mcpp.h:
runtime/mercury_hlc_types.h:
Update the definition of MR_Univ.
runtime/mercury_init.h:
Fix a comment: ML_type_name is now exported from type_desc.m.
compiler/mlds_to_il.m:
Update the the name of the module that defines univs (which are
handled specially by the il code generator.)
library/*.m:
compiler/*.m:
browser/*.m:
mdbcomp/*.m:
profiler/*.m:
deep_profiler/*.m:
Conform to the above changes. Import the new modules where they
are needed; don't import std_util where it isn't needed.
Fix formatting in lots of modules. Delete duplicate module
imports.
tests/*:
Update the test suite to confrom to the above changes.
Estimated hours taken: 12
Branches: main
Remove from std_util.m the predicates that merely call predicates in
the type_desc, construct and deconstruct modules, to reduce clutter
in std_util.m.
library/std_util.m:
Remove those predicates from std_util.m.
library/deconstruct.m:
Add a type we need that was previously defined in std_util.m.
library/construct.m:
Delete some module qualifications that have now become unnecessary,
browser/browse.m:
browser/browser_info.m:
browser/declarative_tree.m:
browser/dl.m:
browser/help.m:
browser/sized_pretty.m:
browser/term_rep.m:
compiler/bytecode_gen.m:
compiler/llds_out.m:
compiler/mlds_to_il.m:
compiler/mlds_to_managed.m:
library/assoc_list.m:
library/hash_table.m:
library/io.m:
library/pprint.m:
library/private_builtin.m:
library/prolog.m:
library/require.m:
library/rtti_implementation.m:
library/store.m:
library/term.m:
library/term_to_xml.m:
library/version_hash_table.m:
mdbcomp/program_representation.m:
Import type_desc.m, construct.m and/or deconstruct.m to provide
definitions of functions or predicates that up till now were in
std_util.m. Modify the calls if the called function or predicate
had a slightly different interface in std_util.m.
Also, convert term_to_xml.m to four-space indentation, and delete
unnecessary module qualifications in term.m.
tests/debugger/polymorphic_output.{m,inp,exp,exp2}:
tests/hard_coded/copy_pred_2.m:
tests/hard_coded/deconstruct_arg.exp:
tests/hard_coded/deconstruct_arg.exp2:
tests/hard_coded/deconstruct_arg.m:
tests/hard_coded/elim_special_pred.m:
tests/hard_coded/existential_bound_tvar.m:
tests/hard_coded/expand.m:
tests/hard_coded/foreign_type2.m:
tests/hard_coded/higher_order_type_manip.m:
tests/hard_coded/nullary_ho_func.m:
tests/hard_coded/tuple_test.m:
tests/hard_coded/type_ctor_desc.m:
tests/hard_coded/type_qual.m:
tests/hard_coded/write_xml.m:
tests/hard_coded/sub-modules/class.m:
tests/hard_coded/sub-modules/nested.m:
tests/hard_coded/sub-modules/nested2.m:
tests/hard_coded/sub-modules/nested3.m:
tests/hard_coded/sub-modules/parent.m:
tests/hard_coded/sub-modules/parent2.child.m:
tests/hard_coded/typeclasses/existential_rtti.m:
tests/recompilation/type_qual_re.m.1:
cvs update: Updating tests/submodules
cvs update: Updating tests/tabling
cvs update: Updating tests/term
cvs update: Updating tests/tools
cvs update: Updating tests/trailing
cvs update: Updating tests/typeclasses
cvs update: Updating tests/valid
tests/valid/agc_unbound_typevars.m:
tests/valid/agc_unbound_typevars2.m:
tests/valid/agc_unused_in.m:
Replace references to the deleted predicates in std_util with
references to the equivalent predicates in type_desc, construct
and/or deconstruct. In test cases that already tested both the
functionality in std_util and in the other modules, simply delete
the part exercising std_util.
Estimated hours taken: 2
Branches: main
browser/*.m:
Replace __ with . as the module qualifier everywhere in all the modules
of the browser directory. Convert the currently tab-indented modules
to four-space indentation. Delete some unnecessary module
qualifications. Change some type names and function symbols to avoid
ambiguities. Replace a bunch of uses of DCGs with state variable
notation.
Estimated hours taken: 5
Branches: main
Allow field names to be used in the paths used with subterm dependency
tracking.
Allow the user to cd to the return value of a function by giving the
number of arguments plus one as an argument to the `cd' command.
browser/browse.m:
Export the predicate that removed ".." from paths.
Make the return value of this predicate a subtype, so we can be
sure the simplification has been applied to the path.
Allow the user to do `cd N', where N is the number of arguments of
a function plus one. This will cd to the return value of the function.
Add some more aliases for the directory name of the return value of a
function.
browser/browser_info.m:
Use the new simplified_dirs inst.
When converting a list of directories to a term path, look at the
value the path applies to to resolve field names in the path.
browser/declarative_user.m:
Report an error if the user tries to track an I/O action.
Call the new version of convert_dirs_to_term_path which handles
field names in the path.
browser/term_rep.m:
Add predicates to lookup a subterm in a term representation and
also to look up a named field in a term representation.
tests/debugger/declarative/Mercury.options:
tests/debugger/declarative/Mmakefile:
tests/debugger/declarative/named_fields.exp:
tests/debugger/declarative/named_fields.inp:
tests/debugger/declarative/named_fields.m:
Test tracking of subterms using a path with a field name.
tests/debugger/polymorphic_output.exp*
The output of this test has changed, because cd's to the return value
of a function, using a number, are now allowed.
Estimated hours taken: 20
Branches: main
Implement a second version of the subterm dependency tracking algorithm
that uses the following heuristic to speed things up: If the subterm is being
tracked through an output argument, and there is an input argument with the
same name as the output argumnet, except for a numerical suffix, then the new
algorithm will check if the subterm appears in the same position in the input
argument. If it does then it will continue tracking the subterm in the input
argument, thus bypassing the subtree rooted at the call. Since dereferencing a
subterm in a large structure can be expensive, the new algorithm will only try
to bypass calls to procedures it has not tried to bypass before. The set of
procedures it has tried is reset each time a new explicit subtree or supertree
is generated.
Add a `track' command that behaves in the same way as `mark', except that
it doesn't assert that the node is erroneous or inadmissible.
Add an optional `--accurate' argument which tells the declarative debugger to
use the original tracking algorithm.
We still allow the old algorithm to be used, because there
are situations where the new algorithm could find the wrong call (i.e.
when a subterm appears in the same position in an input argument,
but the subterm in the output argument is actually bound by a descendent call
-- it just happens to be bound to the same value as the input subterm).
doc/user_guide.texi:
Change the documentation accordingly.
browser/browse.m:
browser/browser_info.m:
browser/parse.m:
browser/declarative_user.m:
Add a `track' command that does the same thing as a `mark' command,
except it doesn't assert the atom to be erroneous or inadmissible.
Allow an `--accurate' or `-a' argument for the `mark' and `track'
commands which indicates that the old subterm dependency tracking
algorithm should be used.
Pass information about tracked subterms to the declarative debugger.
Do not allow a whole atom to be tracked or marked as this doesn't
make sense.
browser/declarative_analyser.m:
browser/declarative_debugger.m:
browser/declarative_edt.m:
browser/declarative_oracle.m:
Implement the new tracking algorithm.
browser/term_rep.m:
Add a predicate to dereference a subterm in another term.
mdbcomp/rtti_access.m:
Add a predicate to find a candidate input argument on which to
apply the new heuristic.
runtime/Mmakefile:
runtime/mercury_layout_util.h:
runtime/mercury_stack_layout.h:
trace/mercury_trace_vars.c:
trace/mercury_trace_vars.h:
Move the function for finding the name of a variable to the runtime,
so that it can be called from the declarative debugger.
tests/debugger/declarative/Mmakefile:
tests/debugger/declarative/nodescend_tracking.exp:
tests/debugger/declarative/nodescend_tracking.inp:
tests/debugger/declarative/nodescend_tracking.m:
Test the new heuristic.
tests/debugger/declarative/closure_dependency.inp2:
tests/debugger/declarative/closure_dependency.exp2:
Expect an error message when marking a whole atom.
Estimated hours taken: 8
Branches: main
Add two new capabilities to the debugger.
The first capability is the idea of "held variables", variables that the
debugger holds onto even when execution has left the event they came from.
You can hold onto a variable via the mdb command "hold varname heldvarname".
You can suffix the name of the existing variable with a term path, in which
case the new held variable will refer only to the specified part of the term.
Later mdb commands can refer to the held variable by prefixing its name with
a dollar sign. For example, after "hold HeadVar__1^2 x", "$x" will refer to
the term that was the second argument of HeadVar__1 at the program point
at which the "hold" command was executed.
The second capability is the ability to compute the diff of two terms and
express those diffs as the term paths of the function symbols at which the two
terms differ, instead of the line numbers you get by using save_to_file and the
usual Unix diff command. The mdb command is "diff var1 var2". We limit the
number of term paths of difference sites that we display at any one time;
the mdb diff command has options to control this.
NEWS:
Mention the new capabilities.
doc/user_guide.texi:
Document the new mdb commands "hold" and "diff", the new mdb command
"held_vars" which simply lists the names of all the held variables
(just as "vars" lists the names of all the nonheld variables currently
accessible), and the concept of held variables.
doc/mdb_categories:
Update this file for the new mdb commands and concepts.
browser/browse_diff.m:
This new module implements the diff operation on terms.
browser/mdb.m:
Add the new module to the list of submodules of the mdb package.
browser/*.m:
Minor cleanups, such as importing only one module per line; there
are no algorithmic changes.
trace/mercury_trace_hold_vars.[ch]:
This new module implements the database of held variables.
trace/Mmakefile:
Mention the new module.
trace/mercury_trace_internal.c:
Implement the three new mdb commands.
trace/mercury_trace_vars.[ch]:
Modify the functions that recognize variable specifications or
process them to work with held variables as well as variables from
the current environment. This required some reorganization of the
internals of this module.
Provide some a utility function, MR_trace_parse_lookup_var_path,
for converting a string representing the specification of a term
(a variable and possibly some path within it) to the type and value
of that term. Make the utility function this is based upon,
MR_lookup_unambiguous_var_spec, replace the previous but less capable
MR_convert_var_spec_to_type_value.
trace/mercury_trace_spy.c:
Conform to the change in mercury_trace_vars.c.
trace/mercury_trace_util.c:
Make a utility function more robust.
trace/mercury_trace_alias.c:
Minor cleanups.
tests/debugger/queens.{inp,exp*}:
Update this test case to test the debugger's new capabilities.
tests/debugger/completion.{inp,exp*}:
Update this test case to expect the new mdb commands, and avoid the
ambiguity between "help" and "held_vars".
Estimated hours taken: 6
Branches: main
Allow an XML term browser to be called from the declarative debugger.
browser/browse.m
Add a predicate to save a term to an XML file and then launch an
XML browser.
Add a predicate that saves a term to an XML file and doesn't print
any error messages, but just returns an io.res result. Use this
in save_term_to_file_xml and the predicate mentioned above.
browser/browser_info.m
Add two fields to the browser's persistent state - one to record the
temporary filename to use when saving a term to an XML file and one
to hold the command to launch the XML browser. Previously these were
stored in C global variables which were not accessible from the
declarative debugger.
Export the browser_persistent_state type so the field access functions
can be used from browse.m.
browser/declarative_user.m
Allow the user to give an -x or --xml option to the browse command from
within the declarative debugger.
Reformat the user_command type and add a new functor: browse_xml_arg/1.
Describe the -x or --xml browse option in the help message and reformat
the trust command help message as it was looking a bit untidy.
tests/debugger/browser_test.exp
tests/debugger/browser_test.inp
Test the --xml option from within the declarative debugger.
trace/mercury_trace_browse.c
trace/mercury_trace_browse.h
trace/mercury_trace_internal.c
Move MR_trace_save_and_invoke_xml_browser from mercury_trace_internal.c
to mercury_trace_browse.c so it can call the new Mercury code in
browser/browse.m.
Handle the `set xml_browser_cmd' and `set xml_tmp_filename' commands by
calling Mercury code to set the appropriate fields in the persistent
browser state.
Estimated hours taken: 0.2
Branches: main
browser/*.m:
Fix the current mixture of __ and . to module qualify module names
by standardizing on the latter.
Estimated hours taken: 5
Branches: main
Add `mode' command to interactive term browser to display the mode of a
sub-term. At the moment this command only works when the term browser is
invoked from inside the declarative debugger.
browser/browser_info.m
Allow a function to be passed to the browser which it can call to
work out the mode of a sub-term.
browser/browse.m
Export versions of the browser invocation predicates that don't
accept a mode function.
Handle the `mode' browser command by calling the supplied function
if it's present.
Document the `mode' command in the browser help message.
browser/declarative_debugger.m
To determine the mode of a sub-term we compare the state of
instantiation of the sub-term at the CALL event and at the EXIT, FAIL
or EXCP event. To do this we need the initial and final
atoms for incorrect contour bugs and wrong answer nodes (for
other nodes the initial and final atoms are the same).
browser/declarative_oracle.m
Conform to the fact that wrong answers now also have the
initial atom.
browser/declarative_tree.m
Export trace_atom_subterm_is_ground/3 for use in declarative_user.m.
Include the initial atom in wrong answer nodes and incorrect contour
bugs.
browser/declarative_user.m
Add function arg_num_to_arg_pos to replace some duplicated code.
Alter the edt_node_trace_atom predicate to find the initial and the
final atoms for a question.
Add a function to find the mode of a sub-term given the path to the
sub-term and the initial and final atoms. Pass this function to
the browser so it can work out the mode of a sub-term.
browser/parse.m
Parse `mode' command.
tests/debugger/declarative/Mmakefile
tests/debugger/declarative/browser_mode.exp
tests/debugger/declarative/browser_mode.inp
tests/debugger/declarative/browser_mode.m
Test the `mode' command.
Estimated hours taken: 5
Branches: main
Allow terms to be saved as XML in mdb and allow an XML browser to be invoked on
browsable objects in mdb. The user can set two options which control where the
XML is dumped and the command used to browse the XML. The defaults assume
xsltproc and mozilla are installed.
configure.in
Check for mozilla/firefox and xsltproc so default the mdb XML browser
command can be set if they are found.
browser/browse.m
Add a predicate to save a browser term as XML to a file.
doc/user_guide.texi
Document new --xml option for the mdb `browse' command.
Document new --xml option for the mdb `save_to_file' command.
Document the `set xml_tmp_filename' and `set xml_browser_cmd' commands.
scripts/Mmakefile
Copy extras/xml_stylesheets/xul_tree.xsl to the mdb install
directory so it can be used by the default XML browser command.
scripts/mdbrc.in
Set default values for xml_browser_cmd and xml_tmp_filename.
scripts/xul_tree.xsl
Copy this stylesheet here so there isn't a dependency on the extras
directory.
tests/debugger/browser_test.inp
tests/debugger/browser_test.exp
Test --xml option for `browse' command.
trace/mercury_trace_browse.c
trace/mercury_trace_browse.h
Add functions to save a term as XML to a file and then
invoke the user's XML browser.
trace/mercury_trace_internal.c
Add --xml option to `browse' and `save_to_file' mdb commands and
handle this option.
Estimated hours taken: 1.5
Branches: main
Rename "pretty" browser format to "raw_pretty" and "raw_pretty" to "pretty".
Make old "pretty" format print function return values. Remove univ_cons
constructor around old "raw_pretty" function return values.
Add extra note in NEWS about declarative debugger `trust' command.
browser/browse.m
Rename "raw_pretty" to "pretty" and vica versa. Use univ value when
creating doc for return value.
browser/sized_pretty.m
If a synthetic term has a return value then include it in the doc.
NEWS
Add note about print format name change.
Also add note about declarative debugger `trust' command.
tests/debugger/browse_pretty.exp
tests/debugger/browse_pretty.inp
tests/debugger/declarative/browse_arg.exp
tests/debugger/declarative/browse_arg.inp
tests/debugger/declarative/dependency.exp
tests/debugger/declarative/dependency.inp
Change input and expected output where pretty or raw_pretty formats
used.
tests/debugger/browser_test.m
tests/debugger/browser_test.exp
tests/debugger/browser_test.inp
Test printing of function applications.