Estimated hours taken: 4
Fixed a couple of problems with the bootcheck script.
tools/bootcheck:
Changed the stage 2 and 3 builds to always use the stage 1 version
of `mmake' rather than the installed version (it had been using a
rather bizarre mix of the two, which made bootstrapping changes to
mmake rather difficult). As part of this, made the definitions of
`MMAKE_VPATH' and `MMAKE_DIR' apply to all invocations of mmake for
stages 2 and 3, rather than just some of them.
Estimated hours taken: 1
Mmake.common.in:
Document that `mmake depend' needs to be run
in the compiler directory if the setting
of `INCLUDE_ADITI_OUTPUT' is changed.
compiler/Mmakefile:
Change the action of `mmake depend' so that it always
regenerates the `.m' files for which `.pp' files exist.
Don't update the timestamp on a `.m' file if regenerating
it does not change it.
tools/bootcheck:
Link rather than copy `.pp' files now that reprocessing
them is handled by `mmake depend'.
Estimated hours taken: 0.25
tools/alias_sync:
Add the script from the log message on Thursday July 9, 1998
to automatically sync the alias branch with the main branch.
Estimated hours taken: 1
Work around a problem with infinite loops on taifun.
The version of readline on taifun has a bug which causes
it to go into an infinite loop if input is redirected from
a file. The work-around is to disable readline support.
aclocal.m4:
Add new option `--without-readline' to disable readline support.
tools/test_mercury:
On taifun, pass `--without-readline' to configure.
Estimated hours taken: 0.5
configure.in:
Add a new option `--disable-extern-debug' for disabling the
external debugger support; this is needed because the
autodetection for sockets doesn't work properly on our SGI
machine (munta), and so we need to manually override it.
tools/test_mercury:
For munta, pass --disable-extern-debug to configure.
Estimated hours taken: 0.1
tools/bootcheck:
Copy the .pp files rather than linking them.
This is a more robust way making sure the corresponding
.m files are rebuilt in stages 2 and 3 because it doesn't
require any changes if someone adds some more .pp files.
Estimated hours taken: 0.1
tools/bootcheck:
Make sure rl_out.m and rl_file.m are recreated in
the stage 2 and 3 directories with the value of
INCLUDE_ADITI_OUTPUT from Mmake.stage.params.
Estimated hours taken: 0.1
tools/bootcheck:
Fix a stupid mistake: use the stage2 runtime, library etc
if the stage2 grade and the test grade are the same, not if
they are different.
Estimated hours taken: 1
Make it much more convenient to do a full bootcheck, including all the tests,
in a grade other than the default one.
By passing a grade explicitly to the tests, instead of just grade component
flags, we allow the conditionals in tests/*/Mmakefiles to work in a lot
more cases than previously.
*** IMPORTANT **
If you do not use any grade other than the default one, then this change
does not affect you; if you do, it affects what you can put in Mmake.params
and Mmake.stage.params files. This change requires that there should be
no grade flags (e.g. --use-trail) specified in the file that becomes
stage2/Mmake.params, which is Mmake.stage.params in the top directory
if it exists, and Mmake.params in that directory otherwise.
tools/bootcheck:
Add two new options, --grade (abbreviated -G) and --test-grade,
which each take an argument specifying a grade. The purpose of the
--grade option is to allow you to specify what grade stages 2 and 3
should be compiled in. The purpose of the -test-grade option is
to allow you to say that the tests should be done in the same
grade as stage 1, not stage 2 or 3, although this is not checked.
If you specify neither, then stages 2 and 3 will be built in the
default grade, and the tests will be done in the default grade as well.
The tests will use everything (compiler, library, runtime etc) from
the stage2 directory.
If you specify only --grade, then stages 2 and 3 will be built in the
given grade, and the tests will be done in the given grade as well.
The tests will use everything (compiler, library, runtime etc) from
the stage2 directory.
If you specify both --grade and --testgrade, then stages 2 and 3 will
be built in the grade given to --grade, while the tests will be done
in the grade given to --test-grade. The tests will use only the
compiler from stage2; everything else (library, runtime etc) will be
from stage 1 directory, since it is assumed that the test grade
is the same as the grade of stage 1.
If you specify only --testgrade, then stages 2 and 3 will be built
in the default grade, while the tests will be done in the given grade.
The tests will use only the compiler from stage2; everything else
(library, runtime etc) will be from stage 1 directory, since it is
assumed that the test grade is the same as the grade of stage 1.
The runtime and boehm_gc directories of stage2 will be copied instead
of linked from stage 1 if either of the new options is given, since
there is no reason to give either option unless the stage 1 grade
differs from the stage 2 grade, and such grade differences may require
this copying.
The old --copy-runtime and --copy-boehm-gc options, which were each
intended to accomplish one half of this, are both implied by either
of the two new options being given.
Estimated hours taken: 0.25
tools/test_mercury:
- Fix a bug where it was not deleting the old stable rotds
when it added a new one; this was costing a lot of disk space...
- Copy the rotd binary distributions to the beta ftp site.
Estimated hours taken: 0.1
tools/bootcheck:
Copy the newly created .mercury-compiler.spec.in file to the
stage[23] directories, since without this file the mmakes invoked
by bootcheck fail.
Estimated hours taken: 5
Remove support for NU-Prolog and SICStus Prolog.
The reasons for this are:
(a) We now have a proper working debugger, so we don't need to use
NU-Prolog or SICStus Prolog for debugging.
(b) The Prolog support was only ever a hack, not a proper solution;
Mercury language features like functions or mode reordering
were never supported.
(c) It was a maintenance problem.
compiler/make_hlds.m:
Warn that NU-Prolog `when' declarations are deprecated.
compiler/prog_io.m:
Update a comment to say that NU-Prolog `when' declarations
are now deprecated.
library/*.m:
Delete `when' declarations.
configure.in:
bindist/bindist.configure.in:
Delete the autoconf tests for NU-Prolog and SICStus Prolog.
Delete the stuff for generating the NU-Prolog and SICStus Prolog
scripts.
tools/bootcheck:
Delete the options for testing using SICStus Prolog.
library/Mmakefile:
Delete the rules for building NU-Prolog and SICStus Prolog stuff.
library/library.nu.nl.in:
library/swi_*.m:
library/*.nu.nl:
library/array.nu.nl:
library/assoc_list.nu.nl:
library/char.nu.nl:
library/float.nu.nl:
library/int.nu.nl:
library/io.nu.nl:
library/library.nu.nl.in:
library/map.nu.nl:
library/mercury_builtin.nu.nl:
library/nc_builtin.nl:
library/require.nu.nl:
library/sp_builtin.nl:
library/sp_lib.nl:
library/std_util.nu.nl:
library/store.nu.nl:
library/string.nu.nl:
library/swi_builtin.m:
library/swi_lib.m:
library/term_io.nu.nl:
Delete these files.
scripts/mnc.in:
scripts/mnp.in:
scripts/mnl.in:
scripts/msc.in:
scripts/msl.in:
scripts/msp.in:
Delete these files.
doc/user_guide.texi:
Delete the documentation about the Prolog support.
NEWS:
w3/news/newsdb.inc:
Mention that we've removed the Prolog support.
Estimated hours taken: 0.1
tools/test_mercury:
Fix a bug in my previous change: when invoking rcp, I accidentally
used `/' to separate the host name in the directory, when I should
have been a `:'.
Estimated hours taken: 0.1
tools/test_mercury:
Don't rebuild the `.exp' files using NU-Prolog.
Building one of the (tests/general/string_format_test_2) was failing,
apparently due to the use somewhere of a function rather than a
predicate, and our plan is to phase out the Prolog support,
so not worth fixing this. Instead we now just treat the `.exp'
files in the `general' directory as being hard-coded,
just like those in the `hard-coded' directory.
Estimated hours taken: 0.25
tools/bootcheck:
If the -g / --copy-boehm-gc option was specified, symlink the
subdirectory "boehm_gc/include", rather than the non-existant
"boehm_gc/includes".
Estimated hours taken: 0.25
tools/test_mercury:
Insert $INSTALL_DIR/bin at the front of the path, so that
it tests the same compiler it installed, rather than
testing the one in mercury-latest (this makes a difference
if you override INSTALL_DIR to install somewhere other than
in mercury-latest, e.g. in a mercury-0.8 directory).
Also replace the obsolete 0.5 & 0.6 entries in the path list
with 0.8.
Estimated hours taken: 0.25
tools/test_mercury:
Fix a bug in the code for automatically building binary distributions:
on murlibobo, it was doing "version=`mmake version`" without having
done "sh configure" beforehand.
Estimated hours taken: 0.1
tools/test_mercury:
Fix a typo: it was copying the unstable binary dist into the
"stable" directory instead of the "unstable" directory.
Estimated hours taken: 0.5
tools/test_mercury:
Fix a bug in the code for automatically building binary distributions
(it was accessing `$version', which had not yet been defined.)
Also change it to build "unstable" binary distributions, in the
case where some of the tests failed, as well as "stable" ones.
Mmakefile:
Add a new target `fullarch' which just echos $FULLARCH,
for use by tools/test_mercury.
Estimated hours taken: 0.25
tools/run_all_tests_from_cron:
Delete the code to invoke install_webpage, because that is now
done separately -- the wep page is installed by invoking
`mmake install' in the w3 directory directly from cron,
or so I'm told.
Estimated hours taken: 0.25
tools/bootcheck:
Ensure that `--use-subdirs' defaults to `true' if
there is a `Mercury' subdirectory in the `compiler' directory.
This avoids various annoyances that occur if you're using subdirs
and you forget to pass `--use-subdirs' to bootcheck.
Estimated hours taken: 240
This checkin has several major purposes, set out in the sections below,
all connected with the implementation of the new debugger command set.
DOCUMENT NEW DEBUG COMMAND SET
doc/user_guide.texi:
Add a new section on the debugger. The description of the commands
is complete, but some of the background sections, and the section
about how to build debuggable executables, are not yet done.
Update the documentation of the tracing options.
doc/generate_mdb_doc:
A new shell script that automatically converts some of the new
sections of the user guide into the online documentation of the
debugger.
doc/mdb_categories:
The fixed initial part of the online documentation.
doc/Mmakefile:
Add rules for creating mdb_doc, the file that is the online
documentation of the debugger, and for installing it together
with mdbrc.
Mmake.common.in:
Define INSTALL_DOC_DIR for doc/Mmakefile.
scripts/mdbrc.in:
A debugger command script that reads in the online documentation
and then defines some standard aliases.
configure.in:
Define the variable that scripts/mdb.in and scripts/mdbrc.in use
to find the right files, and get configure to perform the
substitutions.
configure.in:
scripts/mdb:
scripts/mdb.in:
Replace mdb with mdb.in. Mdb is now created during configuration
from mdb.in, filling in the name of the file that contains the default
debugger initialization commands.
util/info_to_mdb.c:
A program that does most of the work involved in automatically
converting user guide sections into online documentation.
(This couldn't easily be written in sh, because sh's read
command has no notion of pushback.)
util/Mmakefile:
Add info_to_mdb to the list of targets.
tools/bootcheck:
Make sure that the tests in tests/debugger are executed with an
initialization setup that is equivalent to what users will see
by default.
REORGANIZE TRACING OPTIONS
compiler/globals.m:
compiler/handle_options.m:
compiler/options.m:
compiler/trace.m:
Reorganize the handling of trace levels around the new options
--trace-internal, --trace-redo, and --trace-return.
compiler/*.m:
Use the new ways of getting at trace levels.
tests/hard_coded/typeclasses/Mmakefile:
s/--trace all/--trace deep/
SUPPORT RETRY
compiler/trace.m:
After every call to MR_trace(), emit code that checks whether it
should jump away, and if yes, performs the jump. This is used to
implement retry. (The debugger cannot execute the jump itself
because it is in the wrong C stack frame.)
compiler/llds.m:
compiler/continuation_info.m:
compiler/stack_layout.m:
Modify the data structures that record information about live
value at program points, to record the identity of each variable.
This is necessary for the implementation of the restart command,
since we do not want to confuse two distinct variables just because
they have the same name. For example, a variable whose name is X
and number is 5 is now recorded in the name array as "5:X".
Clean up the data structure a bit, so that we don't have to store
dummy names for values that are not variables.
compiler/*.m:
Minor changes to conform to the data structure changes.
runtime/mercury_stack_layout.h:
Redefine an existing macro to strip away the initial number: prefix
from the "name" of a variable (keeping its original function on
changed data), and add a new one to access the raw unstripped data.
runtime/mercury_init.h:
runtime/mercury_wrapper.h:
Update the prototype of MR_trace_{fake,real}, and the type of the
global that points to them.
runtime/mercury_layout_util.h:
Add an extra function, MR_get_register_number, for use by retry.
USE FIXED STACK SLOTS FOR TRACE INFO
compiler/code_gen.m:
compiler/code_info.m:
compiler/live_vars.m:
compiler/trace.m:
If execution tracing is enabled, reserve the first few stack slots
to hold the event number of the call event, the call number, the
call depth, the redo layout structure address (if generating redo
events) and the from_full flag at the time of call (if we are doing
shallow tracing). By allocating the first four of these to fixed stack
slots, the debugger knows where to look for them without having
to be told. It finds out the location of the fifth, if needed,
from a new slot in the proc layout structure. (It is not possible
to allocate all five to fixed stack slots without wasting stack space
in some cases.)
compiler/trace.m:
Remove from the call to MR_trace the parameters that are now in fixed
stack slots, since MR_trace can now look them up itself.
compiler/continuation_info.m:
compiler/stack_layout.m:
Add an extra field to the proc_layout_info. If the module is shallow
traced, this field says which stack slot holds the saved value of
MR_from_full. If it is not shallow traced, this field says that
there is no such stack slot.
runtime/mercury_stack_layout.h:
Add macros for accessing the fixed stack slots holding the event
number of the call event, the call number, the call depth, and,
at a redo event, the redo layout structure address.
Support the new field in proc layouts that gives the location of the
from-full flag (if any).
runtime/mercury_trace_base.[ch]:
trace/mercury_trace.[ch]:
Remove the call number and call depth arguments from MR_trace
and its avatars, since this info is now in fixed stack slots
in every procedure that can call MR_trace. This should reduce
the size of the executable significantly, since there are lots
of calls to MR_trace.
runtime/mercury_init.h:
runtime/mercury_wrapper.h:
Update the prototype of MR_trace_{fake,real}, and the type of the
global that points to them.
START NUMBERING FRAMEVARS FROM ONE
compiler/code_info.m:
compiler/live_vars.m:
compiler/llds_out.m:
compiler/trace.m:
Start numbering framevars from 1 internally to the compiler;
the runtime already starts from 1. This simplifies several tasks.
ADD REDO EVENTS
compiler/trace.m:
compiler/code_gen.m:
Before the code that executes "succeed()", emit code to push a
a temp nondet frame whose redoip points to a label in the runtime
that calls MR_trace for a REDO event and then fails, provided
--trace-redo is set.
compiler/llds.m:
Add a new code address constant, do_trace_redo_fail, which stands
for the address in the trace system to which calls MR_trace for
the redo event and then fails.
compiler/trace.m:
compiler/llds_out.m:
Provided we are doing redo tracing, fill in the slot that holds
the layout information for the REDO event.
compiler/*.m:
Minor changes to conform to handle the new code address constant.
browser/debugger_interface.m:
Add redo to trace_port_type.
runtime/mercury_trace_base.[ch]:
Add a C module containing the code that calls MR_trace for REDO
events.
ENSURE THAT INPUT ARGUMENTS ARE ALWAYS VISIBLE
compiler/trace.m:
When generating the set of live variables at internal ports,
the variables that are in the pre-death set of the goal into which
we are entering may not be available. However, the variables in the
pre-death set that are also in the resume vars set will be available,
so now include info about them in the layout structure for the event.
Since with tracing the non-clobbered input args are in all resume vars
sets, this ensures that these input args will be available from all
internal events.
compiler/code_info.m:
Export a previously internal predicate (current_resume_point_vars)
to make this possible.
BUG FIX: WANT RETURN LAYOUTS
compiler/globals.m:
compiler/call_gen.m:
compiler/code_info.m:
compiler/mercury_compile.m:
Add a new pred globals__want_return_layouts, which says whether the
compiler should generate layout structures for call returns. This pred
centralizes the several previous copies of the test. One of those
copies (the one in call_gen) was faulty, leading to a bug: in the
presence of execution tracing but the absence of accurate gc,
information about the variables that are live at the call return
wasn't being gathered properly.
BUG FIX: #include mercury_trace_base.h
compiler/llds_out.m:
#include mercury_trace_base.h, not mercury_trace.h, since now
mercury_trace_base.h defines everything directly accessible from
modules compiled with tracing.
RECAST MERCURY_TRACE_UTIL AS MERCURY_LAYOUT_UTIL
runtime/mercury_trace_util.[ch]:
runtime/mercury_layout_util.[ch]:
Rename this module from trace_util to layout_util, since it is also
used by the native garbage collector. Remove "trace" from the names
of functions.
Get rid of the global variable MR_saved_regs, and instead thread
a pointer to this data structure through the relevant functions
as an extra argument.
Add a lot more documentation in the header file.
runtime/Mmakefile:
Reflect the module rename.
runtime/*.c:
Refer to the new module.
DELETE EASY-TO-MISUSE MACROS
runtime/mercury_stacks.h:
Delete the based_framevar and based_detstackvar macros, since their
continued use can lead to off-by-one errors, and the saved_framevar
and saved_detstackvar macros, since they are no longer used.
runtime/*.c
Update any references to any macros removed from mercury_stacks.h.
MISC RUNTIME CHANGES
runtime/mercury_trace_base.[ch]:
trace/mercury_trace*.[ch]:
Make typedef'd names conform to the naming convention.
Make MR_trace_call_{seqno,depth} consistently Unsigned, rather than
sometimes Word and sometimes Unsigned.
FIX BUG: MAKE THE DEBUGGER PRINT TO STDOUT, NOT THE CURRENT STREAM
library/io.m:
Export to C code the predicates that return the identities and types
of stdin, stdout and stderr, as well as io__print/[34].
library/std_util.m:
Export to C code a predicate that returns the type_info for the
type stdutil:type_info. This type_info is required if C code
wants to invoke make_permanent on any type_info structure,
as the debugger does.
runtime/mercury_init.h:
Add extern declarations for the C functions now exported from io.m.
runtime/mercury_wrapper.[ch]:
Add new global variables to hold the addresses of these C functions.
runtime/mercury_layout_util.c:
Use indirect calls through these global variables to print Mercury
values, instead of lower-level code.
util/mkinit.c:
Assign the addresses of the functions exported from io.m to the
global variables defined in mercury_wrapper.h.
BUG FIX: STACK TRACE FUNCTIONS DEPEND ON THE LABEL TABLE
runtime/mercury_stack_trace.c:
On entry to any of the functions exported from this module,
ensure that the label table is loaded by calling do_init_modules.
Without a filled-in label table, the stack trace will not be able to
find any stack layout info.
BUG FIX: REMOVE BROWSER/*.C
configure.in:
When removing .c files generated by the C compiler, remove those
in the browser directory as well as the compiler, library and
profiler directories.
IMPLEMENT NEW DEBUGGER COMMAND SET
runtime/mercury_stack_trace.[ch]:
Factor out the code that prints the id of a procedure into a function
of its own, so that it can also be used from the debugger, ensuring
appearance commonality.
Add more documentation in the header file.
trace/mercury_trace_internal.c:
Implement the proposed command set. Command names are now words,
and several commands now have options allowing the user to override
the default print level or strictness of the command, or the
invocation conditions or action of a break point. Allows control
over command echoing and the scrolling of sequences of event reports.
Supports aliases, command file sourcing etc. Implements the retry
command, using the info in the fixed stack slots.
trace/mercury_trace.[ch]:
Extend the trace controls to support the new functionalities
required by the new debugger language, which are print levels,
variable-strictness commands, a more flexible finish command,
and the retry command.
Pass the command structure to MR_trace_event_report, since
the user can now forcibly terminate the scrolling of reports.
trace/mercury_trace_alias.[ch]:
New module to manage aliases for the debugger.
trace/mercury_trace_help.[ch]:
New module to interface to browser/help.m.
trace/mercury_trace_spy.[ch]:
New module to manage break points. The test of whether an event
matches a break point is now much more efficient than before.
The new module also allows several breakpoints with different
actions and different invocation conditions (e.g. all ports,
entry port, interface ports or specific (possibly internal) port)
to be defined on the same procedure.
trace/mercury_trace_tables.[ch]:
New module to manage a table of the debuggable modules, in which
each such module is linked to the list of the layouts of all the
procedures defined in that module. This information allows the
debugger to turn the name of a predicate/function (possibly together
with its arity and mode number) into the procedure layout structure
required by the spy point module. Eventually it may also be useful
in supplying lists of identifiers for command line completion.
Modules for which no stack layout information is available will
not be included in the table, since do_init_modules will not
register any labels for them in the label table.
trace/Mmakefile:
Mention the new files.
runtime/mercury_array_macros.h:
A new file holding macros that can be useful in more than one module.
runtime/Mmakefile:
Mention the new file.
runtime/mercury_conf.h.in:
Mention a new configuration macro, MR_CANNOT_USE_STRUCTURE_ASSIGNMENT,
used by runtime/mercury_array_macros.h.
configure.in:
Find out whether we need to define MR_CANNOT_USE_STRUCTURE_ASSIGNMENT.
ADD TRACE DEPTH HISTOGRAMS
runtime/mercury_conf_param.h:
Document MR_TRACE_HISTOGRAM.
runtime/mercury_trace_base.[ch]:
Define the data structures for the histogram, and print the histogram
when a traced program exits if MR_TRACE_HISTOGRAM is set.
trace/mercury_trace.[ch]:
If MR_TRACE_HISTOGRAM is defined, record a count of the number of
events at each depth. This information can help us evaluate space-time
tradeoffs.
FACTOR OUT SHELL CODE HANDLING GRADE IMPLICATIONS
scripts/final_grade_options.sh-subr:
A new file to contain any code that implements implications between
grade flags; currently implements the implication debug -> use trail.
scripts/mgnuc.in:
scripts/ml.in:
Replace the code that is now in final_grade_options.sh-subr with
an inclusion of final_grade_options.sh-subr.
configure.in:
Handle final_grade_options.sh-subr as {init,parse}_grade_options.sh-subr
are handled.
SIMPLIFY THE MAINTAINANCE OF CONSISTENCY BETWEEN DEBUGGER CODE AND DOCUMENTATION
doc/Mmakefile:
Add rules for creating mdb_command_list, a C code fragment
that can included manually in trace/mercury_trace_internal.c
to supply the list of valid commands, and mdb_command_test.inp,
which is a list of invalid invocations of debugger commands,
which tests whether the help message for such invocations
can be located as expected.
doc/generate_mdb_command_list:
doc/generate_mdb_command_test:
Awk scripts to create mdb_command_list and mdb_command_test.inp
respectively from mdb_doc.
tools/bootcheck:
Copy mdb_command_test.inp from doc to tests/debugger.
tests/debugger/Mmakefile:
Add a new test that checks whether we get an internal error, unable
to locate the right help node, for each invalid command invocation in
mdb_command_test.inp.
UPDATE TEST CASES
tests/debugger/Mmakefile:
Reenable queens. Conform to the new set of options.
tests/debugger/*.inp:
tests/debugger/*.exp:
Update the inputs and expected outputs of the debugger test cases
to use the new command set and output formats.
Estimated hours taken: 0.5
Fix some scripts in the tools directory to work with the new
directories and library names.
tools/binary:
tools/binary_step:
tools/linear:
Update these scripts to work properly with the new browser and
trace directories and the renamed libraries.
Mmake.common.in:
scripts/c2init.in:
scripts/ml.in:
Add tools/binary, tools/binary_step and tools/linear to the
list of files that know about library names.
Estimated hours taken: 0.2
Mmake.common.in:
scripts/ml.in:
tools/bootcheck:
Update the comments about the other locations that know the names of
the libraries, now that c2init knows them too.
scripts/c2init.in:
Add a comment about the other locations.
Estimated hours taken: 10
Introduce two new directories, trace and browser, containing libraries
holding the C and Mercury code of the debugger respectively. (Although
the browser directory does not have a browser in it yet, the browser
should soon become its biggest component.) Take the opportunity to
rename the existing libraries, for consistency.
After this change, the linking order becomes:
the object of the auto-generated init file
program object files
trace library (libmer_trace.a)
browser library (libmer_browser.a)
standard library (libmer_std.a)
runtime library (libmer_rt.a)
Boehm collector (libgc.a)
To avoid circularities, libraries cannot contain direct calls to
any routines that are defined in libraries (or object files) that
occur earlier in the above list. Any such calls must be made into
indirect calls via function pointers.
In particular, there was a circularity caused by the library calling
MR_trace() which invokes the tracer which in turn invokes the
library. This circularity was broken by having MR_trace(),
which is defined in the runtime, call the tracer indirectly via
a global variable named MR_trace_func_ptr. This global variable
is initialized by the auto-generated *_init.c file.
To avoid linking in the tracer even when it is not being used,
this global variable is only set to point to MR_trace_real()
if you're using a debugging grade or if c2init was invoked
with the `-t' flag. Otherwise it is set to MR_trace_fake()
which just prints an error message telling the user to
rebuild the executable with debugging enabled.
Makefile.DLLs:
Reserve random locations for the two new libraries. Whether they work
will be decided by testing on Windows.
Mmake.common.in:
Add variables naming the new directories, and create variables
naming the libraries.
Mmakefile:
Add targets for the new directories, and modify existing rules
as appropriate.
browser/Mmakefile:
Mmakefile for the new directory, modelled on library/Mmakefile.
browser/browser_library.m:
Umbrella file for the new directory, modelled on library/library.m.
{browser,library}/debugger_interface.m:
Moved this file from library to browser without change.
browser/help.m:
A new module for the help system of the debugger. Not yet used.
compiler/Mmakefile:
Update to refer to the new directories and libraries where
appropriate.
compiler/mercury_compile.m:
If we are doing tracing, then pass -t instead of -i to c2init.
compiler/modules.m:
When generating the .dep file, get the grade flags passed to c2init.
doc/Mmakefile:
Remove the special treatment of library/debugger_interface.m.
library/Mmakefile:
Update to refer to the new directories and libraries where
appropriate, and to conform to the new name of the library.
library/library.m:
Do not import debugger_interface.
profiler/Mmakefile:
Update to refer to the new directories and libraries where
appropriate.
runtime/Mmakefile:
Update to refer to the new directories and libraries where
appropriate, and to conform to the new name of the library.
Remove references to files being moved to the trace directory.
runtime/mercury_init.h:
Refer to the automatically generated dll header file by its new name
(renamed because the runtime library is renamed).
Add declarations to support the new global variable MR_trace_func_ptr.
runtime/mercury_memory_handlers.c:
runtime/mercury_memory_zones.c:
runtime/mercury_misc.c:
Remove inappropriate #includes of "mercury_trace.h", and substitute
a #include of "mercury_trace_base.h" if necessary.
{runtime,trace}/mercury_trace.[ch]:
{runtime,trace}/mercury_trace_external.[ch]:
{runtime,trace}/mercury_trace_internal.[ch]:
Move these files from the runtime to the trace directory.
The only changes are the removal from mercury_trace.h of declarations
added to runtime/mercury_trace_base.h, and the change from MR_trace
to MR_trace_real.
runtime/mercury_trace_base.[ch]:
Define MR_trace(), which does an indirect call through
MR_trace_func_ptr if the event should be traced.
Define MR_trace_fake, which just prints an error message.
Its address will be assigned to MR_trace_func_ptr if tracing
is not enabled.
Define the types needed by the signature of MR_trace.
Fix an old bug: s/MERCURY_TRACE_PERMANENT_H/MERCURY_TRACE_BASE_H/.
runtime/mercury_wrapper.[ch]:
Add the new global variable MR_trace_func_ptr.
scripts/c2init.in:
Add a new option, -t/--trace, which enables tracing by causing the
address of MR_trace_real to be assigned to MR_trace_func_ptr.
Have this option be implied by the grade. Also have the old option
-i (need initialization code) be implied by the grade, as well as by
-t.
scripts/ml.in:
Include the new libraries in the link command.
tests/debugger/Mmakefile:
Include -t instead of -i in the list of c2init options. (-t implies
-i.)
tools/bootcheck:
Copy and build the new directories as appropriate. The trace directory
is treated like the runtime, the browser directory is treated like the
library.
trace/Mmakefile:
Mmakefile for the new directory, modelled on runtime/Mmakefile.
util/mkinit.c:
Add the new option -t, as discussed above.
Mmakefile for the new directory, modelled on runtime/Mmakefile.
util/Mmakefile:
Specify -O0, since with the default optimization level, gcc on
cyclone ignores the assignment of TRUE to need_tracing when -t is
given (!!!).
Estimated hours taken: 0.1
tools/bootcheck:
fix up the options that I added in the last change. They now are:
-g, --copy-boehm-gc
so a bootcheck with a non-mt-safe stage 1 and an mt-safe stage 2/3
should be invoked:
bootcheck -r -g ...
Estimated hours taken: 0.25
Enhance bootcheck to copy the boehm_gc directory as well as the runtime.
This was necessary because if the grade for stages 2 and 3 contains *.par.*
but the stage 1 grade doesn't then the collector must be recompiled.
tools/bootcheck:
Add an option --copy-boehm-gc to copy the boehm_gc directory
rather than link it.
Add an option -R which implies --copy-runtime and --copy-boehm-gc.
Estimated hours taken: 1.5
Change the release tar.gz file generation scheme.
We now generate:
mercury-compiler-rotd-YYYY-MM-DD-unstable.tar.gz
mercury-extras-rotd-YYYY-MM-DD-unstable.tar.gz
mercury-tests-rotd-YYYY-MM-DD-unstable.tar.gz
each night if we bootstrap, even if we don't pass the tests.
If we pass the tests, we generate:
mercury-compiler-rotd-YYYY-MM-DD.tar.gz
mercury-extras-rotd-YYYY-MM-DD.tar.gz
mercury-tests-rotd-YYYY-MM-DD.tar.gz
And for numbered releases we create:
mercury-compiler-0.8.tar.gz
mercury-extras-0.8.tar.gz
mercury-tests-0.8.tar.gz
Mmakefile:
Change the tar target to create the newly named files.
tools/test_mercury:
Change the behaviour of copying files to the beta-releases
directory.
Estimated hours taken: 0.2
tools/bootcheck:
Delete stage2/library/*.o earlier, as soon as we have created the
archive.
Delete stage2/compiler/*.o later, only after stage3/library has been
successfully built.
Set up a better environment for the tests if stages 1 & 2 may have
different grades.