unw_get_proc_info.tex 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. \documentclass{article}
  2. \usepackage[fancyhdr,pdf]{latex2man}
  3. \input{common.tex}
  4. \begin{document}
  5. \begin{Name}{3}{unw\_get\_proc\_info}{David Mosberger-Tang}{Programming Library}{unw\_get\_proc\_info}unw\_get\_proc\_info -- get info on current procedure
  6. \end{Name}
  7. \section{Synopsis}
  8. \File{\#include $<$libunwind.h$>$}\\
  9. \Type{int} \Func{unw\_get\_proc\_info}(\Type{unw\_cursor\_t~*}\Var{cp}, \Type{unw\_proc\_info\_t~*}\Var{pip});\\
  10. \section{Description}
  11. The \Func{unw\_get\_proc\_info}() routine returns auxiliary
  12. information about the procedure that created the stack frame
  13. identified by argument \Var{cp}. The \Var{pip} argument is a pointer
  14. to a structure of type \Type{unw\_proc\_info\_t} which is used to
  15. return the information. The \Type{unw\_proc\_info\_t} has the
  16. following members:
  17. \begin{description}
  18. \item[\Type{unw\_word\_t} \Var{start\_ip}] The address of the first
  19. instruction of the procedure. If this address cannot be determined
  20. (e.g., due to lack of unwind information), the \Var{start\_ip}
  21. member is cleared to 0. \\
  22. \item[\Type{unw\_word\_t} \Var{end\_ip}] The address of the first
  23. instruction \emph{beyond} the end of the procedure. If this address
  24. cannot be determined (e.g., due to lack of unwind information),
  25. the \Var{end\_ip} member is cleared to 0. \\
  26. \item[\Type{unw\_word\_t} \Var{lsda}] The address of the
  27. language-specific data-area (LSDA). This area normally contains
  28. language-specific information needed during exception handling. If
  29. the procedure has no such area, this member is cleared to 0. \\
  30. \item[\Type{unw\_word\_t} \Var{handler}] The address of the exception
  31. handler routine. This is sometimes called the \emph{personality}
  32. routine. If the procedure does not define
  33. a personality routine, the \Var{handler} member is cleared to 0. \\
  34. \item[\Type{unw\_word\_t} \Var{gp}] The global-pointer of the
  35. procedure. On platforms that do not use a global pointer, this
  36. member may contain an undefined value. On all other platforms, it
  37. must be set either to the correct global-pointer value of the
  38. procedure or to 0 if the proper global-pointer cannot be
  39. obtained for some reason. \\
  40. \item[\Type{unw\_word\_t} \Var{flags}] A set of flags. There are
  41. currently no target-independent flags. For the IA-64 target, the
  42. flag \Const{UNW\_PI\_FLAG\_IA64\_RBS\_SWITCH} is set if the
  43. procedure may switch the register-backing store.\\
  44. \item[\Type{int} \Var{format}] The format of the unwind-info for this
  45. procedure. If the unwind-info consists of dynamic procedure info,
  46. \Var{format} is equal to \Const{UNW\_INFO\_FORMAT\_DYNAMIC}. If the
  47. unwind-info consists of a (target-specific) unwind table, it is
  48. equal to to \Const{UNW\_INFO\_FORMAT\_TABLE}. All other values are
  49. reserved for future use by \Prog{libunwind}. This member exists
  50. for use by the \Func{find\_proc\_info}() call-back (see
  51. \Func{unw\_create\_addr\_space}(3)). The
  52. \Func{unw\_get\_proc\_info}() routine
  53. may return an undefined value in this member. \\
  54. \item[\Type{int} \Var{unwind\_info\_size}] The size of the unwind-info
  55. in bytes. This member exists for use by the
  56. \Func{find\_proc\_info}() call-back (see
  57. \Func{unw\_create\_addr\_space}(3)). The
  58. \Func{unw\_get\_proc\_info}() routine
  59. may return an undefined value in this member.\\
  60. \item[\Type{void~*}\Var{unwind\_info}] The pointer to the unwind-info.
  61. If no unwind info is available, this member must be set to
  62. \Const{NULL}. This member exists for use by the
  63. \Func{find\_proc\_info}() call-back (see
  64. \Func{unw\_create\_addr\_space}(3)). The
  65. \Func{unw\_get\_proc\_info}() routine
  66. may return an undefined value in this member.\\
  67. \end{description}
  68. Note that for the purposes of \Prog{libunwind}, the code of a
  69. procedure is assumed to occupy a single, contiguous range of
  70. addresses. For this reason, it is alwas possible to describe the
  71. extent of a procedure with the \Var{start\_ip} and \Var{end\_ip}
  72. members. If a single function/routine is split into multiple,
  73. discontiguous pieces, \Prog{libunwind} will treat each piece as a
  74. separate procedure.
  75. \section{Return Value}
  76. On successful completion, \Func{unw\_get\_proc\_info}() returns 0.
  77. Otherwise the negative value of one of the error-codes below is
  78. returned.
  79. \section{Thread and Signal Safety}
  80. \Func{unw\_get\_proc\_info}() is thread-safe. If cursor \Var{cp} is
  81. in the local address-space, this routine is also safe to use from a
  82. signal handler.
  83. \section{Errors}
  84. \begin{Description}
  85. \item[\Const{UNW\_EUNSPEC}] An unspecified error occurred.
  86. \item[\Const{UNW\_ENOINFO}] \Prog{Libunwind} was unable to locate
  87. unwind-info for the procedure.
  88. \item[\Const{UNW\_EBADVERSION}] The unwind-info for the procedure has
  89. version or format that is not understood by \Prog{libunwind}.
  90. \end{Description}
  91. In addition, \Func{unw\_get\_proc\_info}() may return any error
  92. returned by the \Func{access\_mem}() call-back (see
  93. \Func{unw\_create\_addr\_space}(3)).
  94. \section{See Also}
  95. \SeeAlso{libunwind(3)},
  96. \SeeAlso{unw\_create\_addr\_space(3)},
  97. \SeeAlso{unw\_get\_proc\_name(3)}
  98. \section{Author}
  99. \noindent
  100. David Mosberger-Tang\\
  101. Email: \Email{dmosberger@gmail.com}\\
  102. WWW: \URL{http://www.nongnu.org/libunwind/}.
  103. \LatexManEnd
  104. \end{document}