mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-18 02:43:40 +00:00
The usual mdb "dump" command puts every function symbol on its own line.
This guarantees that we generate any line that is too long to be displayed
on terminals, but it also generates output that is too stretched out
vertically for its structure to be readily apparent. Dumping the term
as a doc allows pretty_printer.m to put as many function symbols on a line
as would fit, without exceeding the maximum line length.
browser/browse.m:
Add save_term_to_file_doc, a way to save a (possibly synthetic)
browser term in a file, using an interface that works the same way
the predicate that saves browser terms as XML.
Inline a predicate at its only call site. Improve variable names.
trace/mercury_trace_browse.[ch]:
Add MR_trace_save_term_as_doc, as an interface function between
save_term_to_file_doc and the code of mercury_trace_cmd_browsing.c.
trace/mercury_trace_cmd_browsing.c:
Add support for a new -p/--prettyprint flag to the mdb "dump" command,
which asks for the given term to be dumped as a pretty_printer doc.
doc/user_guide.texi:
NEWS:
Document the new option.
library/pretty_printer.m:
NEWS:
Rename write_as_doc to write_doc_formatted, and fix its argument type.
tests/debugger/browser_test.inp:
Dump a term that we already dumped with "dump" with "dump -x" and
"dump -p" as well.
tests/debugger/browser_test.m:
Put the code to remove the files we are going to dump to
and then later to print the files we have dumped to into separate
predicates. This keeps most (but not all) line numbers unchanged
even though we now dump to more files.
tests/debugger/browser_test.exp3:
Update this file to account both for the extra output from the just-added
dump commands, and for the changes in line numbers.
62 lines
730 B
Plaintext
62 lines
730 B
Plaintext
echo on
|
|
register --quiet
|
|
list_context_lines 10
|
|
break big_data
|
|
continue
|
|
finish
|
|
delete *
|
|
dump -q 1 browser_test.save.1
|
|
format raw_pretty
|
|
print *
|
|
format -A verbose
|
|
print *
|
|
browse 1; ls; quit
|
|
format -AP flat
|
|
print -f 1
|
|
print -p 1
|
|
print -v 1
|
|
print -r 1
|
|
print --xyzzy 1
|
|
browse 1; print; quit
|
|
browse -f 1; ls; quit
|
|
browse Data
|
|
ls
|
|
cd /1
|
|
ls
|
|
cd /1/2
|
|
ls
|
|
cd /3
|
|
ls
|
|
cd 1/3/2
|
|
ls
|
|
cd
|
|
ls
|
|
cdr 100 2
|
|
cdr 3 1
|
|
ls
|
|
cdr 3 ../1/..
|
|
ls
|
|
quit
|
|
format_param -A -f depth 1
|
|
print *
|
|
print Data/1
|
|
format_param -f depth 3
|
|
print 1
|
|
print Data/1/2
|
|
print 1^1^2^3
|
|
retry
|
|
break list_data
|
|
continue
|
|
finish
|
|
dump Data browser_test.save.2
|
|
dump -x Data browser_test.save.3
|
|
dump -p Data browser_test.save.4
|
|
break a_func
|
|
continue
|
|
finish
|
|
print -p
|
|
print -r
|
|
print -v
|
|
print -f
|
|
continue
|