diff --git a/macaw-dump/src/Data/Macaw/Dump/Discover.hs b/macaw-dump/src/Data/Macaw/Dump/Discover.hs index 604e7f14..a6c229dc 100644 --- a/macaw-dump/src/Data/Macaw/Dump/Discover.hs +++ b/macaw-dump/src/Data/Macaw/Dump/Discover.hs @@ -52,12 +52,11 @@ instance X.Exception DiscoverException -- | Convert machine addresses into What4 positions. -- --- When possible, we map to the structured 'WPL.BinaryPos' type. However, some --- 'MM.MemSegmentOff' cannot be mapped to an absolute position (e.g., some --- addresses from shared libraries are in non-trivial segments). In those cases, --- we map to the unstructured 'WPL.Others' with a sufficiently descriptive string. --- --- TODO: import from `Testing` +-- When possible, we map to the structured 'WPL.BinaryPos' type. However, +-- some 'MM.MemSegmentOff' values cannot be mapped to an absolute position +-- (e.g., some addresses from shared libraries are in non-trivial segments). +-- In those cases, we map to the unstructured 'WPL.Others' with a sufficiently +-- descriptive string. posFn :: (MM.MemWidth w) => Text.Text -> MM.MemSegmentOff w -> WPL.Position posFn binaryName segOff = case MM.segoffAsAbsoluteAddr segOff of diff --git a/symbolic/src/Data/Macaw/Symbolic/Testing.hs b/symbolic/src/Data/Macaw/Symbolic/Testing.hs index 628836da..eadb4e04 100644 --- a/symbolic/src/Data/Macaw/Symbolic/Testing.hs +++ b/symbolic/src/Data/Macaw/Symbolic/Testing.hs @@ -113,10 +113,11 @@ instance X.Exception TestingException -- | Convert machine addresses into Crucible positions. -- --- When possible, we map to the structured 'WPL.BinaryPos' type. However, some --- 'MM.MemSegmentOff' cannot be mapped to an absolute position (e.g., some --- addresses from shared libraries are in non-trivial segments). In those cases, --- we map to the unstructured 'WPL.Others' with a sufficiently descriptive string. +-- When possible, we map to the structured 'WPL.BinaryPos' type. However, +-- some 'MM.MemSegmentOff' values cannot be mapped to an absolute position +-- (e.g., some addresses from shared libraries are in non-trivial segments). +-- In those cases, we map to the unstructured 'WPL.Others' with a sufficiently +-- descriptive string. posFn :: (MM.MemWidth w) => FilePath -> MM.MemSegmentOff w -> WPL.Position posFn binaryName segOff = case MM.segoffAsAbsoluteAddr segOff of