mirror of
https://github.com/GaloisInc/macaw.git
synced 2024-12-29 00:59:09 +03:00
Export another utility and type from Macaw.Memory
This type is needed to write some type signatures, and we needed an accessor to extract segment ranges from a SegmentContents.
This commit is contained in:
parent
b2d955cb3e
commit
8c20e0e156
@ -45,6 +45,8 @@ module Data.Macaw.Memory
|
||||
, segmentOffset
|
||||
, segmentFlags
|
||||
, segmentContents
|
||||
, SegmentContents
|
||||
, contentsRanges
|
||||
, ppMemSegment
|
||||
, segmentSize
|
||||
, SegmentRange(..)
|
||||
@ -443,6 +445,10 @@ contentsSize (SegmentContents m) =
|
||||
Nothing -> 0
|
||||
Just ((start, c),_) -> start + rangeSize c
|
||||
|
||||
-- | De-construct a 'SegmentContents' into its constituent ranges
|
||||
contentsRanges :: SegmentContents w -> [(MemWord w, SegmentRange w)]
|
||||
contentsRanges = Map.toList . segContentsMap
|
||||
|
||||
-- | Return list of contents from given word or an error if this we can't cleanly
|
||||
-- partition a relocation
|
||||
-- due to a relocation.
|
||||
|
Loading…
Reference in New Issue
Block a user