Re: [stella] Stella Debugger RFC

Subject: Re: [stella] Stella Debugger RFC
From: Erik Mooney <erik@xxxxxxxxxx>
Date: Wed, 15 Jun 2005 03:17:45 -0400
On Mon Jun 13 10:03 , 'B. Watson' <atari@xxxxxxxxxxxxxx> sent:

>Can anyone think of a better way to implement this? Should I be watching
>the stack pointer instead? Or should I actually be looking for an RTS
>instruction, maybe?

Why not have the trace execution stop upon reaching _either_ the target
PC or an RTS instruction?  Neither method by itself is foolproof.  There's
a few code cases where a subroutine modifies its return address on the
stack which would miss your target PC.  And looking for an RTS isn't 100%
reliable either as some subroutines manually reset the stack pointer then
JMP or Bxx based on a known flag (sometimes this can be faster than RTS.)

But if you look for either, it should be reliable in all but the most
spaghetti code structures.  RTS really doesn't have any application for
2600 programming besides its stated use; the only real exception is certain
methods of bankswitching, and I'd argue that a trace command should stop and
wait for user input upon such an unusual circumstance.

Of course, the ultimate solution would be to let the user choose (either
via configuration or by issuing different commands like Shift-T or something)
any combination of RTS or target PC or target stack pointer.

- Erik
Archives (includes files) at
Unsub & more at

Current Thread