Files
mercury/scripts/mdb_open
Ian MacLarty 2ece43e394 Add a new mdb command, 'shell', that allows users to execute shell commands
Estimated hours taken: 5
Branches: main

Add a new mdb command, 'shell', that allows users to execute shell commands
from within the debugger.

Allow the user to give up to nine additional arguments to the 'source' command.
Occurrences of the strings "$1" through "$9" in the sourced file are replaced
by the corresponding additional arguments, allowing for parameterised scripts.

Use the two new features mentioned above to add two more mdb commands: one
to open a term, goal or exception in an external editor another command
to perform a grep on a term, goal or exception (useful for seeing if a value
occurs in a big map, for example).

NEWS
	Mention the new commands.

doc/mdb_categories:
doc/user_guide.texi:
	Document the new commands.

scripts/Mmakefile:
scripts/mdb_open:
scripts/mdb_vim:
	Add scripts for the new commands.

scripts/mdbrc.in:
	Add aliases for the new shell, emacs, grep and vim commands.

tests/debugger/completion.exp:
tests/debugger/mdb_command_test.inp:
	Adjust for new commands.

tests/debugger/save.exp:
tests/debugger/save.exp2:
	Adjust for new commands.  Replace system dependent strings
	with ZZZ instead of XXX.

tests/debugger/Mmakefile:
tests/debugger/shell.exp:
tests/debugger/shell.inp:
tests/debugger/shell.m:
tests/debugger/shell_test_script:
	Test the shell and source commands.

trace/mercury_trace_cmd_misc.c:
	Check if there are extra arguments to the source mdb command
	and pass them to MR_trace_source if there are.

trace/mercury_trace_cmd_misc.h:
	Add shell command handling function prototype.

trace/mercury_trace_declarative.c:
	Call MR_trace_call_system_display_error_on_failure instead
	of system when displaying benchmarking statistics for the
	declarative debugger.

trace/mercury_trace_internal.c:
trace/mercury_trace_internal.h:
	Implement the shell command and extend the source command
	to handle the optional extra arguments.

trace/mercury_trace_readline.c:
trace/mercury_trace_readline.h:
	Add a new function to read a line and replace all the
	occurrences of "$[1-9]" with the corresponding value from an array.

	Delete comments in the .c file that are duplicated in the .h file.

trace/mercury_trace_util.c:
trace/mercury_trace_util.h:
	Implement MR_trace_call_system_display_error_on_failure that
	executes a system call and displays an error message if the system
	call terminates abnormally.
2006-06-13 09:49:04 +00:00

4 lines
86 B
Plaintext

save_to_file $1 .mdb_open_tmp
shell ${EDITOR-vi} .mdb_open_tmp
shell rm .mdb_open_tmp