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
commitda264d84bf8c3eca44f61adb63d0d6bac123f135 (patch)
tree7f34263839ddf45ae5a0ab1da222f8f8db8928e4 /doc
parentdf485d0fae4725d872bc6d7be0b1cc91227d88e1 (diff)
downloadmdk-da264d84bf8c3eca44f61adb63d0d6bac123f135.tar.gz
mdk-da264d84bf8c3eca44f61adb63d0d6bac123f135.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}).