unw_get_proc_name.man 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. '\" t
  2. .\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007
  3. .\" NOTE: This file is generated, DO NOT EDIT.
  4. .de Vb
  5. .ft CW
  6. .nf
  7. ..
  8. .de Ve
  9. .ft R
  10. .fi
  11. ..
  12. .TH "UNW\\_GET\\_PROC\\_NAME" "3" "16 August 2007" "Programming Library " "Programming Library "
  13. .SH NAME
  14. unw_get_proc_name
  15. \-\- get name of current procedure
  16. .PP
  17. .SH SYNOPSIS
  18. .PP
  19. #include <libunwind.h>
  20. .br
  21. .PP
  22. int
  23. unw_get_proc_name(unw_cursor_t *cp,
  24. char *bufp,
  25. size_t
  26. len,
  27. unw_word_t *offp);
  28. .br
  29. .PP
  30. .SH DESCRIPTION
  31. .PP
  32. The unw_get_proc_name()
  33. routine returns the name of the
  34. procedure that created the stack frame identified by argument
  35. cp\&.
  36. The bufp
  37. argument is a pointer to a character buffer
  38. that is at least len
  39. bytes long. This buffer is used to return
  40. the name of the procedure. The offp
  41. argument is a pointer to a
  42. word that is used to return the byte\-offset of the instruction\-pointer
  43. saved in the stack frame identified by cp,
  44. relative to the start
  45. of the procedure. For example, if procedure foo()
  46. starts at
  47. address 0x40003000, then invoking unw_get_proc_name()
  48. on a
  49. stack frame with an instruction\-pointer value of 0x40003080 would
  50. return a value of 0x80 in the word pointed to by offp
  51. (assuming
  52. the procedure is at least 0x80 bytes long).
  53. .PP
  54. Note that on some platforms there is no reliable way to distinguish
  55. between procedure names and ordinary labels. Furthermore, if symbol
  56. information has been stripped from a program, procedure names may be
  57. completely unavailable or may be limited to those exported via a
  58. dynamic symbol table. In such cases, unw_get_proc_name()
  59. may return the name of a label or a preceeding (nearby) procedure.
  60. However, the offset returned through offp
  61. is always relative to
  62. the returned name, which ensures that the value (address) of the
  63. returned name plus the returned offset will always be equal to the
  64. instruction\-pointer of the stack frame identified by cp\&.
  65. .PP
  66. .SH RETURN VALUE
  67. .PP
  68. On successful completion, unw_get_proc_name()
  69. returns 0.
  70. Otherwise the negative value of one of the error\-codes below is
  71. returned.
  72. .PP
  73. .SH THREAD AND SIGNAL SAFETY
  74. .PP
  75. unw_get_proc_name()
  76. is thread\-safe. If cursor cp
  77. is
  78. in the local address\-space, this routine is also safe to use from a
  79. signal handler.
  80. .PP
  81. .SH ERRORS
  82. .PP
  83. .TP
  84. UNW_EUNSPEC
  85. An unspecified error occurred.
  86. .TP
  87. UNW_ENOINFO
  88. Libunwind
  89. was unable to determine
  90. the name of the procedure.
  91. .TP
  92. UNW_ENOMME
  93. The procedure name is too long to fit
  94. in the buffer provided. A truncated version of the name has been
  95. returned.
  96. .PP
  97. In addition, unw_get_proc_name()
  98. may return any error
  99. returned by the access_mem()
  100. call\-back (see
  101. unw_create_addr_space(3)).
  102. .PP
  103. .SH SEE ALSO
  104. .PP
  105. libunwind(3),
  106. unw_get_proc_info(3)
  107. .PP
  108. .SH AUTHOR
  109. .PP
  110. David Mosberger\-Tang
  111. .br
  112. Email: \fBdmosberger@gmail.com\fP
  113. .br
  114. WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
  115. .\" NOTE: This file is generated, DO NOT EDIT.