Skip to content

Commit

Permalink
x86: dump executable
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Nov 12, 2024
1 parent 9e02ae7 commit fa69fcf
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
13 changes: 13 additions & 0 deletions x86_symbolic/macaw-x86-symbolic.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,19 @@ library
ghc-prof-options: -O2 -fprof-auto-top
default-extensions: NoStarIsType

executable macaw-x86-dump
hs-source-dirs: tools
main-is: Dump.hs
default-language: Haskell2010
ghc-options: -Wall -Wcompat
build-depends:
base,
containers,
macaw-x86,
macaw-x86-symbolic,
macaw-dump,
macaw-symbolic

test-suite macaw-x86-symbolic-tests
type: exitcode-stdio-1.0
default-language: Haskell2010
Expand Down
18 changes: 18 additions & 0 deletions x86_symbolic/tools/Dump.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{-# LANGUAGE ImportQualifiedPost #-}
{-# LANGUAGE TypeApplications #-}

module Main (main) where

import Data.Macaw.Dump qualified as MD
import Data.Macaw.Symbolic qualified as MS
import Data.Macaw.X86 qualified as MX
import Data.Macaw.X86.Symbolic ()
import Data.Proxy (Proxy(..))

main :: IO ()
main = do
archVals <-
case MS.archVals (Proxy @MX.X86_64) Nothing of
Just archVals -> pure archVals
Nothing -> error "impossible"
MD.main MX.x86_64_linux_info archVals MX.x86_64PLTStubInfo

0 comments on commit fa69fcf

Please sign in to comment.