mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 17:33:38 +00:00
master
21 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
d4589f7183 |
Update the expected output for the change in line numbers.
Estimated hours taken: 0.1 Branches: main tests/debugger/polymorphic_output.exp: Update the expected output for the change in line numbers. |
||
|
|
9afcdca217 |
Update the expected output for the change in line numbers.
Estimated hours taken: 0.1
Branches: main
tests/debugger/polymorphic_output.{exp,exp2}:
Update the expected output for the change in line numbers.
|
||
|
|
03e12f1b8c |
Fix the first expected output of this test.
Estimated hours taken: 0.1 Branches: main tests/debugger/polymorphic_output.exp: Fix the first expected output of this test. The previous commit was accidentally the debug grade expected output, whereas this file is the non-debug grade expected output. |
||
|
|
5ad9a27793 |
Speed up the compiler's handling of code that constructs large ground terms
Estimated hours taken: 80
Branches: main
Speed up the compiler's handling of code that constructs large ground terms
by specializing the treatment of such code.
This diff reduces the compilation time for training_cars_full.m from 106.9
seconds to 30.3 seconds on alys, my laptop. The time on tools/speedtest
stays pretty much the same.
compiler/hlds_goal.m:
Record the classification of from_ground_term scopes as purely
constructing terms, purely deconstructing them or something other.
Fix an old potential bug: variables inside the construct_how fields
of unifications weren't being renamed along with other variables.
This is a bug if any part of the compiler later looks at those
variables. (I am not sure whether or not this happens.)
compiler/superhomogenous.m:
Provisionally mark newly constructed static terms as being
from_ground_term_construct. Mode checking will either confirm this
or change the scope kind.
compiler/options.m:
compiler/handle_options.m:
Add a new option, from_ground_term_threshold, that allows the user to
set the boundary between ground terms that get scopes and ground terms
do not. I plan to experiment with different settings later.
compiler/modes.m:
Make this classification. For scopes that construct ground terms,
use a specialized algorithm that avoids quadratic behavior.
(It does not access the unify_inst_table, which is where the
factor of N other than the length of the goal list came from.)
The total size of the instmap_deltas, if printed out, still looks like
O(N^2) in size, but due to structure sharing it needs only O(N) memory.
For scopes that construct ground terms, set the determinism information
so that det_analysis.m doesn't have to traverse such scopes.
When handling disjunctions, check whether some nonlocals of the
disjunctions are constructed by from_ground_term_construct scopes.
For any such nonlocals, set their insts to just ground, throwing away
the precise information we have about exactly what function symbols
they and ALL their subterms are bound to. This is HUGE win, since
it allows us avoid spending a lot of time building a huge merge_inst
table, which later passes of the compiler (e.g. equiv_type_hlds) would
then have to spend similarly huge times traversing.
This approach does have a down side. If lots of arms of a disjunction
bind a nonlocal to a large ground term, but a few bind it to a SMALL
ground term, a term below the from_ground_term_threshold, this
optimization won't kick in. That could be one purpose of the new
option. It isn't documented yet; I will seek feedback about its
usefulness first.
compiler/modecheck_unify.m:
Handle the three different kinds of right hand sides separately.
This yields a small speedup, because now we don't test rhs_vars and
rhs_functors (the common right hand sides) for a special case
(goals containing "any" insts) that is applicable only to
rhs_lambda_goals.
compiler/unique_modes.m:
Don't traverse scopes that construct ground terms, since modes.m has
already done everything that needs to be done.
compiler/det_analysis.m:
Don't traverse scopes that construct ground terms, since modes.m has
already done the needed work.
compiler/instmap.m:
Add a new predicate for use by modes.m.
Many predicate names in this module were quite uninformative; give them
informative names.
compiler/polymorphism.m:
If this pass invalidates the from_ground_term_construct invariants,
then mark the relevant scope as from_ground_term_other.
Delete two unused access predicates.
compiler/equiv_type_hlds.m:
Don't traverse scopes that construct ground terms, since modes.m
ensures that their instmap deltas do not contain typed insts, and
thus the scope cannot contain types that need to be expanded.
Convert some predicates to single clauses.
compiler/goal_form.m:
compiler/goal_util.m:
In predicates that test goals for various properties, don't traverse
scopes that construct ground terms when the outcome of the test
is the same for all such scopes.
Convert some predicates to single clauses.
compiler/simplify.m:
Do not look for common structs in from_ground_term_construct scopes,
both because this speeds up the compiler, and because retaining
references to ground terms is in fact a pessimization, not an
optimization. This is because (a) those references need to be stored in
stack slots across calls, and (b) the C code generators ensure that
the cells representing ground terms will be shared as needed.
If all arms of a switch are from_ground_term_construct scopes,
do not merge the instmap_deltas from those arms, since this is
both time-consuming (even after the other changes in this diff)
and extremely unlikely to improve the instmap_delta.
Disable common_struct in from_ground_term_construct scopes,
since for these scopes, it is actually a pessimization.
Do not delete from_ground_term_construct scopes, since many
compiler passes can now use them.
Do some manual deforestation, break up some large predicates,
and give better names to some.
compiler/liveness.m
Special-case the handling from_ground_term_construct scopes. This
allows us to traverse them just once instead of three times, and this
traversal is simpler and faster than any of the three.
In some traversals, we were switching on the goal type twice; once
in e.g. detect_liveness_in_goal_2, and once by calling
goal_expr_has_subgoals. Eliminate the double switching by merging
the relevant predicates. (The double-switching structure was easier
to work with before we had multi-cons-id switches.)
compiler/typecheck.m:
Move a lookup after a test, so we don't have to do it if the test
fails.
Provide a specialized mode for a predicate. This should allow the
compiler to eliminate an argument and a test in the common case.
Note a possible chance for a speedup.
compiler/typecheck_info.m:
Don't apply empty substitutions to the types of a possibly very large
set of variables.
compiler/quantification.m:
Don't quantify from_ground_term_construct scopes. They are created
correctly quantified, and any compiler pass that invalidates that
quantification also removes the from_ground_term_construct mark.
Don't apply empty renamings to a possibly very large set of variables.
Move the code for handling scopes to its own predicate, to avoid
overwhelming the code that handles other kinds of goals. Even from
this, factor out the renaming code, since it is needed only for
some kinds of scopes.
Make some predicate names better reflect what the predicate does.
compiler/pd_cost.m:
For from_ground_term_construct scopes, instead of computing their cost
by adding up the costs of the goals inside, make their cost a constant,
since binding a variable to a static term takes constant time.
compiler/pd_info.m:
Add prefixes on field names to avoid ambiguities.
compiler/add_heap_ops.m:
compiler/add_trail_ops.m:
compiler/closure_analysis.m:
compiler/constraint.m:
compiler/cse_detection.m:
compiler/dead_proc_elim.m:
compiler/deep_profiling.m:
compiler/deforest.m:
compiler/delay_construct.m:
compiler/delay_partial_inst.m:
compiler/dep_par_conj.m:
compiler/distance_granularity.m:
compiler/exception_analysis.m:
compiler/follow_code.m:
compiler/follow_vars.m:
compiler/format_call.m:
compiler/granularity.m:
compiler/higher_order.m:
compiler/implicit_parallelism.m:
compiler/inlining.m:
compiler/interval.m:
compiler/lambda.m:
compiler/lco.m:
compiler/live_vars.m:
compiler/loop_inv.m:
compiler/middle_rec.m:
compiler/mode_util.m:
compiler/parallel_to_plain_conj.m:
compiler/saved_vars.m:
compiler/stm_expand.m:
compiler/store_alloc.m:
compiler/stratify.m:
compiler/structure_reuse.direct.detect_garbage.m:
compiler/structure_reuse.lbu.m:
compiler/structure_sharing.analysis.m:
compiler/switch_detection.analysis.m:
compiler/trail_analysis.m:
compiler/term_pass1.m:
compiler/tupling.m:
compiler/unneeded_code.m:
compiler/untupling.m:
compiler/unused_args.m:
These passes have nothing to do in from_ground_term_construct scopes,
so don't traverse them.
In some modules (e.g. dead_proc_elim), some traversals had to be kept.
In loop_inv.m, replace a code structure that updated accumulators
with functions (which prevented the natural use of state variables),
that in lots of places reconstructed the term it had just
deconstructed, and obscured the identical handling of different kinds
of goals, with a structure based on predicates, state variables and
shared code for different goal types where possible.
In store_alloc.m, avoid some double switching on the same value.
In stratify.m, unneeded_code.m and unused_args.m, rename predicates
to avoid ambiguities.
compiler/goal_path.m:
compiler/goal_util.m:
compiler/implementation_defined_literals.m:
compiler/intermode.m:
compiler/mark_static_terms.m:
compiler/ml_code_gen.m:
compiler/mode_ordering.m:
compiler/ordering_mode_constraints.m:
compiler/prop_mode_constraints.m:
compiler/purity.m:
compiler/rbmm.actual_region_arguments.m:
compiler/rbmm.add_rbmm_goal_infos.m:
compiler/rbmm.condition_renaming.m:
compiler/rbmm.execution_path.m:
compiler/rbmm.region_transformation.m:
compiler/structure_reuse.direct.choose_reuse.m:
compiler/structure_reuse.indirect.m:
compiler/structure_reuse.lfu.m:
compiler/structure_reuse.versions.m:
compiler/term_const_build.m:
compiler/term_traversal.m:
compiler/unused_imports.m:
Mark places where we cannot (yet) special case
from_ground_term_construct scopes.
In structure_reuse.lfu.m, turn nested if-then-elses into a switch in.
compiler/size_prof.m:
Turn from_ground_term_construct scopes into from_ground_term_other
scopes, since in term size profiling grades, we need to attach sizes to
terms.
Give predicates better names.
compiler/*.m:
Minor changes to conform to the changes above.
compiler/make_hlds_passes.m:
With -S, print statistics after the third pass over items, since
this is the time-consuming one.
compiler/mercury_compile.m:
Conform to the new names of some predicates.
When declining to output a HLDS dump because it would be identical to
the previous dump, don't confuse the user either by being silent about
the decision, or by leaving an old dump laying around that could be
mistaken for a new one.
tools/binary:
tools/binary_step:
Bring these tools up to date.
compiler/Mmakefile:
Add an int3s target for use by the new code in the tools. The
Mmakefiles in the other directories with Mercury code already have
such a target.
compiler/notes/allocation.html:
Fix an out-of-date reference.
tests/debugger/polymorphic_ground_term.{m,inp,exp}:
New test case to check whether liveness.m handles typeinfo liveness
of ground terms correctly.
tests/debugger/Mmakefile:
Enable the new test case.
tests/debugger/polymorphic_output.{m,exp}:
Fix tab/space mixup.
|
||
|
|
dd44e0ef62 |
Replace the "set" command of mdb with a bunch of commands: the `format',
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.
|
||
|
|
60014ad506 |
Update the expected output after my recent change.
Estimated hours taken: 0.1 Branches: main tests/debuggger/polymorphic_output.exp: Update the expected output after my recent change. |
||
|
|
ef55b420fd |
Remove from std_util.m the predicates that merely call predicates in
Estimated hours taken: 12
Branches: main
Remove from std_util.m the predicates that merely call predicates in
the type_desc, construct and deconstruct modules, to reduce clutter
in std_util.m.
library/std_util.m:
Remove those predicates from std_util.m.
library/deconstruct.m:
Add a type we need that was previously defined in std_util.m.
library/construct.m:
Delete some module qualifications that have now become unnecessary,
browser/browse.m:
browser/browser_info.m:
browser/declarative_tree.m:
browser/dl.m:
browser/help.m:
browser/sized_pretty.m:
browser/term_rep.m:
compiler/bytecode_gen.m:
compiler/llds_out.m:
compiler/mlds_to_il.m:
compiler/mlds_to_managed.m:
library/assoc_list.m:
library/hash_table.m:
library/io.m:
library/pprint.m:
library/private_builtin.m:
library/prolog.m:
library/require.m:
library/rtti_implementation.m:
library/store.m:
library/term.m:
library/term_to_xml.m:
library/version_hash_table.m:
mdbcomp/program_representation.m:
Import type_desc.m, construct.m and/or deconstruct.m to provide
definitions of functions or predicates that up till now were in
std_util.m. Modify the calls if the called function or predicate
had a slightly different interface in std_util.m.
Also, convert term_to_xml.m to four-space indentation, and delete
unnecessary module qualifications in term.m.
tests/debugger/polymorphic_output.{m,inp,exp,exp2}:
tests/hard_coded/copy_pred_2.m:
tests/hard_coded/deconstruct_arg.exp:
tests/hard_coded/deconstruct_arg.exp2:
tests/hard_coded/deconstruct_arg.m:
tests/hard_coded/elim_special_pred.m:
tests/hard_coded/existential_bound_tvar.m:
tests/hard_coded/expand.m:
tests/hard_coded/foreign_type2.m:
tests/hard_coded/higher_order_type_manip.m:
tests/hard_coded/nullary_ho_func.m:
tests/hard_coded/tuple_test.m:
tests/hard_coded/type_ctor_desc.m:
tests/hard_coded/type_qual.m:
tests/hard_coded/write_xml.m:
tests/hard_coded/sub-modules/class.m:
tests/hard_coded/sub-modules/nested.m:
tests/hard_coded/sub-modules/nested2.m:
tests/hard_coded/sub-modules/nested3.m:
tests/hard_coded/sub-modules/parent.m:
tests/hard_coded/sub-modules/parent2.child.m:
tests/hard_coded/typeclasses/existential_rtti.m:
tests/recompilation/type_qual_re.m.1:
cvs update: Updating tests/submodules
cvs update: Updating tests/tabling
cvs update: Updating tests/term
cvs update: Updating tests/tools
cvs update: Updating tests/trailing
cvs update: Updating tests/typeclasses
cvs update: Updating tests/valid
tests/valid/agc_unbound_typevars.m:
tests/valid/agc_unbound_typevars2.m:
tests/valid/agc_unused_in.m:
Replace references to the deleted predicates in std_util with
references to the equivalent predicates in type_desc, construct
and/or deconstruct. In test cases that already tested both the
functionality in std_util and in the other modules, simply delete
the part exercising std_util.
|
||
|
|
11042e060c |
Allow field names to be used in the paths used with subterm dependency
Estimated hours taken: 5 Branches: main Allow field names to be used in the paths used with subterm dependency tracking. Allow the user to cd to the return value of a function by giving the number of arguments plus one as an argument to the `cd' command. browser/browse.m: Export the predicate that removed ".." from paths. Make the return value of this predicate a subtype, so we can be sure the simplification has been applied to the path. Allow the user to do `cd N', where N is the number of arguments of a function plus one. This will cd to the return value of the function. Add some more aliases for the directory name of the return value of a function. browser/browser_info.m: Use the new simplified_dirs inst. When converting a list of directories to a term path, look at the value the path applies to to resolve field names in the path. browser/declarative_user.m: Report an error if the user tries to track an I/O action. Call the new version of convert_dirs_to_term_path which handles field names in the path. browser/term_rep.m: Add predicates to lookup a subterm in a term representation and also to look up a named field in a term representation. tests/debugger/declarative/Mercury.options: tests/debugger/declarative/Mmakefile: tests/debugger/declarative/named_fields.exp: tests/debugger/declarative/named_fields.inp: tests/debugger/declarative/named_fields.m: Test tracking of subterms using a path with a field name. tests/debugger/polymorphic_output.exp* The output of this test has changed, because cd's to the return value of a function, using a number, are now allowed. |
||
|
|
cab3c62fe7 |
Remove call depth numbers from standardized event printing.
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. |
||
|
|
0942716fe7 |
Fix a bug that caused a runtime abort if you called the library
Estimated hours taken: 3
Branches: main
runtime/mercury_ml_expand_body.h:
Fix a bug that caused a runtime abort if you called the library
function named_argument (which is implemented in this file) on
a value of a type which has no field name information at all.
browser/browse.m:
Generate better error messages when an attempt to change to a subterm
fails: say which step failed, and which ones succeeded.
tests/debugger/field_names.{m,inp,exp}:
Strengthen the test case to cover types with no field names at all:
a regression test to check for the bug in mercury_ml_expand_body.h.
Strengthen the test case using several unsuccessful commands, to test
the improved error messsages.
tests/debugger/polymorphic_output.exp*:
Update the expected outputs of this test case to account for the new
error messages.
|
||
|
|
bed904e722 |
Make browsing in the debugger more flexible by adding options to the "ls",
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. |
||
|
|
a8ffd3680c |
Change the compiler and tools so that .' and not :' is now used as the
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. |
||
|
|
5f20c37b7a |
Add a mechanism for standardizing the event and call sequence numbers in
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. |
||
|
|
1167698388 |
Changes now that we report that an Uncaught exception comes
Estimated hours taken: 3 Branches: main debugger/exception_cmd.exp: debugger/exception_cmd.exp2: debugger/exception_vars.exp: debugger/exception_vars.exp2: debugger/loopcheck.exp: debugger/loopcheck.exp2: debugger/polymorphic_output.exp: debugger/polymorphic_output.exp2: debugger/polymorphic_output.exp3: general/string_format_test_2.exp: general/string_format_test_2.exp2: general/string_format_test_2.exp3: general/string_format_test_2.exp4: general/string_format_test_3.exp: general/string_format_test_3.exp2: general/string_format_test_3.exp3: general/string_format_test_3.exp4: hard_coded/foreign_type.m: hard_coded/no_fully_strict.exp: hard_coded/no_fully_strict.exp2: hard_coded/no_fully_strict.exp3: hard_coded/no_fully_strict.exp4: hard_coded/exceptions/test_uncaught_exception.exp: hard_coded/exceptions/test_uncaught_exception.exp2: hard_coded/exceptions/test_uncaught_exception.exp3: hard_coded/exceptions/test_uncaught_exception.exp4: tabling/loopcheck.exp: tabling/loopcheck.exp2: tabling/loopcheck.exp3: tabling/loopcheck.exp4: Changes now that we report that an Uncaught exception comes from Mercury. |
||
|
|
a0f4df203d |
Update expected output after my change to fix the handling of
Estimated hours taken: 0.25 Branches: main tests/debugger/breakpoints.exp2: tests/debugger/existential_type_classes.exp2: tests/debugger/polymorphic_output.exp: tests/debugger/polymorphic_output.exp2: Update expected output after my change to fix the handling of breakpoints and the printing of events involving functions. |
||
|
|
fcccbd166f |
Reorganize deconstruct.m so that each predicate that deconstructs terms has
Estimated hours taken: 12
Branches: main
Reorganize deconstruct.m so that each predicate that deconstructs terms has
three variants:
- One that aborts when attempting to deconstruct non-canonical terms.
- One that succeeds when attempting to deconstruct a term of a non-canonical
type, but returns a constant such as "<<noncanonical>>" for such
deconstructions. It still aborts when deconstructing a noncanonical term
of an ordinarily canonical type, which can happen with HAL if the term
is currently a variable.
- One that succeeds when attempting to deconstruct non-canonical terms of both
kinds, but whose determinism requires its caller to be in a committed choice
context.
Each of the predicates function, arg, named_arg, deconstruct and
limited_deconstruct now has an extra argument that selects one of the three
variants above. Each of these predicates now has three modes, one for each
value of this argument. The separate predicates with _cc at the ends of their
names are now superseded by one of these modes.
At the same time, I also eliminated the distinction between arg and argument.
Arg used to check if the returned argument was of the expected type, and fail
if it wasn't, while argument used to return a univ. The new arg now returns
a value of an existential type, which the caller can now typecheck or put
into a univ as it pleases.
The descriptions of the changes:
library/deconstruct.m:
Implement the changes discussed above. Work around a bug by making
the foreign_procs return a univ from which we later extract the value;
this inefficiency should be fixed later, when the typechecker has been
fixed to allow different clauses to return existentially typed values.
library/std_util.m:
Reimplement the forwarding predicates that call deconstruct.m in terms
of its new interface.
library/io.m:
Make use of the new functionality in deconstruct.m to offer versions
of io__print and io__write that allow the user to choose how to print
noncanonical terms.
library/private_builtin.m:
Export the `sorry' predicate for use in deconstruct.m and elsewhere.
runtime/mercury_deconstruct.[ch]:
runtime/mercury_ml_expand_body.h:
runtime/mercury_ml_arg_body.h:
runtime/mercury_ml_deconstruct_body.h:
runtime/mercury_ml_functor_body.h:
Implement the new functionality.
library/store.m:
extras/trailed_update/tr_store.m:
Conform to the new interfaces of some functions in the updated files
in the runtime.
tests/debugger/polymorphic_output.exp*:
Update for an updated error message.
tests/hard_coded/deconstruct_arg.{m,exp*}:
Update the test case to test the committed choice versions of the
deconstruction predicates as well as the usual versions. (The aborting
versions cannot all be tested in a single test case.)
|
||
|
|
e1778fbc75 |
Give the debugger the ability to print goals.
Estimated hours taken: 20
Branches: main
Give the debugger the ability to print goals.
NEWS:
Mention the new ability.
browser/browser_info.m:
Define a new type, browser_term, which represents either a plain term,
or a "synthetic term", which is a string (predicate or function name),
a list of argument values, and an indication of whether the synthetic
term is a predicate goal (i.e. of the form p(a1, ..., an)) or a
function goal (i.e. of the form f(a1, ..., an-1) = an).
Add utility predicates for processing browser_terms.
browser/browse.m:
Add predicates for printing and browsing synthetic terms, and export
them to C code.
browser/browse.m:
browser/size_pretty.m:
Generalize lots of predicates to handle browser_terms, not just plain
terms.
browser/util.m:
Add a new type, "unbound", for use by mercury_trace_vars.c.
library/pprint.m:
Add functions for converting synthetic terms to docs.
Fix a potential efficiency problem: an unnecessary deconstruct.
runtime/mercury_type_info.h:
Add macros for defining static type_infos in C code.
Add macros for computing the names of type_ctor_infos even in non-hlc
grades.
Give C code access to the representation of bools and of values of
the new type "unbound".
trace/mercury_trace_browse.[ch]:
Add functions for printing goals.
trace/mercury_trace_internal.c:
Add code to recognize and handle the commands "print goal" and
"browse goal".
doc/user_guide.texi:
Document the new commands.
trace/mercury_trace_vars.[ch]:
Add a function to compute the components of synthetic terms.
tests/debugger/browse_pretty.{inp,exp*}:
Add new commands to the input to test the printing and browsing of
predicate goals, and update the expected outputs accordingly.
tests/debugger/polymorphic_output.{inp,exp*}:
Add new commands to the input to test the printing and browsing of
function goals, and update the expected outputs accordingly.
|
||
|
|
97f3c08a45 |
Update expected output files to reflect a corrected error message.
Estimated hours taken: 0.2 Branches: main tests/debugger/polymorphic_putput.exp*: Update expected output files to reflect a corrected error message. |
||
|
|
e60f641d9b |
Make it possible to save the state of a debugger session wrt break points
Estimated hours taken: 6 Make it possible to save the state of a debugger session wrt break points and aliases in a file that can be sourced in another debugger session to restore the state. trace/mercury_trace_internal.c: Add a new mdb command, "save <filename>", to save mdb's state to the named file. Allow the "disable", "enable" and "delete" commands to be given without arguments; such invocations refer to the most recently created breakpoint. The extension to "disable" is required by the implementation of the "save" command; the others are for symmetry. Allow the user to speficy an option to the source command that tells mdb not to complain if the named file cannot be processed. This should allow people to put into .mdbrc files commands to source saved state files if they exist and not get complaints if they don't. Make several messages conform to our convention that error messages start with "mdb: ". trace/mercury_trace_spy.[ch]: Add code to implement the part of the "save" command concerned with breakpoints. Unfortunately, there is no simple way to save the specification of breakpoints created with "break here", so for the time being they are not saved. This should not be too much of a problem, since such breakpoints are rarely used. Maintain a variable that identifies the most recently added breakpoint, if any. Also move the function to print out breakpoints here from mercury_trace_internal.c, in order to centralize knowledge about breakpoints here. trace/mercury_trace_alias.[ch]: Add code to implement the part of the "save" command concerned with aliases. Fix some occurrences of an old bug: use MR_free, not free, to free strings allocated with MR_copy_string. trace/mercury_stack_trace.[ch]: Add a version of MR_print_proc_id that prints proc ids in a form suitable for mdb procedure specifications. doc/user_guide.texi: Document the "save" command and the new usage modes of the other modified commands. tests/debugger/mdb_command_test.inp: Test the existence of documentation for the "save" command. tests/debugger/polymorphic_output.exp: Update an expected error message. |
||
|
|
9d4392791e |
Fix some bugs in a test case that I recently added.
Estimated hours taken: 0.25 Fix some bugs in a test case that I recently added. tests/debugger/Mmakefile: tests/debugger/polymorphic_output.inp: tests/debugger/polymorphic_output.exp: tests/debugger/polymorphic_output.exp2: Fix some bugs in this test case: - the program throws an exception, so we need to handle the test of the exit status specially in the Mmakefile; - when setting a breakpoint on `det_arg', the `.inp' file needs to use an explicit `std_util__' module qualifier to avoid ambiguity with the `det_arg' procedure in the `prolog' module; - the `.exp' and `.exp2' files did not match what was actually output. |
||
|
|
75de15c6ab |
Add "echo on" at the start of the test case,
Estimated hours taken: 0.25 tests/debugger/exception_vars.inp: tests/debugger/exception_vars.exp: tests/debugger/exception_vars.exp2: Add "echo on" at the start of the test case, so that it gets the right results when the compiler is configured without readline support. |