unw_resume.man 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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\\_RESUME" "3" "16 August 2007" "Programming Library " "Programming Library "
  13. .SH NAME
  14. unw_resume
  15. \-\- resume execution in a particular stack frame
  16. .PP
  17. .SH SYNOPSIS
  18. .PP
  19. #include <libunwind.h>
  20. .br
  21. .PP
  22. int
  23. unw_resume(unw_cursor_t *cp);
  24. .br
  25. .PP
  26. .SH DESCRIPTION
  27. .PP
  28. The unw_resume()
  29. routine resumes execution at the stack frame
  30. identified by cp\&.
  31. The behavior of this routine differs
  32. slightly for local and remote unwinding.
  33. .PP
  34. For local unwinding, unw_resume()
  35. restores the machine state
  36. and then directly resumes execution in the target stack frame. Thus
  37. unw_resume()
  38. does not return in this case. Restoring the
  39. machine state normally involves restoring the ``preserved\&''
  40. (callee\-saved) registers. However, if execution in any of the stack
  41. frames younger (more deeply nested) than the one identified by
  42. cp
  43. was interrupted by a signal, then unw_resume()
  44. will
  45. restore all registers as well as the signal mask. Attempting to call
  46. unw_resume()
  47. on a cursor which identifies the stack frame of
  48. another thread results in undefined behavior (e.g., the program may
  49. crash).
  50. .PP
  51. For remote unwinding, unw_resume()
  52. installs the machine state
  53. identified by the cursor by calling the access_reg
  54. and
  55. access_fpreg
  56. accessor callbacks as needed. Once that is
  57. accomplished, the resume
  58. accessor callback is invoked. The
  59. unw_resume
  60. routine then returns normally (that is, unlikely
  61. for local unwinding, unw_resume
  62. will always return for remote
  63. unwinding).
  64. .PP
  65. Most platforms reserve some registers to pass arguments to exception
  66. handlers (e.g., IA\-64 uses r15\-r18
  67. for this
  68. purpose). These registers are normally treated like ``scratch\&''
  69. registers. However, if libunwind
  70. is used to set an exception
  71. argument register to a particular value (e.g., via
  72. unw_set_reg()),
  73. then unw_resume()
  74. will install this
  75. value as the contents of the register. In other words, the exception
  76. handling arguments are installed even in cases where normally only the
  77. ``preserved\&'' registers are restored.
  78. .PP
  79. Note that unw_resume()
  80. does \fInot\fP
  81. invoke any unwind
  82. handlers (aka, ``personality routines\&''). If a program needs this, it
  83. will have to do so on its own by obtaining the unw_proc_info_t
  84. of each unwound frame and appropriately processing its unwind handler
  85. and language\-specific data area (lsda). These steps are generally
  86. dependent on the target\-platform and are regulated by the
  87. processor\-specific ABI (application\-binary interface).
  88. .PP
  89. .SH RETURN VALUE
  90. .PP
  91. For local unwinding, unw_resume()
  92. does not return on success.
  93. For remote unwinding, it returns 0 on success. On failure, the
  94. negative value of one of the errors below is returned.
  95. .PP
  96. .SH THREAD AND SIGNAL SAFETY
  97. .PP
  98. unw_resume()
  99. is thread\-safe. If cursor cp
  100. is in the
  101. local address\-space, this routine is also safe to use from a signal
  102. handler.
  103. .PP
  104. .SH ERRORS
  105. .PP
  106. .TP
  107. UNW_EUNSPEC
  108. An unspecified error occurred.
  109. .TP
  110. UNW_EBADREG
  111. A register needed by unw_resume()
  112. wasn\&'t
  113. accessible.
  114. .TP
  115. UNW_EINVALIDIP
  116. The instruction pointer identified by
  117. cp
  118. is not valid.
  119. .TP
  120. UNW_BADFRAME
  121. The stack frame identified by
  122. cp
  123. is not valid.
  124. .PP
  125. .SH SEE ALSO
  126. .PP
  127. libunwind(3),
  128. unw_set_reg(3),
  129. sigprocmask(2)
  130. .PP
  131. .SH AUTHOR
  132. .PP
  133. David Mosberger\-Tang
  134. .br
  135. Email: \fBdmosberger@gmail.com\fP
  136. .br
  137. WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
  138. .\" NOTE: This file is generated, DO NOT EDIT.