asar
asar copied to clipboard
[Feature Request] warnpc-like command that emits error if pc != address
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.
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
made assert pc() == $xxxxxx work, and deprecated warnpc in favor of assert pc() <= $xxxxxx.