Mark Tapley wrote:
At 12:00 -0500
8/27/13, Jerome Fine wrote:
Are there any suggestions as to how many
previous
instructions are needed to usually be helpful to have a
log for when a program has a problem?
Jerome,
hopefully you'll get much better-qualified answers than mine; I
have little to no experience programming assembly or PDP-11. That
said, I can think of a few possible answers:
1) enough instructions that any timing-critical loop will be captured
when an external interrupt dropping into the debugger is generated.
This might be relatively short - 200 instructions or so? User (not
necessarily programmer?) would set up and start a long calculation
(mandelbrot set, whatever) and then hit "break", and be able to look
back far enough to verify that the correct sequence of instructions is
repeating over and over.
For actual number, maybe look at the longest loop in RT-11 that
repeats many times successively?
2) enough instructions that any timing-critical *subroutine" will be
captured when dropping into the debugger.
This would be a *lot* more, depending on application. In this
case, the programmer would add a break point to the code right after
the timing-critical routine (disk access, real-time control interrupt
service routine, whatever) and then look back at the buffer to verify
that the whole routine took the correct execution path. For disk
access, that might be a *lot* of loops, though, so maybe you are only
capable of writing a buffer to hold the last few iterations?
For actual number, look at the longest single executable code unit
in RT-11?
3) Configurable depth, configured at launch time for debugger
Programmer gets to make the trade between debugger buffer depth
and available memory for his program.
Fortunately, when the code is already executing in user mode,
interrupts which execute in kernel mode are not normally noticed
by the debugger. In that same category are calls to the operating
system. Consequently, the only instructions whose addresses are
logged are those which execute in user mode.
However, I have yet to test what happens when operating system
code is being debugged. I am fairly confident that most of the
same sort of things are also ignored due to the way in which the
trace bit operates in the PDP-11.
The original reason that I started this project was to reduce the
Low Memory used by SD: under a Mapped RT-11 Monitor.
However, just as I was finishing another project, I found an
endless loop in a program when a branch was taken to a
misspelled label. Having a history log would have helped find
the mistake much more quickly.
Note that the overhead of logging each instruction address
is not small. It probably takes (I must do a count to figure
it out) between 50 and 100 instructions. But even on a
real PDP-11, that should not be much of a problem.
Not sure any of this is helpful, and you probably
have thought of
it anyway.
Some, but not all. THANK YOU for your suggestions.
Jerome Fine