Adds the following features:
1) Configure.pl --debugging sets a 'DEBUGGING' flag in the C source.
2) test_prog -d -- Runs the program in debug mode.
All debugging code is surrounded by #ifdef DEBUGGING/#endif, so no
performance penalty is incurred by adding this patch. Debugging code is
completely optional.
The debugger supports the following basic commands:
'h' - Help
'q' - Quit debugger, stop running the interpreter
'r' - Run the interpreter until the program ends
's' - Single-step the program
'x' - Examine register ('x I0' returns the value in I0)
'x pc' - Examine the program counter
'I0 = 5' - Set the value of register I0 to 5
'N3 = 3.5' - Set the value of register N3 to 5
'S5 = A long string with no quotes' - Set the value of S5 to 'A long
string with no quotes'
I haven't explored the PMC code, so 'x P9' returns a warning saying it's
not implemented.
When assigning to string registers there's no way to enter the string
encoding to use.
However, it's a start. Despite the large diff file, most of the code is
isolated into debug.c.
Upcoming features include:
More error detection
Set breakpoint
Set variable watch
Reset program counter
--Jeff
<jgoff@speakeasy.net>