develooper Front page | perl.perl6.internals | Postings from October 2001

[PATCHES] Primitive debugger

From:
Jeff
Date:
October 28, 2001 20:38
Subject:
[PATCHES] Primitive debugger
Message ID:
3BDCDD47.3EE5BCD7@speakeasy.net
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>





nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About