Update macaw-arm and macaw-ppc to emit extra metadata

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.
This commit is contained in:
Tristan Ravitch 2018-11-28 10:22:25 -08:00
parent 95091a5fb3
commit 30b5d2e091
2 changed files with 4 additions and 0 deletions

View File

@ -201,6 +201,8 @@ disassembleBlock lookupSemantics gs curPCAddr maxOffset = do
let lineStr = printf "%s: %s" (show curPCAddr) (show (case i of
A32I i' -> ARMD.ppInstruction i'
T32I i' -> ThumbD.ppInstruction i'))
let Just addrWord = MM.segoffAsAbsoluteAddr curPCAddr
addStmt (InstructionStart addrWord (T.pack lineStr))
addStmt (Comment (T.pack lineStr))
asAtomicStateUpdate (MM.relativeSegmentAddr curPCAddr) transformer

View File

@ -136,6 +136,8 @@ disassembleBlock lookupSemantics gs curIPAddr maxOffset = do
-- a result from the state of the 'Generator'.
egs1 <- liftST $ ET.runExceptT (runGenerator genResult gs $ do
let lineStr = printf "%s: %s" (show curIPAddr) (show (D.ppInstruction i))
let Just addrWord = MM.segoffAsAbsoluteAddr curIPAddr
addStmt (InstructionStart addrWord (T.pack lineStr))
addStmt (Comment (T.pack lineStr))
asAtomicStateUpdate (MM.segoffAddr curIPAddr) transformer