[M3devel] Internal debugging - a simple design
Hendrik Boom
hendrik at topoi.pooq.com
Wed Apr 3 04:51:15 CEST 2013
On Wed, Apr 03, 2013 at 12:45:23AM +0000, Jay K wrote:
> Again, though, I don't want to change and recompile anything to debug.
Then an interpreter could be your friend.
> The idea is to debug w/o source and compiler.But it is a slippery
> slope. Full "internal debugging" puts "almost" the source in the
> executable.Is source absent because it is secret? or large? Or always
> present?
The old Algol W compiler on the IBM 360 could be asked to place a
trimmed-down copy of the source code somewhere (in memory if I recall
correctly). It would contain bytecodes for reserved words and
operators, indexes into a symbol table for identifiers, and the like.
Then every time execution would enter a basic block, it would increment
a counter -- one counter for each basic block. When execution finished,
it would prepare a printout, expanding all those brief byte codes and
indices, indenting properly, and printing the count beside the start of
every basic block. I would debug from this listing and suppress the
usual source-code listing. This count-annotated listing was much more
useful.
-- hendrik
More information about the M3devel
mailing list