Commit Graph

5 Commits

Author SHA1 Message Date
Zoltan Somogyi
7822554732 Replace __ with . as the module qualifier everywhere in all the modules
Estimated hours taken: 2
Branches: main

browser/*.m:
	Replace __ with . as the module qualifier everywhere in all the modules
	of the browser directory. Convert the currently tab-indented modules
	to four-space indentation. Delete some unnecessary module
	qualifications. Change some type names and function symbols to avoid
	ambiguities. Replace a bunch of uses of DCGs with state variable
	notation.
2006-03-10 06:31:06 +00:00
Zoltan Somogyi
83f8deb354 Add two new command line tools "mslice" and "mdice", which manipulate slices
Estimated hours taken: 24
Branches: main

Add two new command line tools "mslice" and "mdice", which manipulate slices
and dices respectively. The functionality of "mdice" duplicates the
functionality of mdb's current "dice" command, while the functionality of
"mslice" is new.

runtime/mercury_trace_base.[ch]:
	When generating trace count files, include information about the
	context of each execution count. While mdb has access to this
	information in the running program, mslice and mdice do not.
	In any case, the code in mdb for looking up this information was
	terribly inefficient.

	Provide a mechanism for recording all execution counts, even the zero
	ones, for use in coverage testing. This mechanism is not used yet.

	Put a header on trace counts files, to make them recognizable as such.
	Make this header indicate whether we are including zero trace counts.

runtime/mercury_wrapper.c:
	Provide a flag in MERCURY_OPTIONS for turning on recording of
	zero execution counts.

browser/dice.m:
mdbcomp/slice_and_dice.m:
	Move most of the code of browser/dice.m to mdbcomp/slice_and_dice.m,
	much modified; browser/dice.m is now empty. The modifications are
	as follows.

	Factor out the code for reading dices, since dices are useful
	independent of mdb's dice command.

	Generalize the code for computing dices to allow either or both
	of the slices being subtracted to be specified as the union of
	one or more trace counts files.

	Add two more sort conditions for comparing the execution counts
	in two slices: ascending and descending versions of simple execution
	count differences.

	For each operation we have so far performed on dices, add code
	for performing that operation on slices.

browser/mdb.m:
	Delete the include of dice.m, since it is now empty.

	Delete a duplicate include_module of term_rep, and delete the now
	unnecessary include_modules of set_cc and tree234_cc.

mdbcomp/mdbcomp.m:
	Add slice_and_dice.m as a submodule.

mdbcomp/trace_counts.m:
	Provide a mechanism to allow a slice to be specified as coming not
	from a single trace count file but from the union operation on a set
	of trace count files.

	Convert to four-space indentation to eliminate some excessively
	indented lines.

slice/mdice.m:
slice/mslice.m:
	The main modules of two new commands. Their functionality is almost
	entirely in mdbcomp/slice_and_dice.m and mdbcomp/trace_counts.m.

slice/Mmakefile:
	New Mmakefile for building mslice and mdice. It is modelled on
	profiler/Mmakefile.

slice/Mercury.options:
	Empty file, for use in the future.

slice/.nocopyright:
	Don't require copyright notice in Mercury.options.

Mmakefile:
	Process the slice directory at appropriate points when processing
	other directories.

compiler/tupling.m:
	Conform to the updated interface of mdbcomp/trace_counts.

library/list.m:
	Add versions of list__map for some more arities, for use in the code
	above.

trace/mercury_trace_internal.c:
	Generalize the code for specifying dices to allow either or both
	of the slices being subtracted to be specified as the union of
	one or more trace counts files.

	Fix several places where we weren't checking the return value of
	malloc. Fix two places where we could conceivably free strings that
	were still alive. Fix some places where we could pass NULL strings
	to Mercury code, and some places where we could free NULL pointers
	(which, once upon a time, was not guaranteed to work on all platforms).

	Use existing functions such as MR_copy_string where appropriate.

tests/run_one_test:
	Fix two small bugs in this script: make the filenames more user
	friendly, and make sure that gzip isn't asked to overwrite an
	existing file, since that causes it to ask a question on stdout
	and to wait for an answer.

tools/bootcheck:
	Copy or link the slice directory into stage 2. Rename the
	--copy-profiler option as --copy-profilers, since it now copies three
	directories containing performance engineering tools: profiler,
	deep_profiler and slice.
2005-04-29 01:03:29 +00:00
Ian MacLarty
1a708a0ccc Add a new declarative debugger response, `info', which shows some information
Estimated hours taken: 6
Branches: main

Add a new declarative debugger response, `info', which shows some information
about the current question and the state of the bug search.

browser/declarative_analyser.m
	Add the show_info predicate.

browser/declarative_debugger.m
	Handle the oracle show_info response.

browser/declarative_edt.m
	Add a new method to the mercury_edt typeclass, edt_context,
	which returns the filename and line number of the predicate for
	a node.

browser/declarative_execution.m
	Instead of recording the goal path of a call in its parent, record
	the return label.  The goal path and the parent context can then
	be derived from the return label.

	Add a function to get the goal path from a return label.

	Add a function to get the context of a label.

	Modify the exported predicates used to build the annotated trace
	to take a return label instead of the goal path.

browser/declarative_oracle.m
	Add a `show_info' oracle response.

browser/declarative_tree.m
	Implement trace_context which returns the filename and line number
	of the predicate that corresponds with a node in the annotated trace.

	Derive a call's goal path in its caller from the return label where
	necessary.

browser/declarative_user.m
	Add and document the user response `info'.

browser/dice.m
	Fix a line that was over 79 characters.

doc/user_guide.texi
	Document the info command.

	Say that the --resume option can be used to resume an aborted or pd'd
	session.

tests/debugger/declarative/Mmakefile
tests/debugger/declarative/info.exp
tests/debugger/declarative/info.inp
tests/debugger/declarative/info.m
	Test the new response.

trace/mercury_trace_declarative.c
	Pass the return label when constructing the annotated trace.
2005-03-12 04:46:33 +00:00
Ian MacLarty
3bded6235e Add a --module option to the mdb dice command to limit output to a specific
Estimated hours taken: 6
Branches: main

Add a --module option to the mdb dice command to limit output to a specific
module or package.

Write out the trace counts even if the program aborts because of an uncaught
exception.

browser/dice.m
	Handle the --module option by adding an extra argument to the
	read_dice_to_string predicate which is called from mdb.

doc/user_guide.texi
	Document the --module option.

mdbcomp/prim_data.m
	Add a predicate to check if one module is a sub-module of another.

runtime/mercury_trace_base.c
runtime/mercury_trace_base.h
	Add a function which writes the trace counts out to the file
	indicated by the symbolic constant MERCURY_TRACE_COUNTS_FILE_NAME.

	Move the symbolic constant MERCURY_TRACE_COUNTS_FILE_NAME from
	runtime/mercury_wrapper.c to runtime/mercury_trace_base.h, so it
	is accessible from the above function.

runtime/mercury_wrapper.c
	Register a function to write the trace counts to a file when the
	program aborts because of an uncaught exception.

	Call the same function when the program terminates normally.

tests/debugger/dice.exp
tests/debugger/dice.inp
	Test the new --module option.

trace/mercury_trace_internal.c
	Add and handle the new --module option.
2005-02-18 04:05:35 +00:00
Ian MacLarty
b5550df746 Add mdb `dice' command which reads in a set of passing trace counts and a
Estimated hours taken: 40
Branches: main

Add mdb `dice' command which reads in a set of passing trace counts and a
failing trace count and prints a comparison table.  The table can be sorted
by various metrics and is useful for finding parts of a program executed in
a failing run, but not in passing runs.

browser/dice.m
	Add a new module for generating and manipulating a dice.

browser/mdb.m
	Add the dice module.

compiler/special_pred.m
mdbcomp/prim_data.m
	Move special_pred_name_arity/3 from compiler/special_pred.m to
	mdbcomp/prim_data.m so it can be used in dice.m.

doc/user_guide.texi
	Document the `dice' mdb command.  Also document the fact that the
	failing and passing slice file names can be set with the `set' mdb
	command.

	Move the `set' command to the misc section from the browser section
	since it now also sets the passing and failing slice file names, which
	have nothing to do with the browser.

library/list.m
	Add map4, map5 and map6 since map6 is needed in dice.m.

mdbcomp/program_representation.m
	Add a predicate to convert a goal path to a string.

mdbcomp/trace_counts.m
	Convert string_to_trace_port into a predicate and add a new mode so
	that a port can be converted back to a string.

runtime/mercury_trace_base.h
trace/mercury_trace_util.h
	Move the MR_TRACE_USE_HP and MR_TRACE_CALL_MERCURY macros to
	runtime/mercury_trace_base.h, so that they can be called from
	browser/dice.m.

tests/Mmake.common
	Clean up trace counts (which are generated to test the `dice' command).

tests/debugger/Mmakefile
tests/debugger/dice.exp
tests/debugger/dice.exp2
tests/debugger/dice.inp
tests/debugger/dice.m
tests/debugger/dice.passes
	Test the `dice' command.

trace/mercury_trace_internal.c
	Add the mdb `dice' command and modify the `set' command so the
	`fail_trace_count' and `pass_trace_counts' parameters can be set.

	Add a function to print a dice.

	Move the `set' command to the misc help section.
2005-02-10 04:10:33 +00:00