blob: 57085dcb302981ba6b17647bd6546ce1470e2c2b [file] [log] [blame]
mostang.com!davidm9eb9f312003-04-01 07:19:34 +00001'\" t
2.\" Manual page created with latex2man on Mon Mar 31 14:18:02 PST 2003
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
11.fi
12..
13.TH "UNW\\_GET\\_PROC\\_NAME" "3" "31 March 2003" "Programming Library " "Programming Library "
14.SH NAME
15unw_get_proc_name
16\-\- get name of current procedure
17.PP
18.SH SYNOPSIS
19
20.PP
21#include <libunwind.h>
22.br
23.PP
24int
25unw_get_proc_name(unw_cursor_t *cp,
26char *bufp,
27size_t
28len,
29unw_word_t *offp);
30.br
31.PP
32.SH DESCRIPTION
33
34.PP
35The unw_get_proc_name()
36routine returns the name of the
37procedure that created the stack frame identified by argument
38cp\&.
39The bufp
40argument is a pointer to a character buffer
41that is at least len
42bytes long. This buffer is used to return
43the name of the procedure. The offp
44argument is a pointer to a
45word that is used to return the byte\-offset of the instruction\-pointer
46saved in the stack frame identified by cp,
47relative to the start
48of the procedure. For example, if procedure foo()
49starts at
50address 0x40003000, then invoking unw_get_proc_name()
51on a
52stack frame with an instruction\-pointer value of 0x40003080 would
53return a value of 0x80 in the word pointed to by offp
54(assuming
55the procedure is at least 0x80 bytes long).
56.PP
57Note that on some platforms there is no reliable way to distinguish
58between procedure names and ordinary labels. Furthermore, if symbol
59information has been stripped from a program, procedure names may be
60completely unavailable or may be limited to those exported via a
61dynamic symbol table. In such cases, unw_get_proc_name()
62may return the name of a label or a preceeding (nearby) procedure.
63However, the offset returned through offp
64is always relative to
65the returned name, which ensures that the value (address) of the
66returned name plus the returned offset will always be equal to the
67instruction\-pointer of the stack frame identified by cp\&.
68.PP
69.SH RETURN VALUE
70
71.PP
72On successful completion, unw_get_proc_name()
73returns 0.
74Otherwise the negative value of one of the error\-codes below is
75returned.
76.PP
77.SH THREAD AND SIGNAL SAFETY
78
79.PP
80unw_get_proc_name()
81is thread\-safe but \fInot\fP
82safe to
83use from a signal handler.
84.PP
85.SH ERRORS
86
87.PP
88.TP
89UNW_EUNSPEC
90 An unspecified error occurred.
91.TP
92UNW_ENOINFO
93 Libunwind
94was unable to determine
95the name of the procedure.
96.TP
97UNW_ENOMME
98 The procedure name is too long to fit
99in the buffer provided. A truncated version of the name has been
100returned.
101.PP
102In addition, unw_get_proc_name()
103may return any error
104returned by the access_mem()
105call\-back (see
106unw_create_addr_space(3)).
107.PP
108.SH SEE ALSO
109
110.PP
111libunwind(3),
112unw_get_proc_info(3)
113.PP
114.SH AUTHOR
115
116.PP
117David Mosberger\-Tang
118.br
119Hewlett\-Packard Labs
120.br
121Palo\-Alto, CA 94304
122.br
123Email: \fBdavidm@hpl.hp.com\fP
124.br
125WWW: \fBhttp://www.hpl.hp.com/research/linux/libunwind/\fP\&.
126.\" NOTE: This file is generated, DO NOT EDIT.