summaryrefslogtreecommitdiffhomepage
path: root/doc
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2001-07-22 21:08:38 +0000
committerJose Antonio Ortega Ruiz <jao@gnu.org>2001-07-22 21:08:38 +0000
commitdd2730739c3c1204ecee97aa936e84ad0f7c5b08 (patch)
tree8ae0e030e9884c144ed396f28f1b8acdd0a00c99 /doc
parent4b003474d25aa79508f392ea16533b738896856d (diff)
downloadmdk-dd2730739c3c1204ecee97aa936e84ad0f7c5b08.tar.gz
mdk-dd2730739c3c1204ecee97aa936e84ad0f7c5b08.tar.bz2
version 0.4
Diffstat (limited to 'doc')
-rw-r--r--doc/mdk_gstart.texi3
-rw-r--r--doc/mdk_mixvm.texi47
2 files changed, 49 insertions, 1 deletions
diff --git a/doc/mdk_gstart.texi b/doc/mdk_gstart.texi
index 25764a0..70ded05 100644
--- a/doc/mdk_gstart.texi
+++ b/doc/mdk_gstart.texi
@@ -445,6 +445,7 @@ MIX >
@end example
Other useful commands for debugging are @code{tracing} (which turns on
-tracing of executed intructions) and @code{weval} (which evaluates
+tracing of executed intructions), @code{pbt} (which prints a backtrace
+of executed instructions) and @code{weval} (which evaluates
w-expressions on the fly). For a complete description of all available
MIX commands, @xref{mixvm}.
diff --git a/doc/mdk_mixvm.texi b/doc/mdk_mixvm.texi
index f5538cd..480abbc 100644
--- a/doc/mdk_mixvm.texi
+++ b/doc/mdk_mixvm.texi
@@ -373,6 +373,53 @@ actual MIXAL code that was compiled into the executed instruction. The
tracing behaviour is stored as a configuration parameter in @file{~/.mdk}.
@end deffn
+@deffn {debug command} pbt [INS_NUMBER]
+This command prints a backtrace of executed instructions. Its optional
+argument @var{ins_number} is the number of instructions to print. If it
+is omitted or equals zero, all executed instructions are printed. For
+instance, if you compile and load the following program (@file{bt.mixal}):
+
+@example
+ ORIG 0
+BEG JMP *+1
+ JMP *+1
+FOO JMP BAR
+BAR HLT
+ END BEG
+@end example
+
+@noindent
+you could get the following traces:
+
+@example
+MIX > load bt
+Program loaded. Start address: 0
+MIX > next
+MIX > pbt
+#0 BEG in bt.mixal:2
+MIX > next
+MIX > pbt
+#0 1 in bt.mixal:3
+#1 BEG in bt.mixal:2
+MIX > run
+Running ...
+... done
+MIX > pbt 3
+#0 BAR in bt.mixal:5
+#1 FOO in bt.mixal:4
+#2 1 in bt.mixal:3
+MIX > pbt
+#0 BAR in bt.mixal:5
+#1 FOO in bt.mixal:4
+#2 1 in bt.mixal:3
+#3 BEG in bt.mixal:2
+MIX >
+@end example
+
+Note that the executed instruction trace gives you the label of the
+executed line or, if it has no label, the its address.
+@end deffn
+
As you have probably observed, @code{mixvm} prints timing statistics
when running programs. This behaviour can be controlled using the
@code{timing} command (@pxref{Configuration commands}).