mirror of
https://github.com/GaloisInc/macaw.git
synced 2024-11-28 01:35:33 +03:00
[x86_symbolic] updates for crucible nonce change from (ST h) to IO
Changes for compatibility with Crucible pull request 285 (https://github.com/GaloisInc/crucible/pull/285) and the corresponding changes in macaw symbolic.
This commit is contained in:
parent
48c3ba1fed
commit
40eff5802c
@ -276,27 +276,27 @@ instance TraversableFC X86StmtExtension where
|
|||||||
type instance MacawArchStmtExtension M.X86_64 = X86StmtExtension
|
type instance MacawArchStmtExtension M.X86_64 = X86StmtExtension
|
||||||
|
|
||||||
|
|
||||||
crucGenX86Fn :: forall ids h s tp. M.X86PrimFn (M.Value M.X86_64 ids) tp
|
crucGenX86Fn :: forall ids s tp. M.X86PrimFn (M.Value M.X86_64 ids) tp
|
||||||
-> CrucGen M.X86_64 ids h s (C.Atom s (ToCrucibleType tp))
|
-> CrucGen M.X86_64 ids s (C.Atom s (ToCrucibleType tp))
|
||||||
crucGenX86Fn fn = do
|
crucGenX86Fn fn = do
|
||||||
let f :: M.Value arch ids a -> CrucGen arch ids h s (AtomWrapper (C.Atom s) a)
|
let f :: M.Value arch ids a -> CrucGen arch ids s (AtomWrapper (C.Atom s) a)
|
||||||
f x = AtomWrapper <$> valueToCrucible x
|
f x = AtomWrapper <$> valueToCrucible x
|
||||||
r <- traverseFC f fn
|
r <- traverseFC f fn
|
||||||
evalArchStmt (X86PrimFn r)
|
evalArchStmt (X86PrimFn r)
|
||||||
|
|
||||||
|
|
||||||
crucGenX86Stmt :: forall ids h s
|
crucGenX86Stmt :: forall ids s
|
||||||
. M.X86Stmt (M.Value M.X86_64 ids)
|
. M.X86Stmt (M.Value M.X86_64 ids)
|
||||||
-> CrucGen M.X86_64 ids h s ()
|
-> CrucGen M.X86_64 ids s ()
|
||||||
crucGenX86Stmt stmt = do
|
crucGenX86Stmt stmt = do
|
||||||
let f :: M.Value M.X86_64 ids a -> CrucGen M.X86_64 ids h s (AtomWrapper (C.Atom s) a)
|
let f :: M.Value M.X86_64 ids a -> CrucGen M.X86_64 ids s (AtomWrapper (C.Atom s) a)
|
||||||
f x = AtomWrapper <$> valueToCrucible x
|
f x = AtomWrapper <$> valueToCrucible x
|
||||||
stmt' <- traverseF f stmt
|
stmt' <- traverseF f stmt
|
||||||
void (evalArchStmt (X86PrimStmt stmt'))
|
void (evalArchStmt (X86PrimStmt stmt'))
|
||||||
|
|
||||||
crucGenX86TermStmt :: M.X86TermStmt ids
|
crucGenX86TermStmt :: M.X86TermStmt ids
|
||||||
-> M.RegState M.X86Reg (M.Value M.X86_64 ids)
|
-> M.RegState M.X86Reg (M.Value M.X86_64 ids)
|
||||||
-> CrucGen M.X86_64 ids h s ()
|
-> CrucGen M.X86_64 ids s ()
|
||||||
crucGenX86TermStmt tstmt _regs =
|
crucGenX86TermStmt tstmt _regs =
|
||||||
void (evalArchStmt (X86PrimTerm tstmt))
|
void (evalArchStmt (X86PrimTerm tstmt))
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ main = do
|
|||||||
[] -> fail "Could not find add function"
|
[] -> fail "Could not find add function"
|
||||||
_ -> fail "Found multiple add functions"
|
_ -> fail "Found multiple add functions"
|
||||||
|
|
||||||
memBaseVar <- stToIO $ C.freshGlobalVar halloc "add_mem_base" C.knownRepr
|
memBaseVar <- C.freshGlobalVar halloc "add_mem_base" C.knownRepr
|
||||||
|
|
||||||
let memBaseVarMap :: MS.MemSegmentMap 64
|
let memBaseVarMap :: MS.MemSegmentMap 64
|
||||||
memBaseVarMap = Map.singleton 1 memBaseVar
|
memBaseVarMap = Map.singleton 1 memBaseVar
|
||||||
@ -113,7 +113,7 @@ main = do
|
|||||||
putStrLn $ "Analyzing " ++ show addr
|
putStrLn $ "Analyzing " ++ show addr
|
||||||
|
|
||||||
(_, Some funInfo) <- stToIO $ M.analyzeFunction logFn addAddr M.UserRequest ds0
|
(_, Some funInfo) <- stToIO $ M.analyzeFunction logFn addAddr M.UserRequest ds0
|
||||||
C.SomeCFG g <- stToIO $ MS.mkFunCFG x86ArchFns halloc memBaseVarMap "add" posFn funInfo
|
C.SomeCFG g <- MS.mkFunCFG x86ArchFns halloc memBaseVarMap "add" posFn funInfo
|
||||||
|
|
||||||
regs <- MS.macawAssignToCrucM (mkReg x86ArchFns sym) (MS.crucGenRegAssignment x86ArchFns)
|
regs <- MS.macawAssignToCrucM (mkReg x86ArchFns sym) (MS.crucGenRegAssignment x86ArchFns)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user