Branches: main, 10.04
Filter out warning message from gcc 4.x which are emitted when compiling
low-level C code using assembler labels, at least until a better fix is
available.
util/Mmakefile:
util/mfiltercc.c:
Add a new program, mfiltercc.
compiler/options.m:
Add `--filtercc-command' option (undocumented).
compiler/compile_target_code.m:
Filter compiler output with mfiltercc if using assembler labels.
scripts/mgnuc.in:
Filter compiler output with mfiltercc if using assembler labels, but
only if mfiltercc can be found on the $PATH. The bootstrap compiler
may not have mfiltercc.
.mercury-compiler.spec.in:
Makefile:
README.MinGW:
bindist/Mmakefile:
bindist/bindist.Makefile.in:
scripts/mercury_config.in:
Mention mfiltercc in various places.
bindist/bindist.Makefile.in:
Output the reminder about setting PATH etc to the post_install
step. As part of the install step it gets lost amongst the output
from configure that follows.
Estimated hours taken: 0.1
Branches: main
bindist/Mmakefile:
bindist/bindist.Makefile.in:
Delete references to the mercury_cleanup_install script.
It was deleted earlier this year.
doc/reference_manual.texi:
Fix the order of the arguments of list.filter/3.
.INSTALL.in:
Mmakefile:
bindist/bindist.Makefile.in:
Use add-to-list and remove unnecessary calls to expand-file-name.
doc/mercury.info.in:
Make the menu work with Emac's info viewer.
Estimated hours taken: 1
Branches: main, release
Fix the scripts that build and install the binary packages for Linux. These
have been broken since the change that moved the executables, mercury_compile,
mercury_profile etc, into $(INSTALL_PREFIX)/bin.
bindist/Mmakefile:
Tar up the bin directory of the installation we are building
the binary package from since it now contains the executables.
Conform to the current structure of the library installation
hierarchy.
bindist/bindist.Mmakefile.in:
Conform to the above changes when installing.
Estimated hours taken: 1
Branches: main and 0.12
Remove the architecture string from the installed directory structure
and put the executables in $PREFIX/bin, instead of
$PREFIX/lib/mercury/bin/$FULLARCH.
The reason for this change is to reduce the need for unix shell scripts in
the top-level bin directory that call the actual programs in the
lib/mercury/bin/FULLARCH directory. The unix scripts can't be run on Windows
without a unix emulation environment like Cygwin.
Because the executables are now in the top-level bin directory, we cannot
install multiple architectures under the same directory structure. However
this is not a real loss, since the binaries for different architectures can
just be installed to different locations, as we currently do anyway on
mundula.cs.mu.oz.au.
The plan is to rename mercury_compile to mmc and do away with the mmc unix
script. This will allow mmc to be run on Windows without Cygwin or MSYS.
This proposal replaces a previous proposal to implement a C version of the
mmc script. That solution turned out to be quite complicated and
unreliable.
This diff will also mean mdice, mslice and mtc_union will be in the same
directory as mmc, so will be in the PATH as long as mmc is in the PATH.
configure.in:
bindist/Mmakefile:
bindist/bindist.Makefile.in:
compiler/compile_target_code.m:
compiler/handle_options.m:
compiler/make.program_target.m:
debian/rules:
library/Mmakefile:
scripts/Mmake.vars.in:
scripts/mdprof.in:
scripts/mercury.bat.in:
scripts/mgnuc.in:
scripts/ml.in:
scripts/mmc.in:
scripts/mprof.in:
tools/run_all_tests_from_cron:
tools/test_mercury:
Remove FULLARCH from the installed directory structure.
Install executables to the top-level bin directory.
Estimated hours taken: 0.5
Branches: main, release
bindist/bindist.Makefile.in:
Fix a bug: don't depend on $(INSTALL_CGI_PROG), since if the
binary distribution was built without deep profiling enabled
(as it must be on some architectures), then $(INSTALL_CGI_PROG)
won't exist.
Estimated hours taken: 20
Branches: main
Move the setting of configuration options from mmc.in to
an options file Mercury.config. This has a few advantages:
- reduces the duplication between mmc and mercury.bat
- reduces the chance of running out of environment space
on crappy operating systems (although we probably exceed
the command line length limits on those systems anyway).
- makes it easier to bootstrap changes which add new
configuration options.
Always read the options files, even without `--make',
to avoid inconsistent behaviour.
scripts/Mercury.config.in:
New file containing the configuration code from mmc.in.
configure.in:
Create scripts/Mercury.config.
bindist/Mmakefile:
Make sure Mercury.config.in goes in the binary distribution.
Mmakefile:
bindist/Mmakefile:
Mmake.common.in:
Make sure we get the correct setting of INSTALL_PREFIX
when building the binary distribution.
scripts/Mmakefile:
scripts/mercury_config.in:
bindist/bindist.Mmakefile.in:
Install Mercury.config.
compiler/options.m:
doc/user_guide.texi:
Add documentation for the `--config-file' option, which gives
the name of the configuration file to read.
Add an option `read-config-file-2003-03-01' which will be
used in configure.in to test whether the compiler is up
to date after the configuration code is removed from mmc.in
(after this change is installed everywhere).
Add `--mercury-config-dir' as an abbreviation for
`--mercury-configuration-directory'.
Mmake.workspace:
Use the configuration file in scripts/Mercury.config.
browser/Mmakefile:
compiler/Mmakefile:
scripts/Mmake.vars.in:
Always pass ALL_MCFLAGS to mmc so that mmc will
use the configuration file specified in the options.
compiler/handle_options.m:
Handle the default value of `--config-file'.
compiler/mercury_compile.m:
Read the configuration file.
Always read the options files, even without `--make',
to avoid inconsistent behaviour.
compiler/make.m:
Pass the variable settings from the configuration file
to make__process_args.
The options files have already been read in mercury_compile.m,
so don't read them again here.
compiler/make.util.m:
Add a version of build_with_module_options which doesn't
need a make_info, for use by mercury_compile.m.
compiler/options_file.m:
Export a predicate to read a single options file.
Make the predicates to read options files add to an initial
options_variables map, rather than always creating a new one.
Allow MERCURY_STDLIB_DIR and MERCURY_CONFIG_DIR
to be set in the options file or environment.
scripts/mmc.in:
Set MERCURY_STDLIB_DIR and MERCURY_CONFIG_DIR in
mercury_compile's environment.
Estimated hours taken: 20
Branches: main
Allow reconfiguration of existing installations, for example
to use a different C compiler. The reconfiguration works
by making a new copy of the scripts and mercury_conf.h,
and storing them in a partial installation directory tree
which uses the libraries and executables from the existing
installation.
Use this method to configure binary distributions, rather
than using a cut down version of the configuration script,
to avoid code duplication and to handle the case where the
C compiler in use on the installation machine is different
than that used to build the binary distribution.
This is more robust than the previous method of using a different
C compiler, which was to set the MERCURY_C_COMPILER variable and
hope the different C compilers were compatible enough.
Mmakefile:
runtime/Mmakefile:
scripts/Mmakefile:
Modify the `install' targets to store files needed to create
a new configuration in $INSTALL_LIBDIR/reconf.
runtime/Mmakefile:
Install mercury_conf.h in $INSTALL_LIBDIR/conf, rather than
$INSTALL_LIBDIR/inc, so that it can be overridden by a
different configuration.
scripts/mercury_config.in:
Create a new configuration, by creating part of a Mercury
source tree from the files stored in $INSTALL_LIBDIR/reconf,
running configure, then copying the files into a partial
installation tree.
scripts/Mmake.vars.in:
Define ENABLE_DEEP_PROFILER, for use by bindist/bindist.Makefile.
Define variables INSTALL_CONF_DIR (contains the files describing
the configuration) and INSTALL_RECONF_DIR (contains files needed
to reconfigure an installation).
configure.in:
Add an option `--enable-reconfigure', for use by
mercury_config.in.
Don't look for runtime/mercury_wrapper.c when checking
for the sources -- it isn't present when reconfiguring.
Look for scripts/mmc.in instead.
Look for the runtime headers in the installation hierarchy
rather than the `runtime/' and `trace/' directories when
reconfiguring.
Output the help message for the `configure' script to
`configure.help'. This is included in the help message
for `mercury_config'.
Add new configuration variables CONFIG_PREFIX and CONFIG_LIBDIR,
which are like PREFIX and LIBDIR except that they point
to the configuration files, not the library files.
In the normal case PREFIX and CONFIG_PREFIX will be the same.
bindist/bindist.INSTALL.in:
bindist/bindist.Makefile.in:
Use mercury_config to configure binary distributions.
bindist/Mmakefile:
bindist/bindist.configure.in:
bindist/bindist.build_vars.in:
Remove bindist.configure.in and bindist.build_vars.in.
compiler/options.m:
scripts/parse_ml_options.sh-subr.in:
scripts/mgnuc.in:
doc/user_guide.texi:
Add an option `--mercury-config-dir', and an environment
variable MERCURY_CONFIG_DIR, which tell the compiler and
scripts where to find the configuration files for the
installation.
MERCURY_CONFIG_DIR is not documented because it should
only be used by the scripts.
compiler/compile_target_code.m:
Pass `--mercury-config-dir' to the scripts.
compiler/handle_options.m:
Add `--c-include-directory $MERCURY_CONFIG_DIR/conf'.
library/getopt.m:
Handle `maybe_string_special' options.
doc/user_guide.texi:
Update the "Using a different C compiler" chapter.
NEWS:
Document the changes.
Estimated hours taken: 2
Branches: main
Apply Zoltan's deep profiler changes to the main branch. Zoltan committed
these changes to the release branch, but forgot to commit them to the main
branch.
Mmakefile:
NEWS:
configure.in:
bindist/Mmakefile:
bindist/bindist.Makefile.in:
doc/user_guide.texi:
library/exception.m:
library/io.m:
runtime/mercury_conf.h.in:
runtime/mercury_conf_param.h:
runtime/mercury_misc.c:
runtime/mercury_misc.h:
scripts/Mmakefile:
deep_profiler/.nocopyright:
deep_profiler/Mercury.options:
deep_profiler/Mmakefile:
deep_profiler/callgraph.m:
deep_profiler/cliques.m:
deep_profiler/conf.m:
deep_profiler/html_format.m:
deep_profiler/interface.m:
deep_profiler/mdprof_cgi.m:
deep_profiler/query.m:
deep_profiler/startup.m:
deep_profiler/timeout.m:
deep_profiler/mdprof_server.m:
deep_profiler/server.m:
Merge in changes from the release branch.
Enclosed below is Zoltan's original log message.
----------
Estimated hours taken: 0.3 (on release branch)
Branches: release
Make the deep profiler work again.
The existing process structure of the deep profiler made it very hard to debug,
mainly because the Mercury debugger is confused by forks and stymied by execs.
This change completely replaces the process structure. The old structure had
two separate programs, mdprof_cgi and mdprof_server, the first always acting
as client and the second always acting as server. The new structure has only
one program, mdprof_cgi, which acts as a server if there is no existing server
for the relevant profiling data file, and as a client otherwise.
Although mdprof_cgi normally forks when it becomes a server to let the parent
exit and let the web server know that the web page it has generated is
complete, the fork can be disabled for debugging via an option. This allows
the communication between client and server to be debugged by running two
instances of mdprof_cgi in different windows, one or both under mdb.
deep_profiler/DESIGN:
New file describing the new process structure, its race conditions,
and their solutions.
deep_profiler/.nocopyright:
Add DESIGN.
deep_profiler/mdprof_cgi.m:
A complete rewrite of this module to enable it act as both client and
server.
deep_profiler/mdprof_test.m:
A new module to hold the testing functionality of mdprof_server.m.
deep_profiler/mdprof_server.m:
deep_profiler/server.m:
Delete these now unnecessary modules.
Mmakefile:
Replace references to mdprof_server with references to mdprof_test.
deep_profiler/Mmakefile:
Replace references to mdprof_server with references to mdprof_test.
Move the include of Mmake.deep.params, to allow it to override
top level parameter settings.
deep_profiler/Mercury.options:
Work around a compiler bug by turning off the offending optimization.
deep_profiler/timeout.m:
A rewrite of major parts of this module to support the new design
of mdprof_cgi.m, and to make unexpected signals easier to debug.
deep_profiler/interface.m:
Implement the mechanisms needed by the new process structure.
Change the characters we use to separate components of the URL.
The old ones were special to the shell, and screwed up command lines.
(As double insurance, we ignore the command line anyway when invoked
by the web server.)
Change some names to be more expressive.
deep_profiler/conf.m:
Add a new function, getpid, for use by interface.m.
Rewrite some code to use streams explicitly, not implicitly.
deep_profiler/callgraph.m:
deep_profiler/cliques.m:
Add (now commented out) code to help debug these modules, for use
in cases where mdb doesn't help, because the program works perfectly
with debugging enabled :-(
deep_profiler/query.m:
Move the predicate try_exec here from the deleted file server.m.
deep_profiler/html_format.m:
Trivial change to conform to name change in interface.m.
deep_profiler/startup.m:
Generate debugging output to a caller specified stream, not to
stdout and stderr.
Disable the generation of statistics temporarily, since the diff
to make statistics reporting routines write to a specified stream
instead of stdout and stderr won't be committed on the release branch.
Currently, they always write to stdout, which in the new design
goes to the web page, not to the startup file.
configure.in:
Detect the presence of opendir, readdir and closedir, and the header
file they need, dirent.h. Enable the deep profiler only if all exist,
since the deep profiler now needs them.
runtime/mercury_conf.h.in:
Support the changes to configure.in.
runtime/mercury_misc.[ch]:
Add a mechanism for registering cleanup functions to be executed when
we terminate the program due to an uncaught exception.
library/exception.m:
Invoke the registered cleanup functions just before terminating
the program due to an uncaught exception.
Estimated hours taken: 1.0
Branches: main
Improve the bindist for the .NET backend.
bindist/bindist.Makefile.in:
If installing on a machine with the .NET SDK, and the bindist
has an ilc grade included, install mercury.dll into the global
assembly cache.
aclocal.m4:
Add a test for gacutil.
Estimated hours taken: 1
Branches: main
Add rules for installing the deep profiler from binary distributions.
bindist/bindist.INSTALL:
Document the installation of the deep profiler.
bindist/bindist.Makefile.in:
Add rules for installing the deep profiler.
bindist/bindist.build_vars.in:
Add the variables needed by the rules for installing the deep profiler.
bindist/bindist.configure.in:
Define the variables needed by the rules for installing the deep
profiler.
Estimated hours taken: 0.25
Branches: main
bindist/bindist.Makefile.in:
Use pipes rather than doing gunzip and tar -x in separate steps.
This is faster and requires significantly less disk space.
The gnu-win32/Cygwin bug that the previous code was working
around has been fixed since at least Cygwin 1.1.*.
Estimated hours taken: 1.5
Fix problems with binary distribution on windows. The problem was
the installation of the bindist would fail when the executables
in the utils directory were copied, because they had a .exe suffix.
bindist/bindist.Makefile.in:
Use EXT_FOR_EXE generate the filenames for executables in the
utils directory.
bindist/bindist.build_vars.in:
bindist/bindist.configure.in:
Pass EXT_FOR_EXE along from the top level configure.
Estimated hours taken: 0.25
Fix a bug in the Mercury 0.9 binary distribution.
bindist/bindist.Makefile.in:
Change EMACS_SCRIPTS to INSTALL_EMACS_SCRIPTS,
to match the name used in the install_emacs_scripts rule.
Estimated hours taken: 30
Added built-in mmake support for installing user libraries.
Mmake.common.in:
Moved the definitions of many of the generic install directories
(plus FULLARCH and LIBGRADES) to scripts/Mmake.vars.in, so they
can be used for things other than just the Mercury compiler.
compiler/modules.m:
Added code to generate appropriate lib<module>.install* targets.
Improved the dependency list generated for the lib<module> target to
include intermodule optimisation files if and only if the
appropriate flags have been set (previously it always depended on
the `.opt' files, but never on the `.trans_opt' files).
scripts/Mmake.rules:
Added some rules for use when installing libraries.
scripts/Mmake.vars.in:
Added the definitions of many of the generic install directories
(plus FULLARCH and LIBGRADES) from Mmake.common.in.
Added support for overriding and/or adding to the definition of
LIBGRADES on a per-library basis.
scripts/mercury_cleanup_install:
New script, for cleaning up after failed installs.
scripts/Mmakefile:
Added `mercury_cleanup_install' to the list of scripts to be
installed.
bindist/Mmakefile:
bindist/bindist.Makefile.in:
Added `mercury_cleanup_install' and `vpath_find' to the list of
utilities included in and installed by a binary distribution. These
are used by some of the install targets.
doc/user_guide.texi:
Documented the new features.
extras/references/Mmakefile:
extras/references/samples/Mmakefile:
Changed to exploit/test new features.
Estimated hours taken: 0.25
Fix a security problem with the use of `chmod +w'.
bindist/bindist.Makefile.in:
Use `chmod u+w' rather than `chmod +w' on the installed files,
since `chmod +w' has the wrong effect with some versions of chmod.
When configure creates automatically-generated files, we (used to)
do a `chmod -w' on them to make sure that you don't accidentally edit
the automatically-generated file rather than the source `.in' file.
However, if the installed copies are write-only, then it causes
problems when installing a new copy on top of an old one.
Hence we turn write permission back on again on the installed copies.
The `chmod +w' command has the right effect on Solaris, OSF/1, Linux,
and SunOS, where it takes into account the umask. However, on IRIX
and ULTRIX, `chmod +w' does not take the umask into account, and so
makes the files world-writable, which is a security problem.
Hence, we now use `chmod u+w' instead.
Estimated hours taken: 0.25
Remove support for NU-Prolog and SICStus Prolog.
bindist/Mmakefile:
bindist/bindist.Makefile.in:
Delete the rules for building NU-Prolog and SICStus Prolog stuff.
Estimated hours taken: 16
Add support for debugging Mercury code using mdb to "Gud",
the Emacs "Grand Unified Debugger". This lets you run mdb
under emacs, using the tags file provided by `mtags --emacs'
for source code linking.
scripts/gud.el:
Add support for Mercury.
Mmake.common.in:
scripts/Mmakefile:
bindist/Mmakefile:
bindist/bindist.Makefile.in:
Modify the installation scripts to install gud.el in
.../lib/mercury/elisp.
.INSTALL.in:
bindist/bindist.INSTALL:
Document what you need to add to your ~/.emacs file to
use the Emacs mdb interface.
Estimated hours taken: 0.5
Fix a couple more things that I forgot to add to the binary
distribution.
bindist/bindist.Makefile.in:
Install the `mprof_merge_runs' script.
bindist/bindist.configure.in:
Substitute the value of the DEFAULT_RM_C variable.
Estimated hours taken: 0.75
Fix some more bugs in the binary distribution.
bindist/Mmakefile:
bindist/bindist.Makefile.in:
Fix bugs in the handling of the mdbrc and mdb_doc files.
Estimated hours taken: 0.25
Fix yet another bug in the binary distribution.
bindist/bindist.Makefile.in:
Fix a bug in my previous change to this file -- it
was doing the wrong thing when installing on machines
missing either SICStus or NU-Prolog.
Estimated hours taken: 0.5
Fix another couple of bugs in the binary distribution.
bindist/bindist.Makefile.in:
- Make sure to install the `mdb' and `mmake' lib subdirectories.
- Ensure that installation doesn't fail in the case where
the binary distribution was built without SICStus or NU-Prolog
but is installed on a machine which does have either of those
installed.
Estimated hours taken: 0.5
Fix some bugs in the binary distribution.
bindist/bindist.configure.in:
Copy some code that was added to ../configure.in:
- Check for `mktemp'
- Substitute DEFAULT_MERCURY_DEBUGGER_INIT_DIR.
bindist/Mmakefile:
Include `mprof_merge_runs' in the list of utility programs.
Don't include `mdb' in the list of script files, since that list
already includes `mdb.in', which is the file we want.
bindist/bindist.Makefile.in:
Add `mdbrc' to the list of script files to install.
Estimated hours taken: 0.2
Remove mint since it isn't very useful anymore, is buggy, and
has been surplanted by the library reference manual.
scripts/mint.in:
removed.
mercury/configure.in:
bindist/bindist.Mmakefile.in:
bindist/bindist.configure.in:
scripts/Mmakefile:
remove references to `mint' and `mint.in'.
Estimated hours taken: 90
This change makes the tracer a lot more useful. The major points are:
- you can now print the values of live variables at all trace ports,
not just at entry and exit ports;
- you can now print the values of polymorphic variables;
- you can now set spy points;
- you can now say "give me back control when execution starts going
forward again";
- the implementation no longer saves and restores a thousand pseudo-registers
unnecessarily;
- the implementation no longer insists that stack layouts must be present
either for all labels or for none;
- you can now execute programs compiled with tracing without user intervention
if that is what you want.
The last change makes bootstrapping with --generate-trace possible in theory,
although this has not yet been done successfully.
The three major things remaining to be done to make the tracer an adequate
replacement for Prolog debugging are
- a real term browser;
- a redo capability
- being able to trace different modules at different levels
(full/interface/none).
Two less important things to do are making the representation of typeinfos
themselves type correct :-( and not including partially clobbered variables
in trace events (we already filter out fully clobbered variables, which are
the vast majority of all at-least-partially clobbered variables).
compiler/trace.m:
We now record information about what (non-fully-clobbered) variables
are live where in a label that we associate with each event,
a label we allocate for this purpose. Since the stack layouts can
only describe registers and stack slots, generating a trace event
may now require materializing some variables and moving some others
from fields to registers or stack slots.
We now recognize three kinds of events: external, normal internal
and nondet pragma C code internal. We have different predicates
for generating each kind of event, since the three kinds of callers
are different and have different information available.
compiler/arg_info.m:
compiler/code_info.m:
Move some code that always belonged in arg_info.m to arg_info.m
from code_info.m.
compiler/code_exprn.m:
Add a predicate to find out which registers are in use, so the tracer
can avoid saving and restoring registers that are not use.
compiler/code_gen.m:
Reorganize the handling of epilogs. Whereas epilogs used to generate
the failure handling code, this is now done in generate_category_code,
because failure handling is now complicated by having to save the
input args for the fail event, and the setup for this naturally
belongs in generate_category_code.
Rename generate_{prolog,epilog} as generate_{entry,exit}, since
this makes clear that the latter now only handles success
continuations, not failure continuations.
Spell prologue and epilogue correctly elsewhere.
Also move the responsibility for the call event to
generate_category_code.
Move Tyson's recent additions for tracing to trace.m in a generalized
form, since they are now needed for all events, not just call and exit.
Remove obsolete code for eager code generation.
compiler/code_info.m:
Add a predicate to call the new predicate in code_exprn.
Export a predicate for trace.m.
Considerably simplify the treatment of continuation_infos,
with code_info structures now storing only the stuff that can change
during code generation (due to trace events).
compiler/code_util.m:
compiler/opt_util.m:
compiler/vn_filter.m:
compiler/trace.m:
Move some code to code_util.m from opt_util.m and generalize it a bit,
since the new predicate in code_exprn.m now needs the functionality.
Make trace.m and vn_filter.m refer to the moved predicates by their
new name.
compiler/continuation_info.m:
Major reorganization and simplification of the data structures.
The data that changes during code generation is now stored in the
code generator state; data that is only available after code generation
is combined with the info from the code generator state and put into
the HLDS; data that is available only after optimization is put
directly into the HLDS.
Do not add continuation_info records for labels that are not used
either by tracing or by agc. For labels that are used by either,
always include stack layout information if any variables are live.
(The removal of an unnecessary layer of maybe's wasn't ready
for this time around; Tom will remove this layer soon.)
compiler/continuation_info.m:
compiler/stack_layout.m:
Do not associate the stack layout information at procedure entry and
exit with the per-procedure data structure. Since we now associate this
info with the labels of those events instead, they do not need special
handling. However, do include a pointer to the layout structure of
the label associated with the call event in the per-procedure data,
so that we can later implement redo in the debugger.
compiler/stack_layout.m:
Handle the possibility that the set of type variables that are needed
at a point is not numbered 1-N without any missing type var numbers.
This can happen if all variables whose types include a low-numbered
type variable die before some of those whose types include a higher-
numbered type variable.
compiler/*_switch*.m:
compiler/ite_gen.m:
compiler/disj_gen.m:
When creating trace events, associate not just a goal path but
also a pre-death set with events that represent entry to a computation
branch. Trace.m now needs the pre-death set so that it can avoid
trying to flush variables that are not supposed to be live in the
computation branch being traced.
Since putting variable values in positions that can be described
by stack layouts (which includes only registers and stack slots,
not fields etc) may require generating code, make sure that this
code is generated when code_info has the appropriate contents
(i.e. just before the generating the code the entrance to which
the event refers to).
compiler/pragma_c_gen.m:
Add two new event types to signify entry to the C code fragments
executed on first call and on later reentries.
compiler/handle_options.m:
Handle some more implications of tracing, and document them better.
One of these changes (follow_vars) ought to allow munta to pass
the debugger test cases.
compiler/llds_out.m:
When generating init_{entry,label,local} operations, append a suffix
_sl to the macro name if the label whose info is being registered
has a stack layout record. This will cause the stack layout to be
registered also. For other labels, the macro without the _sl will
register NULL instead.
compiler/live_vars.m:
compiler/liveness.m:
compiler/store_alloc.m:
If tracing is on, try to preserve the input arguments throughout
the execution of the procedure. This is not possible if any part
of an input argument is clobbered, but in the absence of a utility
predicate that can test for this, we ignore the issue for now.
compiler/mercury_compile.m:
Do not invoke continuation_info__process_instructions to add
stack layout information about call return sites unless we are doing
agc. (Tracing does not require this info, and it is big.)
Pass info on which labels have stack layout records to llds_out.m.
Fix some misleading progress messages.
compiler/{lambda,polymorphism,goal_util}.m:
Enforce the invariant that if the signature of a procedure created
for a lambda goal includes a type variable, it also includes the
typeinfo for that type variable.
(This change is from Simon.)
library/{benchmarking,std_util}.m:
Add the _sl suffix to init_* macros in hand-written code where
necessary.
library/require.m:
When error is called from a program that does tracing, make it
print the number of the last event.
runtime/mercury_{conf_param.h,trace.c}:
util/mkinit.c:
Rename MR_USE_DEBUGGER as MR_USE_EXTERNAL_DEBUGGER, since we
have an internal one as well.
runtime/mercury_goto.h:
For each of the init_{entry,label,local} macros, and the macros
they invoke, add a new variant (denoted by a _sl suffix on the
macro name) that will cause the stack layout record associated
with the label to be registered also. For labels initialized
with the variants without the _sl, initialization will register
NULL instead.
runtime/mercury_{memory,misc}.c:
In several locations, just before exiting with a fatal error in
a program that does tracing, print the number of the last event.
runtime/mercury_regorder.h:
Add two new macros, MR_NUM_SPECIAL_REG and MR_MAX_SPECIAL_REG_MR
that mercury_trace.c uses to decide how much fake_reg to save and
restore.
runtime/mercury_stack_layout.h:
Change the definition of MR_Var_Shape_Info to reflect the real type
of one of its fields more closely.
Make the type names conform to the Mercury style guide
With_Studly_Cap_Names.
Fix the name and the definition of MR_DETISM_DET_CODE_MODEL.
runtime/mercury_stack_layout.c:
Use the new forms of the type names.
runtime/mercury_trace.[ch]:
runtime/mercury_wrapper.c:
Add support for turning tracing on and off and for choosing the
external or internal debugger.
Modify the prototype of MR_trace() to reflect the new arg giving
the number of the highest numbered rN register in use at the call.
Support the new trace ports for nondet pragma C code.
runtime/mercury_trace.c:
Implement a new command set more in line with what we intend to
grow towards in the future:
[N] s/S/CR to skip N events
f/F to finish the execution of the current call
c/C to continue to the end
The upper case versions print events as they go, the lower case
ones don't.
Add several new commands:
N g/G to go to event #N
r to skip all following exit and fail ports until we come to
another port type
b module pred
to add a breakpoint (which actually functions like a spy point)
? to list all breakpoints
+ to enable a numbered breakpoint
- to disable a numbered breakpoint
Save/restore only the necessary registers, not all of them.
Do not indent trace events by the depth, since the depth can get
very large (4800 in one case I looked at).
Provide functions for other parts of the runtime and the library
to call to print the number of the last trace event.
There is a reference here back to the library, but this will
go away when the tabling change is committed.
runtime/mercury_trace.[ch]:
Add a new function, MR_trace_report. This function, which is for
invocation in the event of a fatal error, reports what the number
of the last event was (if tracing is enabled). This should allow
the programmer to go more directly to the source of the problem.
runtime/mercury_wrapper.[ch]:
Remove the long obsolete code for initializing r[123] with integers.
scripts/mdb:
A new script for turning on the tracing code in an executable.
scripts/Mmakefile:
bindist/Mmakefile:
bindist/bindist.Makefile.in:
Include mdb in the list of scripts to be installed.
doc/Mmakefile:
Include mdb in the list of scripts with autogenerated man pages.
tests/misc_tests/Mmakefile:
tests/misc_tests/debugger_regs.*:
tests/misc_tests/debugger_test.*:
Move the tests of the debugger to the new tests/debugger directory.
In the process, give debugger_test back its original name,
"interpreter", and give it an input script that tests the new
debugger commands while avoiding the printing of excessively large
terms (although they still overflow 80 columns).
tests/debugger/Mmakefile:
tests/debugger/runtests:
tests/debugger/debugger_regs.*:
tests/debugger/interpreter.*:
The moved test cases and copied Mmakefile/runtests.
tests/debugger/queens.*:
A new test case to test the printing of variables in polymorphic
procedures.
Estimated hours taken: 0.25
.README.in:
Mmakefile:
bindist/Mmakefile:
bindist/bindist.Makefile.in:
tools/bootcheck:
Delete all references to `lp_solve'. It is not needed anymore,
now that we have written our own solver.
Estimated hours taken: 2
Changes needed to include `lp_solve' in the Mercury distribution.
Note that these changes include it in the main distribution; that is temporary.
For copyright reasons, it ought to be moved to the `extras' distribution,
lp_solve/lpkit.h:
Delete definition of `NULL' that conflicted with system header files.
lp_solve/COPYING:
New file, explaining the copying policy.
lp_solve/Mmakefile:
New file, contains rules for building and installing lp_solve.
Mmakefile:
bindist/Mmakefile:
bindist/bindist.Makefile.in:
Add rules for installing lp_solve and for including it in the
source and binary distributions.
.README.in:
Mention lp_solve.
Estimated hours taken: 1
bindist/bindist.Makefile.in:
bindist/Makefile.in:
Include the man pages in the binary distribution.
bindist/bindist.Makefile.in:
Fix a bug where it didn't install the NUPROLOG or SICSTUS stuff
even when configure detected that NUPROLOG / SICSTUS was present.
Fix a bug in the rule for installing NUPROLOG.
bindist/bindist.build_vars.in:
Put the definition of SHARED_LIBS in single quotes rather than
double quotes, so that if it contains a back-quoted command
(e.g. SHARED_LIBS='`gcc -print-libgcc-file-name` -lm -lc')
it is evaluated dynamically rather than at build time.
This avoids potential problems if users upgrade to a new gcc
version after installing Mercury.
Estimated hours taken: 2
Various changes to support a binary distribution for Windows.
bindist/Mmake:
Fix a bug (`lib' should have been `lib.tar').
bindist/Makefile.in:
Fix a bug (it had `lib.tar' in a couple of places where it should
have had `info.tar').
Change the `echo "blah"' statements to `@echo "-- blah"'.
bindist/README.MS-Windows:
Add directions for creating a binary distribution for Windows.
bindist/README.MS-Windows:
Add directions for installing from the binary distribution
for Windows.
Estimated hours taken: 0.5
Fix a couple of bugs in the binary distribution makefiles,
and change them so they should work better on gnu-win32.
bindist/Mmake:
bindist/bindist.Makefile.in:
Avoid using redirection with `tar', since this breaks on
gnu-win32, because stdin and stdout default to text mode, not
binary mode. Also avoid using `zcat' -- use `gzip
--decompress' instead, because `zcat' might only understand
compressed files, not gzipped files. Also make sure
that multiple commands are separated by `&&' rather than `;',
so that we don't ignore failures.
Estimated hours taken: 0.5
bindist/*:
Rename most of the files to start with `bindist.'.
This avoids confusion between files used to build the
binary distribution, and files that get incorporated
into the binary distribution (and which are then used
to install it), and so makes it obvious that one should
not attempt to run `configure' or `make' in this
directory.