The 'browse --xml' command has not worked with current versions of
xsltproc for quite some time, but we have not received any bug reports,
nor has anyone tried to fix it. We have a method for interactively
exploring a term in 'browse --web' so IMHO there is no need to keep
support for 'browse --xml'.
browser/browse.m:
browser/browser_info.m:
browser/declarative_user.m:
trace/mercury_trace_browse.c:
trace/mercury_trace_browse.h:
trace/mercury_trace_cmd_browsing.c:
trace/mercury_trace_cmd_parameter.c:
trace/mercury_trace_cmd_parameter.h:
trace/mercury_trace_internal.c:
Delete code.
doc/mdb_categories:
doc/user_guide.texi:
Delete documentation.
configure.ac:
Don't search for a XUL browser and xsltproc.
scripts/mdbrc.in:
Delete 'xml_browser_cmd' and 'xml_tmp_filename' lines.
scripts/xul_tree.xsl:
Delete now unused file.
scripts/Mmakefile:
Conform to deletions.
tests/debugger/Mmakefile:
tests/debugger/browser_test.exp:
tests/debugger/browser_test.exp3:
tests/debugger/browser_test.inp:
tests/debugger/mdb_command_test.inp:
tests/debugger/save.exp2:
tests/declarative_debugger/browse_arg.exp:
tests/declarative_debugger/browse_arg.inp:
Don't test 'browse --xml' any longer.
extras/xml_stylesheets/README:
Delete reference to 'browse --xml' command.
NEWS:
Announce change.
LICENSE:
Mention files derived from musl library.
runtime/process_getopt:
Process files from ../getopt/*.[ch] to produce
mercury_getopt.h, mercury_getopt.c, mercury_getopt_long.c.
runtime/mercury_getopt.h:
runtime/mercury_getopt.c:
runtime/mercury_getopt_long.c:
Add files generated by process_getopt.
runtime/Mmakefile:
Update list of source files.
util/Mmakefile:
Use musl getopt if the system C library does not have getopt().
tests/debugger/browser_test.exp:
tests/debugger/browser_test.exp2:
tests/debugger/browser_test.exp3:
tests/hard_coded/runtime_opt.exp:
Update expected error messages to match new getopt() output.
changed exp output
Estimated hours taken: 2
Branches: main
Make the mdb command "dump" give you a message confirming what it did.
trace/mercur_trace_cmd_browsing.c:
Make the mdb command "dump" give you a message confirming what it did,
unless the user gives the new -q or --quiet option.
doc/user_guide.texi:
Document the new option.
scripts/mdb_grep:
scripts/mdb_open:
Specify -q to keep old behavior.
tests/debugger/browser_test.{inp,exp,exp3}:
Update this test case to test the dump command both with and
without -q.
Estimated hours taken: 5 (mostly testing)
Branches: main
browser/browse.m:
Try to handle pretty-printing of functor names containing '.'s
correctly (the default pretty-printer formatting escapes names
containing '.'s).
library/list.m:
Improve the pretty-printer formatting of lists by preventing
the output of ellipsis when all items in the list have been
printed.
library/pretty_printer.m:
Special-case printing of "." as an infix operator by not
surrounding it by spaces.
tests/debugger/browse_pretty.exp:
tests/debugger/browser_test.exp:
tests/debugger/declarative/change_search.exp:
Updated to reflect output of new pretty printer.
tests/debugger/browser_test.exp3:
Added a new possible output (for new pretty printer).
Estimated hours taken: 20
Branches: main
Implement breakpoints on user events. Users may specify an event set,
an event name, both, or neither. Four forms of the mdb "break" command
create such breakpoints:
break [the usual options] user_event <event_name>
break [the usual options] user_event <event_set_name> <event_name>
break [the usual options] user_event_set
break [the usual options] user_event_set <event_set_name>
In addition, the command
break [the usual options] user_event
is also accepted, as a synonym for
break [the usual options] user_event_set
Since user events are not interface events or entry events, add a new, simple
ignore specification, which decrements the ignore count on every match of the
event.
Make the "break_print" mdb command consistent with the other command that
operates on existing breakpoints ("condition") by making it apply by default
to the most recently created breakpoint.
Make "condition" and "break_print" use the same option letter (-b) to introduce
the breakpoint number.
Fix a bug in the implementation of "break_print" that led to printing out
the selected variable, but not the selected *path* within the selected
variable. The reason was that we recorded what to print (variable spec plus
path) in a string, but that the process of using that record to print out
what was wanted destroyed the string (by putting a NULL between the variable
specification and the path), so that *later* uses of that string would find
an empty path. The fix is to record a var_spec/path pair in the print list.
Fix some slightly misleading output: when printing part of a variable, we
printed the name of the variable without any indication that the value printed
wasn't the whole value of the variable. We now print the path as well.
doc/user_guide.texi:
Document the changes above.
Document the usage "break_print [options] none", which we have always
supported, but which was not documented.
runtime/mercury_stack_layout.h:
Add a utility macro.
trace/mercury_trace.c:
Fix a bug which left a variable uninitialized.
trace/mercury_trace_cmd_breakpoint.c:
Implement the new command forms and options described above.
trace/mercury_trace_spy.[ch]:
Implement data structures for keeping track of the new forms of
breakpoints, and add the necessary functions for manipulating them.
Update the function that checks whether the current event matches.
Factor some common code out of that function, as well as out of the
functions for adding new breakpoints.
Change the print list data structure as described above.
Add some utility functions.
Add MR_ prefixes to the names of structure fields that previously
lacked them.
trace/mercury_trace_cmd_misc.c:
Handle the new breakpoint types.
trace/mercury_trace_tables.c:
trace/mercury_trace_internal.c:
We used to parse the event set descriptions in module layout structures
when the debugger was initialized (in mercury_trace_internal.c).
However, we delay registering all the modules until this is needed,
so at that time we don't yet *have* the list of module layout
structures, so we used to parse nothing. This diff moves the code
for doing the parsing to the time when the module layout structures
are registered (in mercury_trace_tables.c).
Don't test whether the module layout structure contains the fields
for user event descriptions, since that diff has been installed on
all our systems weeks ago.
trace/mercury_trace_internal.c:
Conform to the new print list structure.
trace/mercury_trace_vars.[ch]:
Print any selected path together with a variable name when printing a
value. (This is the last bug fix mentioned at the top.)
Export a function for use in mercury_trace_internal.c.
Add some utility functions.
Improve some error messages.
trace/mercury_trace_tables.h:
Add a const qualifier.
tests/debugger/user_event.{inp,exp}:
Extend this test case to test the new functionality.
tests/debugger/breakpoints.{inp,exp,exp2}:
Conform to the change to the break_print command.
tests/queens.{inp,exp}:
Change the input to test the bug fix to the break_print command,
and the expected output.
tests/browser_test.exp:
tests/field_names.exp:
Conform to the fact that we now print paths after variables names.
Estimated hours taken: 0.2
Branches: main
tests/debugger/browser_test.inp:
tests/debugger/browser_test.exp:
Add test lines for the list_context_lines command.
Estimated hours taken: 16
Branches: main, release
Replace the "set" command of mdb with a bunch of commands: the `format',
`format_param', `list_context_lines', `list_path', `xml_browser_cmd',
`xml_tmp_filename', `fail_trace_counts', `pass_trace_counts' and
`max_io_actions' commands. Each of these set just one parameter
or one of set of closely related parameters.
Move all these commands, and some existing commands that set parameters
that were elsewhere, to the "parameter" command category.
Extend some of these commands so that if given no arguments, they report
the current values of the parameters they would otherwise set.
Replace the "set" commands of the mdb browser and of the declarative debugger
with a bunch of commands: "format", "depth", "size", "width", "lines",
"actions" and "params" (the last prints the current value of the parameters).
For each category of mdb commands, create files mercury_trace_cmd_<cat>.[ch],
and move the functions dealing with that category of commands there from
mercury_trace_internal.c. Give each of these new files a logical structure
that was sometimes missing from the relevant parts of mercury_trace_internal.c.
NEWS:
Mention these changes.
doc/mdb_categories:
Document these changes.
doc/user_guide.texi:
Document these changes.
Fix an old documentation bug: you couldn't set listing paramaters
from a declarative debugger command.
Fix an old documentation bug: the description of the goal_path step
for scopes was obsolete.
Fix some obsolete references to : as module qualifier.
browser/parse.m:
Update the browser command set along the lines at the top.
browser/declarative_user.m:
Update the declarative debugger command set along the lines at the top.
Move the declaration for the type representing declarative debugger
commands to near the top of the file.
browser/browser_info.m:
Provide some access predicates.
Update the predicate that generates mdb commands to save the persistent
state of the debugger to generate the new forms of parameter commands.
Move types and predicates for dealing with browser parameters from
browse.m to here, so that declarative_user.m can use them too.
browser/browse.m:
Delete the code moved to browser_info.m, and conform to the other
changes in the other modules.
browser/listing.m:
Provide a predicate to return the type of listing paths.
scripts/mdbrc.in:
Update the commands that set the XML parameters.
scripts/Mmakefile:
Get mmake to rebuild mdbrc from mdbrc.in when mdbrc.in changes.
trace/mercury_trace_internal.c:
trace/mercury_trace_cmds.h:
trace/mercury_trace_cmd_*.[ch]:
Implement the changes described at the top.
Fix an old bug: the commands that update the search path for the "list"
command don't make the search path term permanent, which is needed in
non-conservative-gc grades.
trace/mercury_trace_spy.c:
Fix some obsolete references to : as module qualifier.
trace/mercury_trace_browse.[ch]:
Delete the functionality now moved to mercury_trace_cmd_parameter.c.
tests/debugger/mdb_command_test.inp:
Update the set of commands being tested.
tests/debugger/save.{inp,exp}:
Update the parameter commands in this test case.
Estimated hours taken: 3
Branches: main
XXX: the change to the mdb "set" command is not yet documented; that will be
addressed in the next change.
Fix the debugger's save command so that it saves everything it should save
(with one unavoidable exception). Rename the "save_to_file" command to "dump",
as we agreed.
NEWS:
doc/user_guide.texi:
doc/mdb_categories:
Document these facts.
browser/browser_info.m:
Provide a predicate to save the entire persistent state of the browser.
Provide a predicate to set the number of I/O actions printed by the
declarative debugger.
Check that the XML browser command and temp file name being set aren't
empty, since those are not meaningful.
Rename predicates to avoid ambiguities and excessively long names.
Simplify some code.
browser/browse.m:
Generate better error messages if the user tries to use XML browsing
without setting it up.
browser/browse.m:
browser/declarative_user.m:
Conform to the changes in browser_info.m
browser/listing.m:
Use the correct prefix on global C symbols.
trace/mercury_trace_internal.c:
Change the save command to save everything of the persistent debugger
state that can be saved.
Allow the set command to set the number of I/O actions printed by the
declarative debugger. Without this, there would be no way to restore
this part of the debugger persistent state, since a source command
cannot start the declarative debugger.
Rename save_to_file as dump.
Use the correct prefix on global C symbols.
Avoid misleading capitalization.
trace/mercury_trace_spy.c:
Extend the code that saves the state of breakpoints to save conditions
on breakpoints as well.
trace/mercury_trace_browser.[ch]:
Add a utility function for saving the persistent browser state.
Conform to the changes in browser/browser_info.m.
trace/mercury_trace_alias.[ch]
Convert to four-space indentation.
tests/debugger/browser_test.{inp,exp}:
tests/debugger/mdb_command_test.inp:
Use dump instead of save_to_file.
tests/debugger/save.{m,inp,exp}:
New test case to test the new behavior of the save command.
tests/debugger/Mmakefile:
Enable the new test case.
Estimated hours taken: 0.5
Branches: main
Move the test of the xml browser in the declarative debugger from the debugger
directory to the debugger/declarative directory. The declarative debugger does
not work in non gc grades and the debugger tests are run in non gc grades. The
debugger/declarative tests are not, however, run in non gc grades.
tests/debugger/browser_test.exp:
tests/debugger/browser_test.inp:
tests/debugger/declarative/browse_arg.exp:
tests/debugger/declarative/browse_arg.inp:
Move the dd xml browser test from debugger/browser_test to
debugger/declarative/browse_arg.
Estimated hours taken: 6
Branches: main
Allow an XML term browser to be called from the declarative debugger.
browser/browse.m
Add a predicate to save a term to an XML file and then launch an
XML browser.
Add a predicate that saves a term to an XML file and doesn't print
any error messages, but just returns an io.res result. Use this
in save_term_to_file_xml and the predicate mentioned above.
browser/browser_info.m
Add two fields to the browser's persistent state - one to record the
temporary filename to use when saving a term to an XML file and one
to hold the command to launch the XML browser. Previously these were
stored in C global variables which were not accessible from the
declarative debugger.
Export the browser_persistent_state type so the field access functions
can be used from browse.m.
browser/declarative_user.m
Allow the user to give an -x or --xml option to the browse command from
within the declarative debugger.
Reformat the user_command type and add a new functor: browse_xml_arg/1.
Describe the -x or --xml browse option in the help message and reformat
the trust command help message as it was looking a bit untidy.
tests/debugger/browser_test.exp
tests/debugger/browser_test.inp
Test the --xml option from within the declarative debugger.
trace/mercury_trace_browse.c
trace/mercury_trace_browse.h
trace/mercury_trace_internal.c
Move MR_trace_save_and_invoke_xml_browser from mercury_trace_internal.c
to mercury_trace_browse.c so it can call the new Mercury code in
browser/browse.m.
Handle the `set xml_browser_cmd' and `set xml_tmp_filename' commands by
calling Mercury code to set the appropriate fields in the persistent
browser state.
Estimated hours taken: 0.5
Branches: main and 0.12
Print a message when saving a term to XML and launching the XML browser.
Do this because for largish terms the browser may take a while to open the XML
file. We don't want the user thinking something has gone wrong with their
debugging session, just because the XML browser doesn't immediately begin.
tests/debugger/browser_test.exp
Expect feedback when `browse --xml' command used.
trace/mercury_trace_internal.c
Print messages before saving a term to XML and launching the XML
browser.
Estimated hours taken: 5
Branches: main
Allow terms to be saved as XML in mdb and allow an XML browser to be invoked on
browsable objects in mdb. The user can set two options which control where the
XML is dumped and the command used to browse the XML. The defaults assume
xsltproc and mozilla are installed.
configure.in
Check for mozilla/firefox and xsltproc so default the mdb XML browser
command can be set if they are found.
browser/browse.m
Add a predicate to save a browser term as XML to a file.
doc/user_guide.texi
Document new --xml option for the mdb `browse' command.
Document new --xml option for the mdb `save_to_file' command.
Document the `set xml_tmp_filename' and `set xml_browser_cmd' commands.
scripts/Mmakefile
Copy extras/xml_stylesheets/xul_tree.xsl to the mdb install
directory so it can be used by the default XML browser command.
scripts/mdbrc.in
Set default values for xml_browser_cmd and xml_tmp_filename.
scripts/xul_tree.xsl
Copy this stylesheet here so there isn't a dependency on the extras
directory.
tests/debugger/browser_test.inp
tests/debugger/browser_test.exp
Test --xml option for `browse' command.
trace/mercury_trace_browse.c
trace/mercury_trace_browse.h
Add functions to save a term as XML to a file and then
invoke the user's XML browser.
trace/mercury_trace_internal.c
Add --xml option to `browse' and `save_to_file' mdb commands and
handle this option.
Estimated hours taken: 2
Branches: main
Remove call depth numbers from standardized event printing. This will make
maintaining the debugger test cases easier since a lot of the expected outputs
differ only in the call depth of their events, because of deep tracing of the
standard library in the decldebug grade.
Not all the debugger tests are run with standardized event printing, so
printing of call depths will still be exercised.
tests/debugger/breakpoints.exp
tests/debugger/breakpoints.exp2
tests/debugger/browser_test.exp
tests/debugger/exception_cmd.exp
tests/debugger/exception_cmd.exp2
tests/debugger/exception_cmd.exp3
tests/debugger/exception_value.exp
tests/debugger/exception_value.exp2
tests/debugger/exception_vars.exp
tests/debugger/existential_type_classes.exp
tests/debugger/existential_type_classes.exp2
tests/debugger/exported_eqv_type.exp
tests/debugger/higher_order.exp
tests/debugger/interpreter.exp2
tests/debugger/lambda_expr.exp
tests/debugger/loopcheck.exp3
tests/debugger/loopcheck.inp2
tests/debugger/nondet_stack.exp
tests/debugger/nondet_stack.exp2
tests/debugger/polymorphic_output.exp
tests/debugger/polymorphic_output.exp2
tests/debugger/polymorphic_output.exp3
tests/debugger/print_goal.exp
tests/debugger/print_table.exp
tests/debugger/queens.exp
tests/debugger/queens.exp2
tests/debugger/resume_typeinfos.exp
tests/debugger/retry.exp
tests/debugger/retry.exp2
tests/debugger/tabled_read.exp
tests/debugger/tabled_read_decl.exp
tests/debugger/tabled_read_unitize.exp
tests/debugger/type_desc_test.exp
tests/debugger/declarative/aadebug.exp
tests/debugger/declarative/app.exp
tests/debugger/declarative/args.exp
tests/debugger/declarative/big.exp
tests/debugger/declarative/filter.exp
tests/debugger/declarative/if_then_else.exp
tests/debugger/declarative/input_term_dep.exp
tests/debugger/declarative/io_stream_test.exp
tests/debugger/declarative/io_stream_test.exp2
tests/debugger/declarative/output_term_dep.exp
tests/debugger/declarative/propositional.exp
tests/debugger/declarative/remember_modes.exp
tests/debugger/declarative/special_term_dep.exp
tests/debugger/declarative/tabled_read_decl.exp
tests/debugger/declarative/trust.exp
Remove call depth numbers from output run with standardized event
printing.
trace/mercury_trace_internal.c
Remove call depth from standardized event printing.
Estimated hours taken: 1.5
Branches: main
Rename "pretty" browser format to "raw_pretty" and "raw_pretty" to "pretty".
Make old "pretty" format print function return values. Remove univ_cons
constructor around old "raw_pretty" function return values.
Add extra note in NEWS about declarative debugger `trust' command.
browser/browse.m
Rename "raw_pretty" to "pretty" and vica versa. Use univ value when
creating doc for return value.
browser/sized_pretty.m
If a synthetic term has a return value then include it in the doc.
NEWS
Add note about print format name change.
Also add note about declarative debugger `trust' command.
tests/debugger/browse_pretty.exp
tests/debugger/browse_pretty.inp
tests/debugger/declarative/browse_arg.exp
tests/debugger/declarative/browse_arg.inp
tests/debugger/declarative/dependency.exp
tests/debugger/declarative/dependency.inp
Change input and expected output where pretty or raw_pretty formats
used.
tests/debugger/browser_test.m
tests/debugger/browser_test.exp
tests/debugger/browser_test.inp
Test printing of function applications.
Estimated hours taken: 1
Branches: main
Added a `cdr' command to the interactive term browser. This repeatedly cds
into a path and is useful for accessing deep structures (like long lists).
browser/browse.m
Rewrote simplify_dirs predicate which removes redundant `..'
directories. The previous method was too inefficient and caused
commands like `cdr 10000 ..' to take a long time.
Added help text.
browser/parse.m
Added handler for `cdr' command which is just translated into a `cd'
command with the path repeated the appropriate number of times.
tests/debugger/browser_test.inp
tests/debugger/browser_test.exp
Added test for cdr command.
Estimated hours taken: 3
Branches: main
Add an mdb command to save a term from the program being debugged to a file.
browser/browse.m:
Provide mechanisms to create browser terms from their components,
and to save browser terms to a named file.
trace/mercury_trace_browse.[ch]:
Provide access to these predicates from C code.
trace/mercury_trace_internal.c:
Implement a new mdb command, save_to_file, which saves a goal,
exception, procedure body or specified variable to a file.
doc/user_guide.texi:
doc/mdb_categories:
Document the new mdb command.
trace/mercury_trace_vars.[ch]:
Factor out the code for constructing the (components of) browser terms
from goals and variables from the code for browsing the resulting
terms, to allow them to be used also for saving those terms to a file.
tests/debugger/mdb_command_test.inp:
Test the documentation of the new command.
tests/debugger/completion.exp:
Update this test case both for the new command and for the previous one
I added (var_name_stats).
tests/debugger/browser_test.{m,inp,exp}:
Extend this test case to also test the behavior of the new command.
Estimated hours taken: 8
Branches: main
Make browsing in the debugger more flexible by adding options to the "ls",
"print" and "set" commands of the browser. Make browsing in the debugger less
confusing by making the "set" command by default set the parameters used
not just by the "ls" command but also by the "print" command, both inside and
outside the browser. This is done by making "ls" and "print" synonyms inside
the term browser.
browser/parse.m:
Replace the commands ls/0, ls/1 and print/1 with a single command,
print/2. The arguments of print/2 specify
- the presence or absence of options controlling which formatter to
use, and
- the path to the subterm to look at (which the "ls" command had,
but not the "print" command).
Change the set/1 command into the set/2 command, adding a field
specifying the presence or absence of options controlling which
caller type and/or which formatter parameters to set. The set/2
command within the browser prompt now functions the same as the "set"
command from the mdb prompt, because they now call the same code
to update the parameter sets.
Change the parsing infrastructure to allow the use of getopt to
process the options, by keeping around the word structure even after
tokenization.
Comment out code that isn't called, but may be needed later
for debugging.
Update the block comment documenting the command syntax.
browser/browse.m:
Conform to the change in the type of commands.
Change the implementation of the "set" command. Instead of the default
being to change only the parameter set used by the "ls" command, make
the default the application of the change to all the parameter sets.
If users want to restrict the change to apply only to the "ls" command,
they can specify the -B option.
Change the implementation of the set/0 command to report not just one
set of parameters, but all of them, since they can now all be changed
by the set/2 command.
Update the help message, to show the new options and to group related
commands together.
browser/browser_info.m:
Provide variants of the predicates for changing settings that are
specialized for the requirements of mdb and of the term browser.
Change the default format for the browser to "flat", to match the
default for the mdb "print" command. This was the default for the
browser's print command as well. This changes the default behavior
of the browser's "ls" command. Since "print" and "ls" had different
defaults but are now synonyms, we had to break backward compatibility
for one or the other. (Preserving different defaults for these two
browser commands would create an unnecessarily complicated user
interface with respect to the meaning of their options.)
browser/declarative_user.m:
Make it possible to switch the parameter set used to by the declarative
debugger to print atoms quickly yet consistently.
trace/mercury_trace_browse.c:
Call the C versions of the parameter setting predicates. (The versions
for use from within the term browser specify the parameters a different
way).
tests/debugger/browser_test.exp:
tests/debugger/exception_value.exp:
tests/debugger/polymorphic_output.exp:
tests/debugger/declarative/browse_arg.exp:
Update the expected outputs to comply with the changes above.
Estimated hours taken: 8
Branches: main
Add an option `--no-inline-builtins', which causes builtins to
be generated as calls to out-of-line procedures. This is done
by default when debugging, as without this option the execution
of builtins is not traced.
On earth, a compiler built in grade asm_fast.gc.tr.debug
takes 36.8s to run `mmc -C -I ../analysis/ hlds.make_hlds'.
When the compiler is built with `--no-inline-builtins',
this is increased to 38.6s.
The size of the compiler built in grade asm_fast.gc.tr.debug
increases from 45.0MB to 46.6MB.
compiler/options.m:
Add the option.
compiler/code_util.m:
Work out whether builtins should be generated inline.
compiler/handle_options.m:
Disable inlining of builtins when debugging.
compiler/simplify.m:
compiler/higher_order.m:
compiler/modes.m:
code_util__builtin_state now needs to know where the
builtin is being called from to know whether a particular
call should be treated as an inline builtin. The "recursive"
calls from the automatically generated procedures for each
builtin should always be generated inline, or else we would
generate an infinite loop.
NEWS:
doc/user_guide.texi:
compiler/notes/todo.html:
Document the change.
tests/debugger/Mmakefile:
tests/debugger/no_inline_builtins.{m,exp,inp}:
Test case.
tests/debugger/*.{inp,exp,exp2}:
tests/debugger/declarative/*.{inp,exp,exp2}:
Update due to changed event numbers.
tests/debugger/lval_desc_array.inp:
Use a less brittle method for stepping to the point in
the program where the test needs to display variables.
tests/debugger/declarative/library_forwarding.m:
tests/debugger/declarative/*.m:
Add forwarding predicates for some library predicates
and functions so that the declarative debugger doesn't
ask different questions depending on whether or not
the library was compiled with debugging enabled.
Estimated hours taken: 14
Branches: main
Change the compiler and tools so that `.' and not `:' is now used as the
module separator in all output.
Infix `.' now has associativity yfx and priority 10.
NEWS:
Report the change.
configure.in:
Amend the test for an up-to-date Mercury compiler to check whether
it recognises `.' as a module qualifier.
compiler/code_gen.m:
compiler/error_util.m:
compiler/hlds_out.m:
compiler/prog_out.m:
compiler/prog_util.m:
compiler/rl_exprn.m:
compiler/rl_gen.m:
compiler/source_file_map.m:
compiler/unused_args.m:
library/io.m:
library/rtti_implementation.m:
library/type_desc.m:
runtime/mercury_debug.c:
runtime/mercury_deconstruct.c:
runtime/mercury_stack_trace.c:
Change `:' to `.' as module separator for output.
compiler/mercury_to_mercury.m:
compiler/prog_io_typeclass.m:
As above.
Fixed a bug where `.' was not being recognised as a module separator.
doc/reference_manual.texi:
Report the change.
library/term_io.m:
Ensure that infix `.' is written without surrounding spaces.
tests/hard_coded/dot_separator.m:
tests/hard_coded/dot_separator.exp:
tests/hard_coded/Mmakefile:
Test case added.
Estimated hours taken: 4
Branches: main
Add a mechanism for standardizing the event and call sequence numbers in
debugger output. The mechanism is a global flag whose value is set from
MERCURY_OPTIONS. It is intended to be used only in our own internal testing.
runtime/mercury_trace_base.[ch]:
Define the global, MR_standardize_event_details.
Move the documentation of several globals from the .c to the .h file,
since that is where their users will look. Put those globals in a
consistent order.
Add functions for standardizing event and call sequence numbers,
and use them when printing event details.
runtime/mercury_wrapper.c:
Set MR_standardize_event_details when given the option -de.
runtime/mercury_stack_trace.c:
library/exception.m:
trace/mercury_trace_internal.m:
Respect MR_standardize_event_details.
tests/Mmake.common:
Define the make variable MDB_STD, which is like MDB except it also
puts -de in MERCURY_OPTIONS.
tests/debugger/Mmakefile:
Use MDB_STD instead of MDB for test cases that can benefit from
standardizing event and call sequence numbers.
Put the rules for the test cases in alphabetical order.
tests/debugger/*.exp*:
Update expected outputs after this change.
Estimated hours taken: 10
Branches: main
Improve variable naming in the debugger. Where possible, use
the user's argument names rather than `HeadVar__N'.
compiler/clause_to_proc.m:
Use the user's names for the arguments of
`:- pragma foreign_proc' procedures.
compiler/simplify.m:
When performing excess assignment elimination with `--trace deep',
don't replace a variable with a meaningful name with `HeadVar__N'
or an unnamed variable.
compiler/trace_params.m:
Add a predicate `trace_level_needs_meaningful_var_names'
for use by simplify.m.
compiler/typecheck.m:
For predicates with a single clause, attempt to replace the
`HeadVar__N' variables with the user's original head variables.
trace/mercury_trace_declarative.c:
trace/mercury_trace_vars.c:
Don't assume head variables have names of the form `HeadVar__N'.
Print the argument number when printing the names of
head variables.
tests/debugger/browser_test.inp:
tests/debugger/completion.inp:
Change names of variables in `print' commands.
tests/debugger/*.exp:
tests/debugger/*.exp2:
tests/debugger/declarative/dependency.exp:
tests/invalid/aditi_errors.err_exp:
tests/invalid/mode_inf.err_exp:
tests/invalid/record_syntax_errors.err_exp:
Update expected output.
Estimated hours taken: 0.5
Branches: main
Change .exp files to match .out files in debugger/browser tests
to match recent changes in pprint.
tests/debugger/browse_pretty.exp
tests/debugger/browser_test.exp
Estimated hours taken : 185
Added a new pretty printing format to the term browser. This new format
helps put a limit on the size of the term printed during debugging.
This limit is specified by setting the number of lines you want the term
to be printed on and the width of these lines. Refer to sized_pretty.m for
Examples.
browser/sized_pretty.m:
New file that does what's described above.
browser/browse.m:
browser/browser_info.m:
browser/mdb.m:
browser/parse.m:
trace/mercury_trace_browse.c:
trace/mercury_trace_browse.h:
trace/mercury_trace_internal.c:
Modified to accommodate the new format.
tests/debugger/browse_pretty.inp:
tests/debugger/browser_test.inp:
Included test cases for the new pretty printing format.
tests/debugger/browse_pretty.exp:
tests/debugger/browser_test.exp:
Changed the expected output.
Estimated hours taken: 25
Enhance the configuration parameters of the browser. The browser is now
sensitive to the type of caller (print, browse, or print *) and can have
different settings for each type. E.g., the default line limit per variable
can be made shorter for `print *' than for `print'. The browser also allows
different settings for each format.
The browser also accepts an optional format, which overrides the current
setting for the duration of the call.
To make use of these features, mdb has a new `set' command that allows the
settings to be updated in various ways. The browser version of `set'
still works, although it doesn't yet accept the options that the former does.
Also, `print' and `browse' can now take options that override the default
format.
browser/browser_info.m:
New module which defines the key browser data structures. The
`browser_state' previously used by browse.m has been split into
two parts: the transient state (browser_info) and the persistent
state (browser_persistent_state). The persistent state is created
when the browser is first called, and is saved between calls to the
browser, whereas a new transient state is created each time the
browser is called, and lasts for the duration of the call.
The persistent state contains settings for each possible combination
of format and caller type.
This module exports C functions that update the persistent state.
browser/browse.m:
Move the browser_state into the new module.
Change the interface so that it allows optional format and caller
type input arguments. This allows its behaviour to vary depending on
whether the caller is implementing `print', `browse', or `print *'.
It also allows the default format to be overridden by options to
these commands.
General rearrangement of the browser code to avoid code duplication.
This addresses the following comment from the module:
% XXX: could abstract out the code common to the following preds.
along with other similar problems.
The code for testing the size of a term and deciding between
`io__write' and a depth limited printer has been moved from `print'
to `portray_flat'. This allows `print' to be used with formats
other than flat.
TODO: allow browser commands to take format options; currently only
mdb commands can.
browser/declarative_user.m:
Update this for the changed interfaces.
browser/mdb.m:
Add the new module.
browser/parse.m:
Move the definitions of `dir', `setting', and `portray_format'
to the interface of the new module.
The argument to the `<' command, which sets the depth limit, is
no longer optional. The default used to be to use the system
default, but now there are multiple system defaults and no way to
select which one.
browser/*.m:
tests/debugger/browse_pretty.inp:
tests/debugger/browse_pretty.exp:
s/clipx/width/g
s/clipy/lines/g
The reason for this change is that the names are used in the
context of all formats, but only verbose format actually clips
the output, so `clipx' and `clipy' are misleading.
tests/debugger/browser_test.inp:
tests/debugger/browser_test.exp:
Test the new features.
doc/user_guide.texi:
Document the new features.
trace/mercury_trace_browse.c:
trace/mercury_trace_browse.h:
Allow extra arguments for the print and browse functions, to specify
the format and the caller type (in the case of print).
Export the function MR_trace_set_browser_param, which calls the
browser to do the work of mdb's set command.
Export the types MR_Browse_Caller_Type and MR_Browse_Format, which
mirror two of the types in the new browser module.
trace/mercury_trace_external.c:
Update for the change to MR_trace_browse_one: pass `browse' as
the caller type, and always use the default format.
trace/mercury_trace_internal.c:
Add functions to parse the format and caller type options. Update
the print and browse commands to expect format options. Add the
`set' command.
Replace MR_trace_print_var and MR_trace_browse_var with one function,
MR_trace_browse_internal. This function takes the caller type as an
argument, so there is no need for two functions.
Remove occurrences of:
/* XXX should use MR_mdb_in and MR_mdb_out */
since we already do this.
trace/mercury_trace_vars.c:
trace/mercury_trace_vars.h:
Change the function type MR_Browser so that it also expects a caller
type and a format. These arguments are now required by the browser.
This means that some of the functions that take an MR_Browser
argument needed to be updated to also take a caller and/or format,
so they can pass this on to the browser function when it is called.
Estimated hours taken: 3
Allow multiple browser commands on one line, separated by semicolons.
trace/mercury_trace_internal.c:
trace/mercury_trace_internal.h:
Separate the code for splitting lines and checking for EOF into
a new function, MR_trace_get_command.
browser/parse.m:
Call util__trace_get_command to read each command.
browser/util.m:
Implement util__trace_get_command, which calls the function
in the trace directory via an indirect pointer.
runtime/mercury_init.h:
runtime/mercury_wrapper.c:
runtime/mercury_wrapper.h:
util/mkinit.c:
Set up the indirect pointer to the new function.
tests/debugger/browser_test.inp:
tests/debugger/browser_test.exp:
tests/debugger/browser_test.exp2:
Test the new feature.
Estimated hours taken: 4
Allow users to request the printouts of only parts of variables.
Instead of the old sequence
browse Varnameornum
^1^2^3^4
p
^D
users can now just a single command: print Varnameornum^1^2^3^4, or print
Varnameornum/1/2/3/4. The required component is given by a sequence of
argument numbers, separated by ^s or /s.
(This syntax should eventually be extended to support the use of field names
instead of argument numbers. However, implementation of this extension will
need to wait until the RTTI interface to field names is stable.)
trace/mercury_trace_vars.[ch]:
Provide a mechanism to print not just the whole value of a variable,
but also just a component, if that is what the user wants.
trace/mercury_trace_internal.c:
Use the new mechanism in mercury_trace_vars.c.
trace/mercury_trace_util.[ch]:
Move a function to the new file mercury_trace_util.c from
mercury_trace_internal.c, since new mercury_trace_vars.c also
wants to use it.
trace/Mmakefile:
Add the new file to the list of source files.
tests/debugger/browser_test.{inp,exp,exp2}:
Test the new functionality.
Estimated hours taken: 0.5
tests/debugger/shallow.exp:
tests/debugger/shallow.exp2:
tests/debugger/browser_test.exp:
tests/debugger/browser_test.exp2:
tests/debugger/multi_parameter.exp:
Update the line numbers in the expected debugger output to
reflect changes caused by zs's recent bug fix to jumpopt.m.
Estimated hours taken: 40
Support line numbers in the debugger. You now get contexts (filename:lineno
pairs) printed in several circumstances, and you can put breakpoints on
contexts, when they correspond to trace events or to calls. The latter are
implemented as breakpoints on the label layouts of the return sites.
This required extending the debugging RTTI, so that associated with each
module there is now a new data structure listing the source file names that
contribute labels with layout structures to the code of the module. For each
such source file, this table gives a list of all such labels arising from
that file. The table entry for a label gives the line number within the file,
and the pointer to the label layout structure.
compiler/llds.m:
Add a context field to the call instruction.
compiler/continuation_info.m:
Instead of the old division of continuation info about labels into
trace ports and everything else, divide them into trace ports, resume
points and return sites. Record contexts with trace ports, and record
contexts and called procedure information with return sites.
compiler/code_info.m:
Conform to the changes in continuation_info.m.
compiler/options.m:
Add a new option that allows us to disable the generation of line
number information for size benchmarking (it has no other use).
compiler/stack_layout.m:
Generate the new components of the RTTI, unless the option says not to.
compiler/code_gen.m:
compiler/pragma_c_gen.m:
compiler/trace.m:
Include contexts in the information we gather for the layouts
associated with the events we generate.
compiler/call_gen.m:
Include contexts in the call LLDS instructions, for association
with the return site's label layout structure (which is done after
code generation is finished).
compiler/handle_options.m:
Delete the code that tests or sets the deleted options.
compiler/mercury_compile.m:
Delete the code that tests the deleted options.
compiler/basic_block.m:
compiler/dupelim.m:
compiler/frameopt.m:
compiler/livemap.m:
compiler/llds_common.m:
compiler/llds_out.m:
compiler/middle_rec.m:
compiler/opt_debug.m:
compiler/opt_util.m:
compiler/value_number.m:
compiler/vn_*.m:
Trivial changes to conform to the changes to llds.m.
compiler/jumpopt.m:
Do not optimize away jumps to labels with layout structures.
The jumps we are particularly concerned about now are the jumps
that return from procedure calls. Previously, it was okay to redirect
returns from several calls so that all go to the same label, since
the live variable information associated with the labels could be
merged. However, we now also associate line numbers with calls, and
these cannot be usefully merged.
compiler/optimize.m:
Pass the information required by jumpopt to it.
doc/user_guide.texi:
Document that you can now break at line numbers.
Document the new "context" command, and the -d or --detailed option
of the stack command and the commands that set ancestor levels.
runtime/mercury_stack_layout.h:
Extend the module layout structure definition with the new tables.
Remove the conditional facility for including label numbers in label
layout structures. It hasn't been used in a long time, and neither
Tyson or me expect to use it to debug either gc or the debugger itself,
so it has no uses left; the line numbers have superseded it.
runtime/mercury_stack_trace.[ch]:
Extend the code to print stack traces to also optionally print
contexts.
Add some utility predicates currently used by the debugger that could
also be use for debugging gc or for more detailed stack traces.
trace/mercury_trace_internal.c:
Implement the "break <context>" command, the "context" command, and
the -d or --detailed option of the stack command and the commands
that set ancestor levels.
Conditionally define a conditionally used variable.
trace/mercury_trace_external.c:
Minor changes to keep up with the changes to stack traces.
Delete an unused variable.
trace/mercury_trace_spy.[ch]:
Check for breakpoints on contexts.
trace/mercury_trace_tables.[ch]:
Add functions to search the RTTI data structures for labels
corresponding to a given context.
trace/mercury_trace_vars.[ch]:
Remember the context of the current environment.
tests/debugger/queen.{inp,exp}:
Test the new capabilities of the debugger.
tests/debugger/*.{inp,exp}:
Update the expected output of the debugger to account for contexts.
In some cases, modify the input script to put contexts where they don't
overflow lines.
Estimated hours taken: 0.1
tests/debugger/queens.exp:
tests/debugger/browser_test.exp:
tests/debugger/interpreter.exp:
tests/debugger/interpreter.exp2:
Update the expected output for these test cases to reflect the
renumbering of mdb variables starting from 1 rather than from 0.
Estimated hours taken: 12
Get the debugger to sort variables better.
trace/mercury_trace_vars.[ch]:
A new module to manage the debugger's information about the variables
live at the current program point (which can be defined as the
combination of a specific event and an ancestor level).
This new module centralizes the management of the (sorted) list of
current variables. This in turn allows us to use a better sorting
method, one that orders VarName15 correctly wrt both VarName2 and
VarName.
The new module also uses the type, not the name, of a variable
to decide whether to exclude it from the list of variables
that may be presented to the user (e.g. if it is a typeinfo
or a typeclassinfo).
trace/mercury_trace_internal.c:
trace/mercury_trace_external.c:
Use the new module's facilities. This factors out some "mostly"
common code.
trace/Mmakefile:
Add the new module.
runtime/mercury_layout_util.[ch]:
Remove the code recently moved here from trace/mercury_trace_internal,
as well as the filtered versions of some functions, since they are
not needed anymore.
Move the code for MR_make_var_list to trace/mercury_trace_external,
since that is the only place where it is used (or is at all likely
to be used). Since its new home is next to several very similar
functions, this should also reduce the probability that any required
maintenance will be overlooked. Also alter its coding style to conform
to its new neighbours.
Move the definition of MR_Var_Spec to trace/mercury_trace_vars.h.
tests/debugger/*.exp:
Update the expected output files. In most cases, this is just because
the new module outputs different white space, but in some cases, it
also reflects that the debugger now prints variables in a different
order.
Estimated hours taken: 5
Use the same method of input for the browser as for the internal
tracer. Previously, the browser did input via the Mercury library
and the internal tracer did input via readline (if available). This
did not work properly if files were redirected into stdin, which meant
that test cases could not be written for the browser. This change
also adds a test case.
browser/util.m:
Add a predicate, util__trace_getline/4, which does input via
the same method used by the internal debugger.
browser/parse.m:
Call util__trace_getline/4 instead of io__read_line/3.
browser/browse.m:
Pass the prompt to browser/parse.m as a string, rather than
printing it before calling.
trace/mercury_trace_internal.c:
trace/mercury_trace_internal.h:
Declare MR_trace_getline extern.
runtime/mercury_init.h:
runtime/mercury_wrapper.c:
runtime/mercury_wrapper.h:
util/mkinit.c:
Make MR_trace_getline available to the browser via a function
pointer.
tests/debugger/Mmakefile:
Add the new test case.
tests/debugger/browser_test.m:
tests/debugger/browser_test.inp:
tests/debugger/browser_test.exp:
The new test case.
runtime/mercury_trace_base.c:
runtime/mercury_trace_base.h:
Export MR_tracing_not_enabled() for use by browser/util.m.