unw_set_reg.tex 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. \documentclass{article}
  2. \usepackage[fancyhdr,pdf]{latex2man}
  3. \input{common.tex}
  4. \begin{document}
  5. \begin{Name}{3}{unw\_set\_reg}{David Mosberger-Tang}{Programming Library}{unw\_set\_reg}unw\_set\_reg -- set register contents
  6. \end{Name}
  7. \section{Synopsis}
  8. \File{\#include $<$libunwind.h$>$}\\
  9. \Type{int} \Func{unw\_set\_reg}(\Type{unw\_cursor\_t~*}\Var{cp}, \Type{unw\_regnum\_t} \Var{reg}, \Type{unw\_word\_t} \Var{val});\\
  10. \section{Description}
  11. The \Func{unw\_set\_reg}() routine sets the value of register
  12. \Var{reg} in the stack frame identified by cursor \Var{cp} to the
  13. value passed in \Var{val}.
  14. The register numbering is target-dependent and described in separate
  15. manual pages (e.g., libunwind-ia64(3) for the IA-64 target).
  16. Furthermore, the exact set of accessible registers may depend on the
  17. type of frame that \Var{cp} is referring to. For ordinary stack
  18. frames, it is normally possible to access only the preserved
  19. (``callee-saved'') registers and frame-related registers (such as the
  20. stack-pointer). However, for signal frames (see
  21. \Func{unw\_is\_signal\_frame}(3)), it is usually possible to access
  22. all registers.
  23. Note that \Func{unw\_set\_reg}() can only write the contents of
  24. registers whose values fit in a single word. See
  25. \Func{unw\_set\_fpreg}(3) for a way to write registers which do not
  26. fit this constraint.
  27. \section{Return Value}
  28. On successful completion, \Func{unw\_set\_reg}() returns 0.
  29. Otherwise the negative value of one of the error-codes below is
  30. returned.
  31. \section{Thread and Signal Safety}
  32. \Func{unw\_set\_reg}() is thread-safe as well as safe to use
  33. from a signal handler.
  34. \section{Errors}
  35. \begin{Description}
  36. \item[\Const{UNW\_EUNSPEC}] An unspecified error occurred.
  37. \item[\Const{UNW\_EBADREG}] An attempt was made to write a register
  38. that is either invalid or not accessible in the current frame.
  39. \item[\Const{UNW\_EREADONLY}] An attempt was made to write to a
  40. read-only register.
  41. \end{Description}
  42. In addition, \Func{unw\_set\_reg}() may return any error returned by
  43. the \Func{access\_mem}(), \Func{access\_reg}(), and
  44. \Func{access\_fpreg}() call-backs (see
  45. \Func{unw\_create\_addr\_space}(3)).
  46. \section{See Also}
  47. \SeeAlso{libunwind(3)},
  48. \SeeAlso{libunwind-ia64(3)},
  49. \SeeAlso{unw\_get\_reg(3)},
  50. \SeeAlso{unw\_is\_signal\_frame(3)},
  51. \SeeAlso{unw\_set\_fpreg(3)}
  52. \section{Author}
  53. \noindent
  54. David Mosberger-Tang\\
  55. Email: \Email{dmosberger@gmail.com}\\
  56. WWW: \URL{http://www.nongnu.org/libunwind/}.
  57. \LatexManEnd
  58. \end{document}