From f1e25e901347a3ae831a95f4f553344ea4aac8cf Mon Sep 17 00:00:00 2001 From: Langston Barrett Date: Wed, 24 Jan 2024 10:14:36 -0500 Subject: [PATCH] x86-symbolic: Add function to extract message from exceptions --- x86_symbolic/src/Data/Macaw/X86/Crucible.hs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/x86_symbolic/src/Data/Macaw/X86/Crucible.hs b/x86_symbolic/src/Data/Macaw/X86/Crucible.hs index 194eb0e2..62b46493 100644 --- a/x86_symbolic/src/Data/Macaw/X86/Crucible.hs +++ b/x86_symbolic/src/Data/Macaw/X86/Crucible.hs @@ -20,6 +20,7 @@ module Data.Macaw.X86.Crucible -- * Instruction interpretation , MissingSemantics(..) + , missingSemanticsMessage , funcSemantics , stmtSemantics , termSemantics @@ -139,6 +140,14 @@ data MissingSemantics instance Exception MissingSemantics +-- | Create a human-readable message from a 'MissingSemantics' exception. +missingSemanticsMessage :: MissingSemantics -> String +missingSemanticsMessage = + \case + MissingPrimFnSemantics msg -> msg + MissingStmtSemantics msg -> msg + MissingTermSemantics msg -> msg + stmtSemantics :: (IsSymInterface sym, HasLLVMAnn sym, ?memOpts :: MemOptions) => SymFuns sym