asar icon indicating copy to clipboard operation
asar copied to clipboard

[Feature Request] warnpc-like command that emits error if pc != address

Open VitorVilela7 opened this issue 4 years ago • 1 comments
trafficstars

warnpc is a pretty useful command but I noticed almost all of the times when I write a patch I not just have to ensure the code is not larger than the original block but I also have to ensure that the code is not smaller than the original code block, since the routine must have to continue after my patched code. However there is no such command on Asar and currently I must try-and-error with print pc until I get the ideal pc value that is not less than the address nor more than the address.

A suggestion would be assertpc $XXXXXX

I tried assert pc == $address but that is not accepted on asar, I assume the statement is evaluated on earlier passes.

VitorVilela7 avatar Dec 21 '20 05:12 VitorVilela7

i think this was discussed on discord too, but basically, the next release will allow assert label == $xxxxxx. i personally think that's good enough for this use case, but if you really want i guess it wouldn't hurt to make a special "pc" label that's usable in assert commands

trillllian avatar Jan 16 '21 21:01 trillllian

made assert pc() == $xxxxxx work, and deprecated warnpc in favor of assert pc() <= $xxxxxx.

trillllian avatar Jan 27 '24 01:01 trillllian