UNW_GET_FPREG(3libunwind)

πŸ’– UNW_GET_FPREG πŸ’–

okay so bestie, welcome to unw_get_fpreg from the libunwind programming library (that's the 3libunwind section, iykyk). this is the girl whose whole job is: go get me the contents of a floating-point register. that's it. that's the vibe. 🫢


✨ NAME ✨

unw_get_fpreg β€” get contents of floating-point register


🌸 SYNOPSIS 🌸

#include <libunwind.h>

int unw_get_fpreg(unw_cursor_t *cp, unw_regnum_t reg, unw_fpreg_t *valp);

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea β˜• β€” the unw_get_fpreg() routine reads the value of the floating-point register reg inside the stack frame that your cursor cp is pointing at, and it stores that value in the variable that valp points to. cute, right? πŸ’…

now, the register numbering? target-dependent, no cap. it's described in separate manual pages β€” like libunwind-ia64(3libunwind) for the IA-64 target. and the exact set of registers you can actually reach may depend on the type of frame that cp is referring to. for ordinary stack frames, it's normally possible to access only the preserved (``callee-saved'') registers and frame-related registers (like the stack-pointer, bestie, the classic). but β€” for signal frames (see unw_is_signal_frame(3libunwind)), it is usually possible to access all the registers. main character access, honestly. πŸ‘‘

one thing to clock: unw_get_fpreg() can only read the contents of floating-point registers. see unw_get_fpreg(3libunwind) for a way to read registers which fit in a single word. (yes, the page really does say unw_get_fpreg there β€” we report, we don't edit πŸ’€)


πŸ’œ RETURN VALUE πŸ’œ

on successful completion, unw_get_fpreg() returns 0. slay. otherwise the negative value of one of the error codes below gets returned. 😭


🧚 THREAD AND SIGNAL SAFETY 🧚

unw_get_fpreg() is thread safe as well as safe to use from a signal handler. she's flexible like that. ✨


πŸ”₯ ERRORS πŸ”₯

  • UNW_EUNSPEC β€” an unspecified error occurred. (mystery error, very "we don't know her" πŸ™ˆ)
  • UNW_EBADREG β€” an attempt was made to read a register that is either invalid or not accessible in the current frame. 🚫

in addition, unw_get_fpreg() may return any error returned by the access_mem(), access_reg(), and access_fpreg() call-backs (see unw_create_addr_space(3libunwind)).


🌈 SEE ALSO 🌈

libunwind(3libunwind), libunwind-ia64(3libunwind), unw_get_reg(3libunwind), unw_is_fpreg(3libunwind), unw_is_signal_frame(3libunwind), unw_set_fpreg(3libunwind)


πŸŽ€ AUTHOR πŸŽ€

David Mosberger-Tang Email: dmosberger@gmail.com WWW: http://www.nongnu.org/libunwind/


okay bestie that's the whole page, periodt. πŸ’– this was served up from the Programming Library manual, dated 29 August 2023 β€” shoutout to UNW_GET_FPREG(3libunwind) for being the moment. go read your floating-point registers, ily 🫢🌸⭐

πŸ“¦ where this page comes from