Skip to content

Commit

Permalink
riscv-symbolic: Split 32-bit and 64-bit dump CLIs
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Nov 13, 2024
1 parent ba19e98 commit cff4945
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 4 deletions.
19 changes: 17 additions & 2 deletions macaw-riscv-symbolic/macaw-riscv-symbolic.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
19 changes: 19 additions & 0 deletions macaw-riscv-symbolic/tools/Dump64.hs
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit cff4945

Please sign in to comment.