riscv-symbolic: Split 32-bit and 64-bit dump CLIs

This commit is contained in:
Your Name 2024-11-13 10:11:59 -05:00
parent ba19e989ec
commit cff4945385
3 changed files with 39 additions and 4 deletions

View File

@ -112,14 +112,29 @@ library
Data.Macaw.RISCV.Symbolic.Panic
Data.Macaw.RISCV.Symbolic.Repeat
executable macaw-riscv-dump
executable macaw-riscv32-dump
hs-source-dirs: tools
main-is: Dump.hs
main-is: Dump32.hs
default-language: Haskell2010
ghc-options: -Wall -Wcompat
build-depends:
base,
containers,
grift,
macaw-dump,
macaw-riscv,
macaw-riscv-symbolic,
macaw-symbolic
executable macaw-riscv64-dump
hs-source-dirs: tools
main-is: Dump64.hs
default-language: Haskell2010
ghc-options: -Wall -Wcompat
build-depends:
base,
containers,
grift,
macaw-dump,
macaw-riscv,
macaw-riscv-symbolic,

View File

@ -8,11 +8,12 @@ import Data.Macaw.RISCV qualified as MR
import Data.Macaw.RISCV.Symbolic ()
import Data.Macaw.Symbolic qualified as MS
import Data.Proxy (Proxy(..))
import GRIFT.Types qualified as G
main :: IO ()
main = do
archVals <-
case MS.archVals (Proxy @MR.RISCV) Nothing of
case MS.archVals (Proxy @(MR.RISCV G.RV32GC)) Nothing of
Just archVals -> pure archVals
Nothing -> error "impossible"
MD.main MR.riscv_info archVals MR.riscvPLTStubInfo
MD.main (MR.riscv_info G.rv32GCRepr) archVals MR.riscvPLTStubInfo

View File

@ -0,0 +1,19 @@
{-# LANGUAGE ImportQualifiedPost #-}
{-# LANGUAGE TypeApplications #-}
module Main (main) where
import Data.Macaw.Dump qualified as MD
import Data.Macaw.RISCV qualified as MR
import Data.Macaw.RISCV.Symbolic ()
import Data.Macaw.Symbolic qualified as MS
import Data.Proxy (Proxy(..))
import GRIFT.Types qualified as G
main :: IO ()
main = do
archVals <-
case MS.archVals (Proxy @(MR.RISCV G.RV64GC)) Nothing of
Just archVals -> pure archVals
Nothing -> error "impossible"
MD.main (MR.riscv_info G.rv64GCRepr) archVals MR.riscvPLTStubInfo