unw_get_proc_info_by_ip.tex 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. \documentclass{article}
  2. \usepackage[fancyhdr,pdf]{latex2man}
  3. \input{common.tex}
  4. \begin{document}
  5. \begin{Name}{3}{unw\_get\_proc\_info\_by\_ip}{David Mosberger-Tang}{Programming Library}{unw\_get\_proc\_info\_by\_ip}unw\_get\_proc\_info\_by\_ip -- get procedure info by IP
  6. \end{Name}
  7. \section{Synopsis}
  8. \File{\#include $<$libunwind.h$>$}\\
  9. \Type{int} \Func{unw\_get\_proc\_info\_by\_ip}(\Type{unw\_addr\_space\_t~}\Var{as}, \Type{unw\_word\_t~}\Var{ip}, \Type{unw\_proc\_info\_t~*}\Var{pip}, \Type{void~*}\Var{arg});\\
  10. \section{Description}
  11. The \Func{unw\_get\_proc\_info\_by\_ip}() routine returns the same
  12. kind of auxiliary information about a procedure as
  13. \Func{unw\_get\_proc\_info}(), except that the info is looked up by
  14. instruction-pointer (IP) instead of a cursor. This is more flexible
  15. because it is possible to look up the info for an arbitrary procedure,
  16. even if it is not part of the current call-chain. However, since it
  17. is more flexible, it also tends to run slower (and often much slower)
  18. than \Func{unw\_get\_proc\_info}().
  19. The routine expects the followins arguments: \Var{as} is the
  20. address-space in which the instruction-pointer should be looked up.
  21. For a look-up in the local address-space,
  22. \Var{unw\_local\_addr\_space} can be passed for this argument.
  23. Argument \Var{ip} is the instruction-pointer for which the procedure
  24. info should be looked up and \Var{pip} is a pointer to a structure of
  25. type \Type{unw\_proc\_info\_t} which is used to return the info.
  26. Lastly, \Var{arg} is the address-space argument that should be used
  27. when accessing the address-space. It has the same purpose as the
  28. argument of the same name for \Func{unw\_init\_remote}(). When
  29. accessing the local address-space (first argument is
  30. \Var{unw\_local\_addr\_space}), \Const{NULL} must be passed for this
  31. argument.
  32. Note that for the purposes of \Prog{libunwind}, the code of a
  33. procedure is assumed to occupy a single, contiguous range of
  34. addresses. For this reason, it is alwas possible to describe the
  35. extent of a procedure with the \Var{start\_ip} and \Var{end\_ip}
  36. members. If a single function/routine is split into multiple,
  37. discontiguous pieces, \Prog{libunwind} will treat each piece as a
  38. separate procedure.
  39. \section{Return Value}
  40. On successful completion, \Func{unw\_get\_proc\_info\_by\_ip}()
  41. returns 0. Otherwise the negative value of one of the error-codes
  42. below is returned.
  43. \section{Thread and Signal Safety}
  44. \Func{unw\_get\_proc\_info}() is thread-safe. If the local
  45. address-space is passed in argument \Var{as}, this routine is also
  46. safe to use from a signal handler.
  47. \section{Errors}
  48. \begin{Description}
  49. \item[\Const{UNW\_EUNSPEC}] An unspecified error occurred.
  50. \item[\Const{UNW\_ENOINFO}] \Prog{Libunwind} was unable to locate
  51. unwind-info for the procedure.
  52. \item[\Const{UNW\_EBADVERSION}] The unwind-info for the procedure has
  53. version or format that is not understood by \Prog{libunwind}.
  54. \end{Description}
  55. In addition, \Func{unw\_get\_proc\_info}() may return any error
  56. returned by the \Func{access\_mem}() call-back (see
  57. \Func{unw\_create\_addr\_space}(3)).
  58. \section{See Also}
  59. \SeeAlso{libunwind(3)},
  60. \SeeAlso{unw\_create\_addr\_space(3)},
  61. \SeeAlso{unw\_get\_proc\_name(3)},
  62. \SeeAlso{unw\_get\_proc\_info(3)},
  63. \SeeAlso{unw\_init\_remote(3)}
  64. \section{Author}
  65. \noindent
  66. David Mosberger-Tang\\
  67. Email: \Email{dmosberger@gmail.com}\\
  68. WWW: \URL{http://www.nongnu.org/libunwind/}.
  69. \LatexManEnd
  70. \end{document}