File tree Expand file tree Collapse file tree 1 file changed +17
-5
lines changed
elf-edit-core-dump/src/Data/ElfEdit Expand file tree Collapse file tree 1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,12 @@ module Data.ElfEdit.CoreDump
2828
2929 -- * Decoding
3030 , decodeHeaderNotes
31+ , decodePrStatus
32+ , decodeUserRegSet
33+ , decodeArmUserRegs
34+ , decodePpcUserRegs
35+ , decodeX86_64UserRegs
36+ , decodeNhdr
3137 , NoteDecodeError (.. )
3238
3339 -- * Analysis
@@ -231,6 +237,15 @@ decodeUserRegSet cl d m buf =
231237 mkPpcUserRegSet <$>
232238 decodePpcUserRegs cl d (Elf. slice ppcUserRegsFileRange buf)
233239
240+ -- | Decode a 'PrStatus' value from a 'BS.ByteString'.
241+ decodePrStatus ::
242+ Elf. ElfClass w ->
243+ Elf. ElfData ->
244+ Elf. ElfMachine ->
245+ BS. ByteString ->
246+ Either NoteDecodeError PrStatus
247+ decodePrStatus cl d m buf = PrStatus <$> decodeUserRegSet cl d m buf
248+
234249-- | Compute the padding necessary to make a word value 4-byte aligned (if using
235250-- 'Elf.ELFCLASS32') or 8-byte aligned (if using 'Elf.ELFCLASS64').
236251notePadding ::
@@ -297,11 +312,8 @@ decodeNotes cl d m phdrContents =
297312 mbNoteDesc <-
298313 case Nhdr. nhdrType nhdr of
299314 Nhdr. NT_PRSTATUS -> do
300- regs <- decodeUserRegSet cl d m descRaw
301- pure $ Just $ NotePrStatus $
302- PrStatus
303- { prReg = regs
304- }
315+ prs <- decodePrStatus cl d m descRaw
316+ pure $ Just $ NotePrStatus prs
305317 Nhdr. NT_FPREGSET -> pure $ Just $ NoteFpRegSet FpRegSet
306318 Nhdr. NT_PRPSINFO -> pure $ Just $ NotePrpsInfo PrpsInfo
307319 _ -> pure $ Nothing
You can’t perform that action at this time.
0 commit comments