Maybe this is the better thread for all smc points here, as my old thread: ;
https://eab.abime.net/showthread.php?t=107367
Basically the smc works, but it could be tidied up a bit here too. Or am I missing something crucial?
smc [<0-1>] Enable self-modifying code detector. 1 = enable break. This helptext would implified:
smc ; without option ?
smc 0 ; smc disable break
smc 1 ; smc enable break
Code:
But in function it is:
>smc
SMCD disabled
>smc 0
SMCD enabled. Break=0. Last address=01000000
>smc 1
SMCD disabled
>smc 1
SMCD enabled. Break=1. Last address=01000000
>smc 1
SMCD disabled
>smc
SMCD enabled. Break=0. Last address=01000000
>smc
SMCD disabled
>
Why we have two Breaks? Better would be:
only smc as a enable/disable toggle command without 0-1 --> smc Enable/Disable self-modifying code detector
>smc
SMCD enabled. Last address=01000000
>smc
SMCD disabled
>
Is the information 'Last address=01000000' helpful?
The smc needs a memwatch breakpoint: "You need to add "dummy" memwatch range, for example "w 0 0 80000 none" if code is in chip ram."
Is it possible to set this memwatch breakpoint automatically as default and to give out the actual setting info by smc enabling?
>smc
SMCD enabled. Last address=01000000
0: 00000000 - 0007FFFF (524288) RWI NONE
The first triggered breakpoint, seems to be always a 'false breakpoint'
Code:
>smc
SMCD enabled. Break=0. Last address=01000000
>g
SMC at 000236A6 - 000236AA (4) from 00000000 ; wrong from 00000000
Breakpoint 0 triggered. ; wrong message, because it's not a program breakpoint
>g ; All others after that are fine.
SMC at 000236B0 - 000236B1 (1) from 000236B6 ; correct
Breakpoint 0 triggered. ; but wrong message it is not a program breakpoint
;--------------------------------------------
>smc
SMCD disabled
>smc 1
SMCD enabled. Break=1. Last address=01000000
>g
SMC at 000236A6 - 000236AA (4) from 00000000 ; wrong from 00000000
>g
SMC at 000236B0 - 000236B1 (1) from 000236B6 ; correct
>g
Breakpoint 0 triggered. ; correct (normal program breakpoint)
>g
SMC at 000236B0 - 000236B1 (1) from 000236B6 ; correct
;--------------------------------------------
>smc 1
SMCD disabled
>smc 0
SMCD enabled. Break=0. Last address=01000000
>g
SMC at 000236A6 - 000236B2 (12) from 00000000 ; wrong from 00000000
Breakpoint 0 triggered. ; wrong message is not a program breakpoint
>g
Breakpoint 0 triggered. ; correct (it's a normal program breakpoint)
>g
SMC at 000236B0 - 000236B1 (1) from 000236B6
Breakpoint 0 triggered. ; wrong message it is not a program breakpoint