This is one of the first steps to improve analysis. This way we'll have
one single place to change if we want to change the meaning of the
"size" field. (size -> realsize)
* Add archinfo details
* Add register profile details
* Show jump delay analysis - allows writing regression tests
* Fix decoded size of four-byte NOP
* Fix bugs found writing regresion tests:
** Jumps are not relative
** cut-and-paste error with some calls
* mark an illegal load destination
* Remove special case for the ignored aa field in load
* Factor mode_zz handing into its own function
The rewrite the ARCompact analyser code started because I noticed that the
older code was really not decoding the binary I was working on properly.
Specific things that I noticed were:
* Scrolling backwards scrolled forwards
* Jump targets were shown from apparently random opcodes
* Analysis really didnt find anything
* The anal code was essentially hardcoded for big endian targets (and mine
was not, so instruction decoding was largely misfiring)
I read the ARCompactISA Programmers Reference guide and implemented decoding
for most instructions. Specifically, I ensured that all the instructions that
had limm data were decoded with the correct length and that all the jump or
branch targets were correctly calculated.
As I have not previously looked at anal plugins before, I expect I have
messed up a bunch of the assumptions that the anal system makes.
Among the issues that I still have is that the analysis will find
instructions (and thus xrefs, functions, etc) in "unaligned" locations.
This might just be an artifact of the fact that not all my data is marked
as data, but it feels like there might be something I have missed.
Still remaining TODO are most of the 32bit general purpose instructions.
* BUG: missing break in switch
* Implement missing general instructions in ARCompact anal
* Only set op->fail on jump instructions for ARCompact
* ARCompact: analyse calculated pointers and immediate values in load/store/move instructions
* Address styleguide issues
* Remove unnecessary brackets
* Use standard endian swapping functions
* The maximum instruction length is only 8 bytes, adjust the de-swizzler appropriately
* BUG: I'm an idiot, fix the array size
* Move the opcode 4 General Operations to its own function for clarity
* Bring back the quick and dirty debug output by consolidating all decoded fields into a structure
* Factor out common code used in genops jumps and calls
* Remove some magic numbers by using defines for the registers
* Missed a field when converting to the struct
* Record the size of the opcode