unw_init_remote.tex 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. \documentclass{article}
  2. \usepackage[fancyhdr,pdf]{latex2man}
  3. \input{common.tex}
  4. \begin{document}
  5. \begin{Name}{3}{unw\_init\_remote}{David Mosberger-Tang}{Programming Library}{unw\_init\_remote}unw\_init\_remote -- initialize cursor for remote unwinding
  6. \end{Name}
  7. \section{Synopsis}
  8. \File{\#include $<$libunwind.h$>$}\\
  9. \Type{int} \Func{unw\_init\_remote}(\Type{unw\_cursor\_t~*}\Var{c}, \Type{unw\_addr\_space\_t~}\Var{as}, \Type{void~*}\Var{arg});\\
  10. \section{Description}
  11. The \Func{unw\_init\_remote}() routine initializes the unwind cursor
  12. pointed to by \Var{c} for unwinding in the address space identified by
  13. \Var{as}. The \Var{as} argument can either be set to
  14. \Var{unw\_local\_addr\_space} (local address space) or to an arbitrary
  15. address space created with \Func{unw\_create\_addr\_space}().
  16. The \Var{arg} void-pointer tells the address space exactly what entity
  17. should be unwound. For example, if \Var{unw\_local\_addr\_space} is
  18. passed in \Var{as}, then \Var{arg} needs to be a pointer to a context
  19. structure containing the machine-state of the initial stack frame.
  20. However, other address-spaces may instead expect a process-id, a
  21. thread-id, or a pointer to an arbitrary structure which identifies the
  22. stack-frame chain to be unwound. In other words, the interpretation
  23. of \Var{arg} is entirely dependent on the address-space in use;
  24. \Prog{libunwind} never interprets the argument in any way on its own.
  25. Note that \Func{unw\_init\_remote}() can be used to initiate unwinding
  26. in \emph{any} process, including the local process in which the
  27. unwinder itself is running. However, for local unwinding, it is
  28. generally preferable to use \Func{unw\_init\_local}() instead, because
  29. it is easier to use and because it may perform better.
  30. \section{Return Value}
  31. On successful completion, \Func{unw\_init\_remote}() returns 0.
  32. Otherwise the negative value of one of the error-codes below is
  33. returned.
  34. \section{Thread and Signal Safety}
  35. \Func{unw\_init\_remote}() is thread-safe. If the local address-space
  36. is passed in argument \Var{as}, this routine is also safe to use from
  37. a signal handler.
  38. \section{Errors}
  39. \begin{Description}
  40. \item[\Const{UNW\_EINVAL}] \Func{unw\_init\_remote}() was called in a
  41. version of \Prog{libunwind} which supports local unwinding only
  42. (this normally happens when defining \Const{UNW\_LOCAL\_ONLY} before
  43. including \File{$<$libunwind.h$>$} and then calling
  44. \Func{unw\_init\_remote}()).
  45. \item[\Const{UNW\_EUNSPEC}] An unspecified error occurred.
  46. \item[\Const{UNW\_EBADREG}] A register needed by \Func{unw\_init\_remote}()
  47. wasn't accessible.
  48. \end{Description}
  49. \section{See Also}
  50. \SeeAlso{libunwind(3)}, \SeeAlso{unw\_create\_addr\_space(3)},
  51. \SeeAlso{unw\_init\_local(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}