library/io.call_system.m:
Move the code in the "system access predicates" section of io.m
to this new module.
library/io.environment.m:
Move the predicates dealing with environment variables in io.m
to this new module.
library/io.m:
Delete the code moved to the new modules.
Leave behind in io.m "forwarding predicates", predicates that do nothing
except call the moved predicates in the new modules, to provide backward
compatibility. But do mark the forwarding predicates as obsolete,
to tell people to update their (at their leisure, since the obsoleteness
warning can be turned off).
Also leave behind in io.m the definitions of the types used
by some parameters of some of the moved predicates.
library/MODULES_DOC:
List the new modules among the documented modules.
library/library.m:
List the new modules, including io.file.m (added in a previous change)
among the documented standard library modules.
NEWS:
Announce the changes.
browser/browse.m:
browser/interactive_query.m:
compiler/fact_table.m:
compiler/handle_options.m:
compiler/make.module_target.m:
compiler/mercury_compile_main.m:
compiler/module_cmds.m:
compiler/optimize.m:
compiler/options_file.m:
deep_profiler/conf.m:
deep_profiler/mdprof_cgi.m:
deep_profiler/mdprof_test.m:
library/io.file.m:
mdbcomp/trace_counts.m:
ssdb/ssdb.m:
tests/general/environment.m:
tests/hard_coded/closeable_channel_test.m:
tests/hard_coded/setenv.m:
tests/hard_coded/system_sort.m:
Call the moved predicates directly in their new modules,
not indirectly through io.m.
library/io.file.m:
library/io.m:
Move two sections of io.m, the "file handling predicates" section
and the "handling temporary files" section to the new submodule io.file.m.
Leave behind in io.m "forwarding predicates", predicates that do nothing
except call the moved predicates in io.file.m, to provide backward
compatibility. But do mark the forwarding predicates as obsolete,
to tell people to update their (at their leisure, since the obsoleteness
warning can be turned off).
Also leave behind in io.m the definitions of the two types used
by some parameters of some of the moved predicates. Document the reason
why this is done.
library/MODULES_DOC:
List the new module among the documented modules.
NEWS:
Announce the changes.
browser/browse.m:
browser/interactive_query.m:
browser/listing.m:
compiler/analysis.file.m:
compiler/compile_target_code.m:
compiler/export.m:
compiler/fact_table.m:
compiler/file_util.m:
compiler/handle_options.m:
compiler/make.build.m:
compiler/make.module_dep_file.m:
compiler/make.module_target.m:
compiler/make.program_target.m:
compiler/make.util.m:
compiler/mercury_compile_main.m:
compiler/module_cmds.m:
compiler/parse_module.m:
compiler/passes_aux.m:
compiler/prog_event.m:
compiler/recompilation.check.m:
compiler/write_deps_file.m:
compiler/write_module_interface_files.m:
deep_profiler/conf.m:
deep_profiler/mdprof_cgi.m:
library/dir.m:
mdbcomp/program_representation.m:
ssdb/ssdb.m:
Call the file operation predicates directly in io.file.m, not indirectly
through io.m.
In two modules, add a #include of fcntl.h in C code. These modules contain
C code that needs this #include, but until now, they got it via a copy
in an automatically generated C header file of a foreign_decl pragma
in io.m that contained that #include. This diff moves that foreign_decl
to io.file.m, removing that crutch.
tests/debugger/browser_test.m:
tests/hard_coded/bit_buffer_test.m:
tests/hard_coded/bitmap_test.m:
tests/hard_coded/construct_bug.m:
tests/hard_coded/dir_fold.m:
tests/hard_coded/dir_test.m:
tests/hard_coded/read_binary_int16.m:
tests/hard_coded/read_binary_int32.m:
tests/hard_coded/read_binary_int64.m:
tests/hard_coded/read_binary_uint16.m:
tests/hard_coded/read_binary_uint32.m:
tests/hard_coded/read_binary_uint64.m:
tests/hard_coded/read_bitmap_size.m:
tests/hard_coded/remove_file.m:
tests/hard_coded/write_binary.m:
tests/hard_coded/write_binary_int8.m:
tests/hard_coded/write_binary_multibyte_int.m:
tests/hard_coded/write_binary_uint8.m:
Call the file operation predicates directly in io.file.m, not indirectly
through io.m.
browser/browse.m:
browser/browser_info.m:
browser/collect_lib.m:
browser/declarative_debugger.m:
browser/declarative_oracle.m:
browser/declarative_user.m:
browser/diff.m:
browser/help.m:
browser/interactive_query.m:
browser/parse.m:
browser/util.m:
Replace implicit streams with explicit streams.
Shorten lines longer than 79 chars.
In some places, simplify some code, often using constructs such as
string.format that either did not exist or were too expensive to use
when the original code was written.
In some places, change predicate names that were not meaningful
without module qualification by *including* the module qualification
in the name (e.g. init -> browser_info_init).
In some places, add XXXs.
In browser_info.m, make the output stream *part* of the debugger type,
because without this, having the debugger type belong to the stream
typeclass does NOT make sense. (The typeclass instance for debugger
used to always write to the current output stream, which this diff
is replacing with the use of explicitly specified streams.)
In browse.m, consistently put stream arguments before other arguments.
In browse.m, when exporting Mercury predicates to C, export them
under names with the standard ML_BROWSE_ prefix, NOT under the name
of a *different* predicate with that prefix.
In diff.m, eliminate an unnecessary difference between what we print
when the difference between two terms is at the root, vs what we print
when the difference between two terms is lower down.
In interactive_query.m, when trying to write a program out to a file,
do NOT write the program to the current output stream if we cannot open
the file, since that would accomplish nothing useful.
Also in interactive_query.m, cleanup .dylib instead of .so on MacOS.
In util.m, delete some unused predicates.
In collect_lib.m, document why some code is not worth updating.
In declarative_oracle.m, rename predicates with previously-ambiguous
names.
browser/MDBFLAGS.in:
Specify --warn-implicit-stream-calls for all Mercury modules
in the browser directory from now.
trace/mercury_trace_browse.c:
trace/mercury_trace_cmd_browsing.c:
ssdb/ssdb.m:
Conform to the changes in browser/*.m.
tests/debugger/queens.{exp,exp2}:
Expect the extra output from browser/diff.m.
library/LIB_FLAGS.in:
mfilterjavac/MFILTERJAVAC_FLAGS.in:
profiler/PROF_FLAGS.in:
slice/SLICE_FLAGS.in:
ssdb/SSDB_FLAGS.in:
Specify --warn-inconsistent-pred-order-clauses as a default flag
in these directories as well.
library/string.m:
Reorder code to make this module compile cleanly with
--warn-inconsistent-pred-order-clauses.
Don't export base_string_to_int_underscore to lexer.m, since
lexer.m does not use it anymore, and neither does anything else.
(The export was not publicly documented.)
library/benchmarking.m:
library/bitmap.m:
library/builtin.m:
library/map.m:
library/profiling_builtin.m:
library/rbtree.m:
library/table_builtin.m:
library/uint.m:
profiler/globals.m:
profiler/options.m:
profiler/prof_info.m:
slice/mdice.m:
slice/mslice.m:
slice/mtc_diff.m:
slice/mtc_union.m:
ssdb/ssdb.m:
Reorder code to make these modules compile cleanly with
--warn-inconsistent-pred-order-clauses.
library/Mercury.options:
Specify --no-warn-inconsistent-pred-order-clauses for the modules
that would still get warnings without this option.
browser/collect_lib.m:
browser/declarative_execution.m:
browser/dl.m:
browser/io_action.m:
compiler/make.util.m:
compiler/pickle.m:
compiler/process_util.m:
compiler/prog_event.m:
library/array.m:
library/benchmarking.m:
library/bit_buffer.m:
library/builtin.m:
library/char.m:
library/deconstruct.m:
library/dir.m:
library/erlang_rtti_implementation.m:
library/int.m:
library/int16.m:
library/int32.m:
library/int64.m:
library/int8.m:
library/io.m:
library/math.m:
library/mutvar.m:
library/private_builtin.m:
library/profiling_builtin.m:
library/rtti_implementation.m:
library/store.m:
library/string.format.m:
library/string.m:
library/table_builtin.m:
library/term_size_prof_builtin.m:
library/thread.m:
library/time.m:
library/type_desc.m:
library/uint16.m:
library/uint32.m:
library/uint64.m:
library/uint8.m:
ssdb/ssdb.m:
As above. This mostly involved two things.
The first was grouping foreign_procs by predicate instead of by language.
In a few cases, this revealed that some predicates *had* no foreign_proc
for a language, while related predicates did have one that just aborted
if called. This diff adds similar aborting foreign_procs to predicate/
language combinations that were missing them, when this seemed obviously
the right thing to do.
The second was moving pragmas about a predicate from the middle of the
block of clauses of that predicate to the start of that block.
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.
browser/*.m:
compiler/*.m:
deep_profiler/*.m:
library/*.m:
mdbcomp/*.m:
ssdb/*.m:
Specify the type constructor for every inst definition that lists
the functors that values of that type may be bound to.
In library/maybe.m, delete the inst maybe_errors/1, because
(a) its name is misleading, since it is for the maybe_error/1 type (no s),
and (b) there is already an inst with the non-misleading name maybe_error
which had an identical definition.
In compiler/dep_par_conj.m, delete two insts that were duplicates
of insts defined in hlds_goal.m, and replace references to them
accordingly.
Estimated hours taken: 8
Branches: main
Add option --ssdb-trace which allows one to control which modules are traced in
the ssdebug grade and to what level.
Add option --link-ssdb-libs which allows one to link the ssdebug libraries into
an executable not compiled in a .ssdebug grade.
README.ssdebug:
Document the new options.
compiler/compile_target_code.m:
compiler/module_cmds.m:
Use link_ssdb_libs rather than source_to_source_debug.
compiler/globals.m:
Add ssdb_trace_level.
Set the correct ssdb_trace_level according to the value
of source_to_source_debug.
compiler/handle_options.m:
Determine the value of --ssdb-trace according to the values
of --ssdb and --force-disable-ssdb.
Set --link-ssdb-libs to true is --ssdb is set.
compiler/mercury_compile_middle_passes.m:
Always apply the ssdb transformation pass.
compiler/module_imports.m:
If the SSDB trace level implies the transformation
has been done, then import the ssdb module.
compiler/options.m:
Add ssdb_trace_level and link_ssdb_libs options.
compiler/ssdebug.m:
Use ssdb_trace_level to determine which transformations are applied
to which procedures.
Change the transformation so that it's now aware of which level
tracing is in effect.
ssdb/ssdb.m:
Record which level of tracing is applicable at each level of the stack.
Use that information to decide whether or not to stop at an event.
Avoid aborts when attempting to install the sigint handler in the C# grade.
Allow the read_and_execute_cmd code to handle 10 io errors in a row before
finally quiting, this avoids problems in the C# grade where some keypresses
lead to transient io errors.
Branches: main
Mark procedures whose names use the suffix "_det" to indicate that the procedure
is a det version of a semidet procedure of the same name (modulo the suffix) as
obsolete. The versions that use "det_" as a prefix should be used instead.
(The latter naming scheme is the one in general use throughout the standard
library.)
library/dir.m:
library/list.m:
library/stack.m:
As above.
Add versions with the "det_" suffix where they were not already
present.
Group function definitions together with the corresponding
predicate definition.
library/cord.m:
library/erlang_rtti_implementation.m:
library/io.m:
library/string.m:
compiler/*.m:
browser/declarative_execution.m:
browser/declarative_tree.m:
ssdb/ssdb.m:
Conform to the above changes.
library/Mercury.options:
Delete a setting for a deleted module.
NEWS:
Announce this change.
Branches: main
Improve consistency amongst the standard library modules.
library/array2d.m:
library/bitmap.m:
library/hash_table.m:
library/store.m:
library/thread.semaphore.m:
library/version_array.m:
library/version_array2d.m:
library/version_bitmap.m:
library/version_hash_table.m:
library/version_store.m:
Use the name "init" for predicates and functions that create new empty
data structures instead of the name "new". (The majority of standard
library modules already use the former.)
Mark the "new" versions as obsolete.
library/bit_buffer.read.m:
library/bit_buffer.write.m:
library/io.m:
library/thread.mvar.m:
browser/declarative_execution.m:
compiler/make.m:
compiler/make.program_target.m:
ssdb/ssdb.m:
Conform to the above changes.
NEWS:
Announce the above changes.
Branches: main
Change the argument order of many of the predicates in the map, bimap, and
multi_map modules so they are more conducive to the use of state variable
notation, i.e. make the order the same as in the sv* modules.
Prepare for the deprecation of the sv{bimap,map,multi_map} modules by
removing their use throughout the system.
library/bimap.m:
library/map.m:
library/multi_map.m:
As above.
NEWS:
Announce the change.
Separate out the "highlights" from the "detailed listing" for
the post-11.01 NEWS.
Reorganise the announcement of the Unicode support.
benchmarks/*/*.m:
browser/*.m:
compiler/*.m:
deep_profiler/*.m:
extras/*/*.m:
mdbcomp/*.m:
profiler/*.m:
tests/*/*.m:
ssdb/*.m:
samples/*/*.m
slice/*.m:
Conform to the above change.
Remove any dependencies on the sv{bimap,map,multi_map} modules.
Branches: main
compiler/mlds_to_cs.m:
Output #pragmas to disable warnings for C# we generate.
Restore warnings for handwritten code.
library/Mmakefile:
Delete an unnecessary line.
library/array.m:
library/dir.m:
library/io.m:
library/thread.m:
library/version_array.m:
ssdb/ssdb.m:
Make some of the remaining warnings from the C# compiler go away.
Branches: main
Make it possible to install and use the csharp.ssdebug grade.
Mmake.workspace:
Never try to link with `mer_rt' in C# grades.
browser/Mmakefile:
mdbcomp/Mmakefile:
ssdb/Mmakefile:
Use `mmc --make' to install these libraries in `csharp' grades.
Don't add C libraries to MLLIBS in non-C or asm grades.
browser/Mercury.options:
ssdb/Mercury.options:
"EXTRA_LIBRARIES-libname" doesn't actually work with `mmc --make',
but "LIBRARIES-name" does.
library/exception.m:
ssdb/ssdb.m:
Handle EXCP events in C# grades.
Trap SIGINT when running ssdb in C# grades.
Add `exit_process' implementation.
browser/declarative_execution.m:
browser/listing.m:
Add stubs for C#.
README.CSharp:
Document the C# backend.
README.DotNet:
Add a pointer to README.CSharp.
README.Erlang:
README.Java:
Remove a non-sensical paragraph.
.INSTALL.in:
configure.in:
Add `--enable-csharp-grade' option.
Make `configure --enable-ssdebug-grades' add `csharp.ssdebug'
to the list of library grades.
Branches: main, 10.04
Solve some problems with using the java.ssdebug grade, when Mercury code is
being entered as part of a larger Java framework.
ssdb/ssdb.m:
Add an undocumented feature where setting the environment variable
SSDB=0 initialises the debugger on startup, but leaves debugging
initially disabled.
Add an undocumented predicate `enable_debugging' to enable debugging
later in the program.
Wrap `get_debugger_state' in Java grades with a predicate that won't
crash if the `debugger_state' thread-local mutable was not given a
value in the calling thread.
Branches: main, 10.04
Add an (undocumented) method for ssdebug, to allow debugging of only the
initial thread in a multi-threaded program.
ssdb/ssdb.m:
Make the debugger_state mutable thread-local, so that all threads but
the initial one can execute as if debugging is disabled.
Add `pause_debugging' and `resume_debugging' predicates that the user
must call around calls to `thread.spawn'. Mercury only supports
thread-local mutables which inherit their values from the parent
thread, so when the thread is created the debugger_state mutable must
be set to `off'. The predicates may have other uses, too.
README.ssdebug:
List debugging of multi-threaded programs as a limitation.
Branches: main, 10.04
Support configurable command aliases and settings files in ssdebug.
ssdb/ssdb.m:
Add support for aliases (`alias' and `unalias' commands).
Add support for reading commands from files (`source' command).
Automatically `source' the files $HOME/.ssdbrc and .ssdbrc at startup,
if they exist.
Remove the aliases which are not standard mdb aliases.
Implement the default command with the special alias `EMPTY'
(like mdb).
Implement the command consisting only of an integer with the special
alias `NUMBER' (like mdb).
Remove hard-coded aliases from the help text.
Print specific error messages for invalid command arguments instead
of printing the help text.
README.ssdebug:
Document behaviour of sourcing .ssdbrc files.
Say that ssdb commands act like mdb, except for `list'.
Branches: main, 10.04
ssdb/ssdb.m:
Replace io.{stdin,stdout}_stream in places where I meant
io.{input,output}_stream.
Fix quadratic behaviour in compress_stack_frames.
When printing stack traces, ensure that the stack depth number
and the number of duplicate frames have whitespace between them.
Branches: main, 10.04
ssdb/ssdb.m:
Use a Bloom filter to quickly check if a breakpoint has been set on the
procedure of the current event, avoiding relatively slow map lookups in
the common case.
Make the `break' command take a single argument, instead of separate
module name and predicate name arguments.
Delete the breakpoint counter mutable. When adding a new breakpoint,
use the first free breakpoint number.
Support arguments for `up' and `down' commands. Share code with the
`level' command.
Implement invent_io/consume_io without foreign code (but using private
builtins).
Branches: main, 10.04
Add `list' functionality to ssdebug.
browser/listing.m:
Implement a version of `list_path' which doesn't use C foreign code.
Close opened streams in `list_path'. (not ssdebug related)
ssdb/ssdb.m:
Add commands `list', `list_path', `push_list_dir', `pop_list_dir',
`list_context_lines using the listing.m module. Unlike in mdb, `list'
prints the source code at the call site as that is the information we
currently have.
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.
Branches: main, 10.04
Modify the ssdebug transformation so that the context of procedure calls is
available. Before each call, store the caller's file name and line number in
globals by calling a predicate `ssdb.set_context'. Then in the following call
to `ssdb.handle_event_call' we know where the call came from.
compiler/ssdebug.m:
Add the calls to `ssdb.set_context' in the same initial pass that
creates proxies for standard library predicates.
Update the documentation on the transformation.
ssdb/ssdb.m:
Add the `set_context' predicate and globals.
Use the information from the globals to retain the call context in
shadow stack frames.
Print out the context where appropriate.
Branches: main, 10.04
Add a form of exception events in the source-to-source debugger for Java
grades. This could be implemented for other backends later.
Unlike in mdb, where throwing an exception will generate EXCP events for all
calls on the stack up to enclosing exception handler, we only generate a single
EXCP event for the call to `exception.throw_impl'. The next event will be the
EXIT of the procedure which caught the exception, i.e. exception.try*.
library/exception.m:
Add hooks in the Java implementations of throw_impl and catch_impl.
These do nothing until overridden by ssdb.m.
Replace an unused mode of catch_impl by a stub.
ssdb/ssdb.m:
Install the hooks in the exception module.
When exception.throw_impl is called, emulate an exception event.
Remember the CSN at the start of a call to exception.catch_impl.
When an exception is caught, pop off any shadow stack frames between
the throw and the catch.
Add an `exception' command that stops at the next exception event.
Make the `finish' command handle exceptions. When an exception is
thrown, stop immediately unless we know that further up the stack is an
exception handler which will handle the exception before we reach the
final port that we wish to stop at.
Branches: main, 10.04
The source-to-source transformation is disabled on standard library modules
because it would introduce cyclic dependencies between ssdb.m and the standard
library. Disabling the transformation on the standard library is also useful
for maintaining decent performance. However, no events are generated for calls
to standard library procedures.
In this patch, we introduce something like shallow tracing, for standard
library procedures. Before the main ssdebug transformation, we replace calls
and closures involving standard library predicates by local proxy predicates
that simply forward the calls to the original predicates. During the main
ssdebug pass the proxies are transformed as usual, so at runtime they will
generate interface events, but in the guise of the predicates they proxy.
compiler/ssdebug.m:
Add the proxy predicates pass.
Make the main ssdebug transformation handle proxy predicates specially,
so the events look like they come from the original procedure.
Don't perform the ssdebug transformation on procedures with arguments
which are not fully input or fully output. This was previously only
done for semidet procedures.
Remove imports of unused modules.
compiler/hlds_pred.m:
Add pred_info_get_sym_name.
compiler/layout_out.m:
compiler/mercury_compile_middle_passes.m:
Conform to changes.
Branches: main, 10.04
Fix a problem that was breaking the java grade on goliath.
ssdb/ssdb.m:
Avoid using a Java annotation that causes problems with Java 1.5.
This inhibits the Java compilers ability to detect certain types
of error, but is otherwise harmless.
Branches: main, 10.04
Many ssdb changes. In particular, make `retry N' work.
ssdb/ssdb.m:
Fix `retry N'. The main problem was that the event number and CSN
counters were reset when the user enters the command, but for N > 0 we
need to perform forward execution before reaching the event to retry
from. During forward execution the counters are incremented as usual,
so the debugger state is corrupted.
Delete code related to the special state `debugger_off', which was
somehow related to retrying from nondet exit ports. It didn't make
sense and didn't work. Rename `debugger_disabled' to `debugger_off'.
Change the shadow stack representation from `stack(T)' to `list(T)' as
the stack operations are too limited.
Consistently use the mutables that record the shadow stack depths.
The old code made no sense and created performance problems by calling
`stack.depth', which is O(n).
Don't pass around the shadow stack explicitly, so as not to cause
confusion with the stacks in the mutables. (The original reason for
the change was to use array representations of stacks in foreign code
which could be destructively updated, but the list representation
turned out to be at least as fast.)
Factor out common code for handle_event_call{,_nondet} and
handle_event_fail{,_nondet}.
Delay changing input/output streams until we are about to enter the
debugger prompt.
Don't update the top stack frame's list of variable bindings at exit
events unless we are about the enter the debugger prompt.
Add an optimisation to avoid looking up a breakpoint when no
breakpoints are set.
Print breakpoints in order of their id numbers.
Other cleanups.
Branches: main, 10.04
ssdb/ssdb.m:
Fix `browse' command to show variables from the current stack frame,
not just the top-most.
Make `browse N' command count variables correctly when some variables
in the variable description list are unbound.
Branches: main, 10.04
browser/util.m:
Implement fallback versions of `call_trace_getline' and
`trace_get_command' for non-C grades.
ssdb/ssdb.m:
Support `browse N' command, where N is a variable number.
Branches: main, 10.04
ssdb/ssdb.m:
On startup, check for the SSDB_TTY environment variable. If set, all
debugger I/O is performed through the device named by the environment
variable. This is equivalent to the `mdb --tty <file-name>' option.
Trap SIGINT and stop at the next possible point (C and Java grades).
Add `print VAR' and `print N' commands.
Add `vars' command.
library/rtti_implementation.m:
Make `deconstruct' not escape special characters in the returned
functor name argument for characters and strings, to match the
behaviour on C backends.
Branches: main, 10.04
compiler/ssdebug.m:
Don't add `io.state' variables to description lists in the ssdb
transformation.
ssdb/ssdb.m:
Make the ssdb output mimic the mdb output more closely.
Add `q' and `quit' as a preferred synonym for the `exit' command.
Prompt the user to confirm the quit command.
Don't crash if printing a variable with a null value.
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: 3
Branches: main
ssdb/ssdb.m:
Major cleanup.
Replace the single large predicate that used to handle all commands
with one predicate per ssdb command, plus a table mapping command names
to the id of the commands. This should make it easy to add of a command
alias system.
By grouping all forms of a command together (some used to be
discontinous), this design provides obvious places for the inclusion
of better (more situation-specific) help messages, and points out
places where debugger commands should be able to handle more arguments.
The code used to make pervasive use of semipure/impure code to get
and set mutables. This was unnecessary, since the mutables were
already attached to the I/O state and the I/O state was in fact
available in most places and could trivially made available in the
other places.
Give some predicates names that better reflect their purpose.
Add an XXX asking for the fix of some cut-and-paste programming.
Estimated hours taken: 8
Branches: main
Some minor modifications of the code.
compiler/ssdebug.m:
Some minor corrections in the comments.
ssdb/ssdb.m:
Modification of some commands : print, up, down to print details on
what is going on at the screen more clearly.
A bug with the command <retry N> had been corrected. It did not get the
rigth datas sometimes.
I use pprint instead of pretty_printer to print the argument list of a
predicate because there was a strange behavior with pretty_printer:
The terms would always appear after io.write_string output in the ssdb
'p' command. Somehting like:
Var1 =
Var2 =
Var3 =
<term of Var1>
<term of Var2>
<term of Var3>
whereas it should be:
Var1 = <term of Var1>
etc.
Estimated hours taken: 120
Branches: main
There are some modification for the nondet transformation. When a retry of a
nondet procedure A is asked during the execution of the program, a choicepoint
is left behind and the execution start the retry on procedure B. When the retry
on B is finished, the compiler come back at the choicepoint and finish the call
of the procedure A. This give a wrong number of event.
The proposed solution is: when a retry is asked in a nondet procedure named A
at an exit port, the debugger do not execute any operation until it reach the
fail of the procedure A. It is only at this moment that the execution of B
begin.
If user use a predicate like solutions.unsorted_solutions, he will obtain more
than one time the same solution. The use of solutions is right because it
remove the duplicates
Determinism failure tranformed:
% detism_failure:
%
% p(...) :-
% promise_<original_purity> (
% (
% CallVarDescs = [ ... ],
% impure call_port(ProcId, CallVarDescs),
% <original body>
% ;
% % preserve_backtrack_into
% impure fail_port(ProcId, CallVarDescs, DoRetry),
% (
% DoRetry = do_retry,
% p(...)
% ;
% DoRetry = do_not_retry,
% fail
% )
% )
% ).
Determinism erroneous transformed:
% p(...) :-
% promise_<original_purity> (
% (
% CallVarDescs = [ ... ],
% impure call_port(ProcId, CallVarDescs),
% <original body>,
% )
% ).
analysis/Mmakefile:
Delete the LINK_STDLIB_ONLY=yes line as we need to link with the
libmer_ssdb if source-to-source debugging is enabled.
browser/util.m:
At the browser prompt, use io.read_line_as_string instead of
functions in the trace library to read input if the trace library is
not linked in.
compiler/mercury_compile.m:
Move the ssdb transformation to after the higher order specialisation
pass to work around a compiler abort. The higher order specialisation
removes predicates which are used to "force the production of
user-requested type specializations, since they are not called from
anywhere and are no longer needed". Let `p' be such a procedure, and
the specialised version be `p1'. Then remove `p'. But due to the ssdb
transformation, `p1' will contain a call to `p', in order to support
retry.
I'm not sure where the ssdb transform should go. I assume as early as
possible.
compiler/ssdebug.m:
- Transform procedures with `failure' and `erroneous' determinisms.
- Funny modes are not managed
I think we can and should handle `unused' arguments as well, but
later.
profiler/Mmakefile:
Link with the mer_ssdb library.
ssdb/Mercury.options:
Link with the mer_browser library to support browsing of terms.
ssdb/ssdb.m:
- 4 new event for the nondet procedure are now use. They are :
ssdb_call_nondet, ssdb_exit_nondet, ssdb_fail_nondet,
and ssdb_redo_nondet. In the same way, an different event handler
has been created to managed each of them.
The ssdb_redo event was no more useful.
- The old structure debugger_state has been divided in different
mutable variables to allow more flexibility.
- The old breakpoint list are now a map with (module_name, pred_name)
as key and the breakpoint structure as value.
- The depth is now compute with the stack depth, it is easier to manage
and more flexible.
- Some new command have been added: delete/enable/disable breakpoint,
break info, finish N, retry N, browse X
deep_profiler/DEEP_FLAGS.in:
deep_profiler/.mgnuc_copts:
deep_profiler/Mmakefile:
tests/.mgnuc_copts.ws:
tests/WS_FLAGS.ws:
Search in the ssdb directory for files.
analysis/Mmakefile:
browser/util.m:
compiler/mercury_compile.m:
compiler/ssdebug.m:
library/private_builtin.m:
profiler/Mmakefile:
ssdb/Mercury.options:
ssdb/ssdb.m:
tests/.mgnuc_copts.ws:
tests/WS_FLAGS.ws:
Back out Olivier's last change; it broke the compiler.
Estimated hours taken: 1
Branches: main
Final release of version 1 of the ssdb.
analysis/Mmakefile:
browser/util.m:
compiler/mercury_compile.m:
compiler/ssdebug.m:
library/private_builtin.m:
profiler/Mmakefile:
ssdb/Mercury.options:
ssdb/SSDB_FLAGS.in:
ssdb/ssdb.m:
tests/.mgnuc_copts.ws:
tests/WS_FLAGS.ws:
Estimated hours taken: 50
Branches: main
Fix some bug of the first review.
boehm_gc/libatomic_ops-1.2/configure:
compiler/ssdebug.m:
ssdb/ssdb.m:
tools/lmc.in:
Estimated hours taken: 4
Branches: main
The breakpoint command has been added in the debugger
compiler/ssdebug.m:
Adding feature to send the module name in the ssdb_proc_id structure
ssdb/ssdb.m:
Print out the event number, name of the module, name of the predicate,
call sequence number and call depth at each event.
Some minor changement to make the code more understandable
Add code to manage breakpoint.
Estimated hours taken: 5
Branches: main
Prompt added. Some commands are available.
s or "nothing" ---> step
n ---> next
f ---> finish
h ---> help
ssdb/ssdb.m:
- Rename field names of the debugger_state type to be less ambiguous.
- Add the stack in the debugger_state to records the different call
- Add types what_next and next_stop to configure the stop phase of
the prompt
In handle_event
- Use of the variable NextStop to determine when to do a stop
- Call the prompt and recieve the next action to perform
In prompt
- Commands to go thru next step and next exit point added