On Wednesday, July 21, 2021 at 11:12:09 AM UTC-7, Andrew Roughan wrote:
> I have set BPX $4938 and debugger is entered when this address is reached.
> I have some patch code loaded in memory at $8e00 and so I execute that with
> The patch code overwrites content of 4938 and several more locations and
The debugger G command behaves differently then what you are are expecting. It comes in 2 forms:
* ####G does NOT enable breakpoints.
* You must use G <addr> if you want it to stop at that address
i.e. It runs until THAT address is triggered. It ignores other breakpoints.
If you type HELP G or HELP GG the debugger will print off these instructions:
G, Run at normal speed [until PC == address]
G, Run at full speed [until PC == address]
Here is a small demo:
300:A9 C1 8D 00 04 60
310:4C 00 00
The first BP @ $300 is hit as expected.
If use G to continue the second BP @ $305 will be triggered.
Finally, one more G to exit.
If you then re-trigger the original breakpoint via ...
... but this time we use 300G the 2nd BP @ $305 will NOT be triggered. You must re-enter the debugger to re-enable breakpoints.
Thus for your code, when your BP @ $4938 is hit and you want to execute the code at $8E00 and re-hit the BP at $4938 you must use change the PC first and THEN use G.
R PC 8E00
Then the breakpoint of $4938 will be hit again.
Also, if you want your breakpoints to be hit, normally it is better to use <F7> to exit the debugger then to use G.
Lastly, you'll probably want to examine the source code for the CmdGo()
Hope this helps.