From dd2730739c3c1204ecee97aa936e84ad0f7c5b08 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sun, 22 Jul 2001 21:08:38 +0000 Subject: version 0.4 --- doc/mdk_gstart.texi | 3 ++- doc/mdk_mixvm.texi | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) (limited to 'doc') 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}). -- cgit v1.2.3