The ArchitectureInfo checkForReturnAddr is used to check if a specific
value corresponds to the symbolic "ReturnAddr", indicating that the
target is the original call location (this is used to identify
tail-call recursion or identify that a return has been performed from
the primary function via identifyReturn).
The current implementation simply checks for ReturnAddr in the Link
Register (LR), but it needs to be enhanced to detect ARM semantic
manipulation of ReturnAddr (clearing the low bit(s), etc.).
There was an error case in function interpretation in the TH generated
code (when a function couldn't be evaluated for a given operand). This
shouldn't happen for well-formed code, but can be a problem when macaw finds
invalid code that happens to decode as a real instruction (with an invalid
operand).
The old code called error, which caused macaw to fail with a hard stop. This
commit changes the call to be to `fail` instead, which fires off an exception
that is properly handled (giving us a ClassifyFailure instead).
We now thread a snapshot of the register state from the beginning of the
instruction evaluation through each instruction's semantics instead of
re-fetching register values each time we need it and potentially seeing
incorrect, partially modified register values.
The field it contains is supposed to be the instruction offset in its basic
block; overflowing it can cause significant problems during symbolic simulation.
There is a new metadata statement that tracks the start address of each
instruction. This is used in the translation to Crucible to provide better
error messages. The x86 backend was already updated, this commit adds the
metadata to the ARM and PowerPC backends.
To avoid conflicting stack.yaml files when crucible is used a
submodule in another repo with a top level stack.yaml.
Also, update the README to include creating a stack.yaml symlink
before building with stack the first time.
The code was updated to deal with the latest changes to crucible (the addition
of the floating point unit type parameter), but the submodules for this repo
were not.
In macaw core, the type of the arch-specific 'disassemble' function changed to
no longer take a Memory, and to pass the maximum offset as an Int instead of a
MemWord. It also removed the jump table entry size (which is no longer
required).
The removal of the Memory parameter required a bit of a change in how the
instruction parsers are structured, but it isn't a huge change (the "memory
contents after an address" can be computed from a MemSegmentOff, too).
The goal with these flags was to improve compile times by reducing the number of
times that the simplifier runs. It seems like that sometimes causes compiler
errors (e.g., the register allocator crash we hit sometimes) - presumably the
register allocator makes some assumptions about how much the simplifier is run.