mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-21 04:13:46 +00:00
083d376e6598628362ee91c2da170febd83590f4
12 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
2794e7495c |
tests/debugger/tabled_read.exp:
Expect updated line numbers after my recent change to the source file. |
||
|
|
0731932d14 |
Construct strings representing c_pointer addresses.
Estimated hours taken: 2 Branches: main runtime/mercury_ml_expand_body.h: Construct strings representing c_pointer addresses. Used in the implementation of functor and deconstruct. library/deconstruct.m: Document the behaviour of functor and deconstruct for c_pointers. library/string.m: Export c_pointer_to_string for getting a string representation of the pointer address. library/io.m: library/rtti_implementation.m: Use c_pointer_to_string/1 to print c_pointers. Update comments. library/pprint.m: Undo Ralph's earlier change, since it is no longer required. tests/debugger/Mmakefile: tests/debugger/declarative/Mmakefile: Canonicalize the output of test cases in which c_pointers appear. tests: Update the expected output of test cases. |
||
|
|
d03ce7dbc0 |
Fix some bugs in my previous diff that optimized away stack slots storing
Estimated hours taken: 8 Branches: main Fix some bugs in my previous diff that optimized away stack slots storing dummy values that manifested themselves as warnings from the C compiler about integers too big to fit into 8 or 16 bits being implicitly truncated. They did not lead to the failure of any test case, since it doesn't matter whether the debugger gets the values it ignores (I/O states or stores) from valid stack slots or not. When generating RTTI for gc and the debugger, the compiler had three places that generated references to stack slots: the return sites of calls, resume points, and trace events. The previous diff updated only the first of these. This diff updates the other two, and ensures there are no more. Since the debugger needs to know whether a procedure has a pair of I/O state arguments (e.g. when performing a retry), we add a field to proc layouts to hold this information. runtime/mercury_grade.h: Increment the debug grade runtime compatibility version number to reflect the change in layout structures. runtime/mercury_stack_layout.h: Add an extra field to proc layouts to specify flags. At the moment, the only flag says whether the procedure has a pair of I/O state arguments. Add an extra field to proc layouts to specify the trace level of a procedure. This used to be the same as the module's trace level, but one of my bug fixes a couple of months ago broke that link. We don't yet use this field, but it makes sense to do it at the same time as the increment of the compatibility version number. compiler/continuation_info.m: Attach to every description of a live value a description of where in the compiler that description was created. Rename the type involved to avoid an ambiguity. Ignore dummy types when generating resume layouts. Add some sanity checks. Add new fields to the continuation_info data structure to allow stack_layout.m to fill in the new fields in proc layout structures. compiler/trace.m: Do not generate references to dummy values at trace events, except at call ports. At those ports, all live variables should be in registers. compiler/stack_layout.m: Make the check for whether a value fits into an unsigned 8 bit value a direct rather than an indirect one. The indirect one assumed that stack slot numbers are all positive, which is now a bad assumption. Check for negative stack slot numbers in all RTTI stack slot descriptions. Fill in the two new slots in proc layout structures. compiler/layout.m: Reserve space for the two new slots in proc layout structures. compiler/layout_out.m: Output the two new slots in proc layout structures. compiler/code_gen.m: Preserve the information needed by stack_layout.m for the two new fields. compiler/llds_out.m: Add some code that ensures that we never output an integer constant that doesn't fit into the range of its type. Since this code is executed many millions of times, it is designed to be enabled only when the checking is manually enabled. It is normally off, but I got a clean bootcheck in the debug grade (which is the best stress test) with it enabled. compiler/trace_params.m: Update a comment. compiler/code_info.m: Export a function for use by trace.m. compiler/hlds_pred.m: Export a predicate for use by stack_layout.m. compiler/Mercury.options: Enable inlining for llds_out.m, to get rid of the sanity checking overhead if it is not enabled. tests/debugger/completion.exp*: tests/debugger/interpreter.exp*: tests/debugger/multi_parameter.exp*: tests/debugger/queens.exp*: tests/debugger/print_goal.exp*: tests/debugger/tabled_read.exp*: tests/debugger/tabled_read_decl.exp*: tests/debugger/declarative/io_stream_test.exp*: tests/debugger/declarative/tabled_read_decl.exp*: Update these expected output files to not expect dummy values that aren't kept anymore. |
||
|
|
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. |
||
|
|
759f76a314 |
Make debugging of minimal model tabling more convenient.
Estimated hours taken: 1.5 Branches: main Make debugging of minimal model tabling more convenient. compiler/handle_options.m: Make -Dmm generate HLDS dumps tailored for understanding the code of procedures transformed by minimal model tabling. runtime/mercury_minimal_model.c: When printing the stack segments being saved, print the values of variables in the affected stack frames. runtime/mercury_stack_trace.c: When dumping the nondet stack, print the name of the procedure that established each ordinary frame, and the goal path at which control will reenter the stack frame, if this information is available. Since mercury_minimal_model.c now asks for the printing of variable values (which is done by Mercury code) while execution is outside the debugger and hence while execution tracing may be enabled, explicitly turn off debugging while in the Mercury code that prints variable values. runtime/mercury_trace_base.[ch]: Provide a simple mechanism for turning off debugging functionality in a region of code. trace/mercury_trace_internal.c: Use the new mechanism in mercury_trace_base to handle turning off debugging output inside the debugger. This also allows us to simplify the code implementing the "flag" mdb command. Make the reports generated by the "unhide_events" and "table_io" commands follow the same format as other commands. Note that mercury_trace_declarative.c doesn't use the new mechanism, because it wants the reexecution of the call being debugged to be exactly the same as its first execution; in particular, turning off I/O tabling for reexecution would generate incorrect results. tests/debugger/nondet_stack.exp*: tests/debugger/tabled_read.exp*: tests/debugger/tabled_read_decl.exp*: tests/debugger/tabled_read_unitize.exp*: tests/debugger/io_stream_test.exp*: tests/debugger/declarative/tabled_read_decl.exp*: Update the expected out of these test cases to reflect the new functionality 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. |
||
|
|
32d4fdef8a |
Rationalize the mechanisms we use to control retry across I/O.
Estimated hours taken: 8
Branches: main
Rationalize the mechanisms we use to control retry across I/O.
After this change, we never ask questions about retry across I/O if the retry
is guaranteed to be safe. If the I/O is not guaranteed to be safe, there are
three things we can do:
- We ask the user whether they really want to. This is the default, and can be
asked for explicitly with "retry --interactive".
- We perform the retry without asking questions. This can be asked for
explicitly with "retry --force".
- We abort the retry automatically without asking questions. This can be asked
for explicitly with "retry --only-if-safe".
The implicit retries used to implement declarative debugging and the indirect
retries needed in the presence of minimal model tabling use the last option.
We need two conditions for the retry to be guaranteed to be safe:
- All I/O actions must be tabled.
- The retry must be wholly within the tabled region of the execution.
The first is normally assured by a debugging grade. However, to allow test
cases to test the behavior of retries even with --only-if-safe (and hence to
allow the testing of declarative debugging), we have another new flag,
--assume-all-io-is-tabled, which asserts the first condition to be true
even in non-debugging grades. This option applies both to the retry command
and the dd and dd_dd commands.
doc/user_guide.texi:
Move the misc commands (which are intended for use by everybody)
before the experimental and developer commands (which are intended
for use only by developers).
Document the dd_dd command in the developer section.
Document the new options of the retry, dd and dd_dd commands, with
the documentation of the developer-only options commented out.
Consolidate the documentation of the two variants of the retry command
into one, in order to reduce duplication.
Add a cross-reference requested by Fergus.
Add an XXX asking Mark to document the optional argument of dd_dd.
doc/generate_mdb_doc:
Switch the order of sections to match the change in user_guide.texi.
doc/mdb_categories:
Switch the order of sections to match the change in user_guide.texi,
and include dd and dd_dd in the command lists.
runtime/mercury_trace_base.[ch]:
Add a pair of global variables recording the event numbers at which
I/O tabling is turned on and off.
Make some declarations use the right typedef.
trace/mercury_trace.[ch]:
Make MR_trace_retry respect the values of the new options
controlling retries passed to it.
Convert this file to four-space indentation to reduce the number of
line-wraps.
trace/mercury_trace_declarative.[ch]:
Record the value of one of the options controlling retries for the
current invocation of `dd' in a global variable, since the front end
can initiate retries even after the initial retry.
Pass the required option values to retry.
trace/mercury_trace_external.c:
Pass the required option values to retry.
trace/mercury_trace_internal.c:
Implement the new options of the retry, dd and dd_dd commands.
Pass the required option values to retry.
Make "table_io start" and "table_io stop" record the relevant event
numbers in the global variables designed to hold them, for use in
mercury_trace.c in deciding whether a retry is safe.
Make indirect retries (used only in minimal model grades) use only safe
retries.
Make the dd and dd_dd commands use the help system to print usage
messages, now that they are both documented.
To make this possible, make the dd command part of the "misc" category
and the dd_dd command part of the "developer" category, which are the
categories they are documented under in user_guide.texi.
tests/debugger/mdb_command_test.inp:
Update this automatically generated list of commands.
tests/debugger/tabled_read.{inp,exp}:
tests/debugger/tabled_read_decl.{inp,exp}:
Update the retry commands in these tests to use the new options
where relevant.
tests/debugger/declarative/tabled_read_decl.{inp,exp}:
Update the dd commands in these tests to use the new options
where relevant.
|
||
|
|
d9122a1b30 |
Document I/O tabling, after cleaning it up for public use.
Estimated hours taken: 6
Branches: main
Document I/O tabling, after cleaning it up for public use.
We have previously implemented two forms of I/O tabling. One tables
only the output arguments of each primitive; this allows transparent
retries across I/O. The other tables all the arguments and the name
of the predicate; this allows transparent retries across I/O, the
declarative debugging of code that does I/O, and the printing of tabled
I/O actions. Since we now support declarative debugging in the standard
debugging grades, standardize on the second form of I/O tabling, and
make the first form accessible to implementors only, via a deliberately
undocumented option. This option, --trace-table-io-only-retry, is sort of
the inverse of the old option --trace-table-io-decl, which this change
deletes. (Only "sort of" because --trace-table-io-decl used to turn on
I/O tabling, whereas --trace-table-io-only-retry is consulted only if
I/O tabling is turned on by some other mechanism.)
NEWS:
Mention I/O tabling.
compiler/options.m:
Delete --trace-table-io-decl, and add --trace-table-io-only-retry.
Update documentation.
compiler/table_gen.m:
Base decisions on --trace-table-io-only-retry, not
--trace-table-io-decl.
compiler/handle_options.m:
Delete an implication involving --trace-table-io-decl that is now
unnecessary.
doc/user_guide.texi:
Document the idea of I/O tabling, and move the table_io command
out of the list of developer only commands into a category of its own
(since it doesn't naturally fit anywhere else).
Change the old mismatched "table_io start" "table_io end" pair to
the matched "table_io start" "table_io stop" pair.
Document the variants of the print and browse commands that print and
browse I/O actions.
Be consistent about formatting of categories of mdb commands.
Comment out some obsolete material in the documentation of retry.
doc/generate_mdb_doc:
Include the new table_io category in the list of mdb command
categories.
Squeeze out repeated blank lines in the automatically generated
documentation, to make maximum use of screen real estate.
doc/squeeze:
A new script to do the squeezing.
doc/mdb_categories:
Include the new table_io category in the list of mdb command
categories.
runtime/mercury_trace_base.[ch]:
Add a new global variable MR_io_tabling_allowed. It is initialized
to TRUE in debugging grades and FALSE in other grades.
trace/mercury_trace_internal.c:
Accept "table_io begin" and "table_io end" as well as "table_io start"
and "table_io stop". Consistently use "start" and "stop" in output.
Make "table_io" print a message saying the executable is not set up
for I/O tabling unless MR_io_tabling_allowed is set.
Add a new command, "table allow", that sets MR_io_tabling_allowed to
TRUE. In debugging grades, this has no effect. In other grades, it
allows I/O tabling, even though some parts of the program may have
been compiled with --trace-table-io and some without. This
inconsistency can yield weird results, which is why this command is
deliberately undocumented. However, we can use it in a disciplined
fashion to test I/O tabling even in nondebugging grades, thus spotting
any regression in this area more quickly than if we tested I/O tabling
only in debugging grades.
tests/debugger/Mercury.options:
tests/debugger/declarative/Mercury.options:
Delete all occurrences of --trace-table-io-decl, since its effect is
now the default.
tests/debugger/mdb_command_test.inp:
Move the location of the table_io command test in this autogenerated
file to reflect its move to a new category.
tests/debugger/tabled_read*.{inp,exp}:
tests/debugger/declarative/tabled_read*.{inp,exp}:
Execute "table_io allow" before trying to turn on I/O tabling, since
this is now required in non-debugging grades.
Reflect the change in terminology: expect "stopped", not "ended",
|
||
|
|
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. |
||
|
|
07c0cf8ba6 |
Improve variable naming in the debugger. Where possible, use
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. |
||
|
|
13f0e7610a |
A large step towards declarative debugging of goals that do I/O.
Estimated hours taken: 40
Branches: main
A large step towards declarative debugging of goals that do I/O. This step
does everything needed for that except modify the declarative debugger itself;
that is for Mark to do.
If you give the new option --trace-table-io-decl, the transformation performed
by the compiler on I/O primitives will preserve not just the output arguments
of the primitive, so that the primitive can be "reexecuted" without performing
any side-effects, but also the input arguments and the identity of the I/O
primitive itself. The I/O table therefore will contain a list of the I/O
primitives executed by the program after I/O tabling is started.
You can test this via the new debugger commands "print action <action-number>"
and "browse action <action-number>".
The new option is currently not documented, because the declarative debugger
does not yet use the information it provides. The new debugger commands are
not documented because they are meant only for implementors, at least for
now.
Since this change adds a field to proc_layout structures, any workspaces
compiled with debugging enabled will need to do a cvs update when this change
is installed.
compiler/options.m:
Add the option --trace-table-io-decl. When set, this causes the
compiler to transform I/O action primitives to allow declarative
debugging of I/O actions.
compiler/handle_options.m:
Make --trace-table-io-decl imply --trace-table-io.
compiler/table_gen.m:
Perform the transformation, which is similar to the existing
--trace-table-io transformation, but preserves the identity of all
non-io-state arguments (not just the outputs) and the identity
of the I/O primitive itself.
Provide better names for variables generated by tabling
transformations.
compiler/hlds_goal.m:
Add extra parameters to procedures whose job it is to create new
goals to name the variables in those goals.
compiler/layout.m:
Add a new layout structure to contain the information the runtime
system needs to interpret the information saved by the new
transformation.
compiler/layout_out.m:
Output the new layout structure.
compiler/continuation_info.m:
Add a field to proc_layouts to point to the declarative I/O tabling
structure, and another to identify the proc_layout without using LLDS
types.
compiler/code_gen.m:
Provide the definition of this field when appropriate.
compiler/hlds_pred.m:
Add a field to proc_infos to store the information from the tabling
transformation until code generation.
compiler/stack_layout.m:
Add a mechanism for transforming the high level description of I/O
action tabling data in proc_infos to the low level description we need
to generate C data structures.
compiler/hlds_data.m:
Add a new cons_id and a new cons_tag; they are used to refer to I/O
tabling structures in code generated by the new transformation.
compiler/*.m:
Handle the updates to global data types above.
library/table_builtin.m:
Modernize some old code.
Fix an old off-by-one error: make I/O tabling use the first slot
in the I/O action table.
library/varset.m:
Add a mechanism for creating a variable that is named iff the caller
has a name for it.
runtime/mercury_layout_util.[ch]:
Add a function for materializing type parameters from an answer block,
not from registers or a closure.
runtime/mercury_stack_layout.h:
Declare a C type for the data structure holding information about
I/O primitives transformed by --trace-table-io-decl, and add a field
to proc_layout structures to point to these new structures.
Add a new evaluation method for --trace-table-io-decl.
runtime/mercury_tabling_macros.h:
Add some conditionally-compiled debugging code to the primitive for
saving answers.
trace/mercury_trace_vars.[ch]:
Add functions for printing I/O action goals.
trace/mercury_trace_internal.c:
Add code for recognizing and implementing commands to print I/O
action goals.
trace/mercury_trace.c:
Add code for handling the new eval method.
tests/debugger/tabled_read.{m,inp,exp*}:
Add a polymorphic I/O action primitive, add calls to it, and test
the printing of both monomorphic and polymorphic action goals.
tests/debugger/tabled_read_decl.{m,inp,exp*,data}:
A new test case. It does the same things as the new version of
tabled_read, but it is compiled with --trace-table-io-decl, not
just --trace-table-io. It therefore can (and does) test the printing
of tabled I/O actions.
tests/debugger/Mmakefile:
Add the new test case.
|
||
|
|
ebe9f9a3ec |
Add tabling of I/O actions for the debugger.
Estimated hours taken: 80
Add tabling of I/O actions for the debugger.
compiler/options.m:
Add a new option, --trace-table-io, that enables the tabling of I/O
actions, and another, --trace-table-io-states, that governs whether the
tabling includes the I/O state variables themselves. (You want to table
these variables iff they contain meaningful information that is not
stored in global variables.) These options are for developers only
for now.
compiler/modules.m:
Implicitly import table_builtin if --trace-table-io is specified.
compiler/prog_data.m:
Add eval_table_io as a new eval method.
compiler/hlds_pred.m:
Add a mechanism for checking whether a predicate has an input/output
pair of io__state args.
Extend the tables indexed by eval_method to handle eval_table_io.
compiler/hlds_out.m:
Print the eval method in HLDS dumps.
compiler/table_gen.m:
If a procedure has a pair of I/O state args and is defined using pragma
C code that has the tabled_for_io marker, and --trace-table-io is
specified, then perform I/O tabling on it and mark it as tabled.
compiler/notes/compiler_design.m:
Document that table_gen.m can now change the evaluation methods of
procedures (to eval_table_io).
compiler/stack_layout.m:
runtime/mercury_stack_layout.h:
Add an extra field to proc layouts. If debugging is enabled and a
procedure has I/O state arguments, this field gives the number of the
stack slot which will be filled with the I/O action counter at the
time of the call, so that on retry the debugger can reset the I/O
action counter to this value.
compiler/trace.m:
Add code to reserve and fill this stack slot.
Make the order of fields in the trace_slots structure match the order
in proc layouts.
compiler/code_info.m:
compiler/live_vars.m:
Pass a module_info to trace__setup and trace__reserved_slots.
library/io.m:
Mark the I/O primitives (i.e. procedures that are defined by pragma C
code and do I/O) with the tabled_for_io feature. (See the discussion
of I/O primitives in compiler/table_gen.m.)
Standardize the formatting of predicates defined by pragma C codes.
library/table_builtin.m:
Define the predicates that perform I/O tabling, to which calls are
inserted in I/O tabled predicates. These depend on knowing what the
maximum MR_Unsigned value is.
library/table_builtin.m:
runtime/mercury_tabling_macros.h:
Table nodes implementing a simple kind of trie, which can also be
viewed as a hash table with the hash function hash(n) = hash - start
were already supported by mercury_tabling.c. They are used to
implement I/O tabling, since I/O the tabled action numbers form a
contiguous sequence. Now allow that functionality to be accessed
from the library through macros.
runtime/mercury_trace_base.[ch]:
Add the global variables required by I/O tabling.
trace/mercury_trace.c:
Implement retry across I/O by resetting the I/O counter to the value
it had on entry to the retried call. However, since this is not safe
in general, ask the user for permission first.
trace/mercury_trace.h:
Add two extra arguments to MR_trace_retry to specify the input and
output streams on which to ask permission.
trace/mercury_trace_internal.c:
Add commands to start and stop I/O tabling. For now, they are for use
by developers only and are undocumented; I expect they will change
significantly before being let loose on users.
trace/mercury_trace_external.c:
trace/mercury_trace_declarative.c:
Pass extra arguments to MR_trace_retry to indicate that these modules
are not interested (at least for now) in retry across I/O, since they
do not (yet) have mechanisms for asking the user for permission.
tests/debugger/tabled_read.{m,inp,exp,data}:
A new test case to check retry across tabled and non-tabled I/O.
tests/debugger/Mmakefile:
Enable the new test case.
|