xref: /freebsd/contrib/elftoolchain/libdwarf/dwarf_get_cie_info.3 (revision 2de3b87a120614a3b053be7dd845b72f1e9ce804)
1*2de3b87aSKai Wang.\" Copyright (c) 2011 Kai Wang
2*2de3b87aSKai Wang.\" All rights reserved.
3*2de3b87aSKai Wang.\"
4*2de3b87aSKai Wang.\" Redistribution and use in source and binary forms, with or without
5*2de3b87aSKai Wang.\" modification, are permitted provided that the following conditions
6*2de3b87aSKai Wang.\" are met:
7*2de3b87aSKai Wang.\" 1. Redistributions of source code must retain the above copyright
8*2de3b87aSKai Wang.\"    notice, this list of conditions and the following disclaimer.
9*2de3b87aSKai Wang.\" 2. Redistributions in binary form must reproduce the above copyright
10*2de3b87aSKai Wang.\"    notice, this list of conditions and the following disclaimer in the
11*2de3b87aSKai Wang.\"    documentation and/or other materials provided with the distribution.
12*2de3b87aSKai Wang.\"
13*2de3b87aSKai Wang.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14*2de3b87aSKai Wang.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15*2de3b87aSKai Wang.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16*2de3b87aSKai Wang.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17*2de3b87aSKai Wang.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18*2de3b87aSKai Wang.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19*2de3b87aSKai Wang.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20*2de3b87aSKai Wang.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21*2de3b87aSKai Wang.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22*2de3b87aSKai Wang.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23*2de3b87aSKai Wang.\" SUCH DAMAGE.
24*2de3b87aSKai Wang.\"
25*2de3b87aSKai Wang.\" $Id: dwarf_get_cie_info.3 2071 2011-10-27 03:20:00Z jkoshy $
26*2de3b87aSKai Wang.\"
27*2de3b87aSKai Wang.Dd May 29, 2011
28*2de3b87aSKai Wang.Os
29*2de3b87aSKai Wang.Dt DWARF_GET_CIE_INFO 3
30*2de3b87aSKai Wang.Sh NAME
31*2de3b87aSKai Wang.Nm dwarf_get_cie_info
32*2de3b87aSKai Wang.Nd retrieve information associated with a CIE descriptor
33*2de3b87aSKai Wang.Sh LIBRARY
34*2de3b87aSKai Wang.Lb libdwarf
35*2de3b87aSKai Wang.Sh SYNOPSIS
36*2de3b87aSKai Wang.In libdwarf.h
37*2de3b87aSKai Wang.Ft int
38*2de3b87aSKai Wang.Fo dwarf_get_cie_info
39*2de3b87aSKai Wang.Fa "Dwarf_Cie cie"
40*2de3b87aSKai Wang.Fa "Dwarf_Unsigned *cie_byte_len"
41*2de3b87aSKai Wang.Fa "Dwarf_Small *version"
42*2de3b87aSKai Wang.Fa "char **augmentation"
43*2de3b87aSKai Wang.Fa "Dwarf_Unsigned *caf"
44*2de3b87aSKai Wang.Fa "Dwarf_Unsigned *daf"
45*2de3b87aSKai Wang.Fa "Dwarf_Half *ra"
46*2de3b87aSKai Wang.Fa "Dwarf_Ptr *init_inst"
47*2de3b87aSKai Wang.Fa "Dwarf_Unsigned *inst_len"
48*2de3b87aSKai Wang.Fa "Dwarf_Error *err"
49*2de3b87aSKai Wang.Fc
50*2de3b87aSKai Wang.Sh DESCRIPTION
51*2de3b87aSKai WangFunction
52*2de3b87aSKai Wang.Fn dwarf_get_cie_info
53*2de3b87aSKai Wangretrieves the information associated with a given CIE descriptor.
54*2de3b87aSKai Wang.Pp
55*2de3b87aSKai WangArgument
56*2de3b87aSKai Wang.Ar cie
57*2de3b87aSKai Wangshould reference a valid DWARF CIE descriptor, such as would be
58*2de3b87aSKai Wangreturned by function
59*2de3b87aSKai Wang.Xr dwarf_get_cie_of_fde 3 .
60*2de3b87aSKai Wang.Pp
61*2de3b87aSKai WangArgument
62*2de3b87aSKai Wang.Ar cie_byte_len
63*2de3b87aSKai Wangshould point to a location that will hold the length in bytes of
64*2de3b87aSKai Wangthe CIE descriptor itself.
65*2de3b87aSKai Wang.Pp
66*2de3b87aSKai WangArgument
67*2de3b87aSKai Wang.Ar version
68*2de3b87aSKai Wangshould point to a location that will hold the version number of
69*2de3b87aSKai Wangthe CIE descriptor.
70*2de3b87aSKai Wang.Pp
71*2de3b87aSKai WangArugment
72*2de3b87aSKai Wang.Ar augmentation
73*2de3b87aSKai Wangshould point to a location that will be set to a pointer to a
74*2de3b87aSKai WangNUL-terminated string containing augmentation data encoded as UTF-8.
75*2de3b87aSKai Wang.Pp
76*2de3b87aSKai WangArgument
77*2de3b87aSKai Wang.Ar caf
78*2de3b87aSKai Wangshould point to a location that will hold the code alignment
79*2de3b87aSKai Wangfactor recorded in the CIE descriptor.
80*2de3b87aSKai Wang.Pp
81*2de3b87aSKai WangArugment
82*2de3b87aSKai Wang.Ar daf
83*2de3b87aSKai Wangshould point to a location that will hold the data alignment
84*2de3b87aSKai Wangfactor recorded in the CIE descriptor.
85*2de3b87aSKai Wang.Pp
86*2de3b87aSKai WangArgument
87*2de3b87aSKai Wang.Ar ra
88*2de3b87aSKai Wangshould point to a location that will hold the return address
89*2de3b87aSKai Wangrecorded in the CIE descriptor.
90*2de3b87aSKai Wang.Pp
91*2de3b87aSKai WangArgument
92*2de3b87aSKai Wang.Ar init_inst
93*2de3b87aSKai Wangshould point to a location that will be set to a pointer to an array
94*2de3b87aSKai Wangof bytes containing the initial instructions associated with the CIE
95*2de3b87aSKai Wangdescriptor.
96*2de3b87aSKai Wang.Pp
97*2de3b87aSKai WangArgument
98*2de3b87aSKai Wang.Ar inst_len
99*2de3b87aSKai Wangshould point to a location that will hold the length in bytes
100*2de3b87aSKai Wangof the initial instructions returned in argument
101*2de3b87aSKai Wang.Ar init_inst .
102*2de3b87aSKai Wang.Pp
103*2de3b87aSKai WangIf argument
104*2de3b87aSKai Wang.Ar err
105*2de3b87aSKai Wangis not NULL, it will be used to store error information in case of an
106*2de3b87aSKai Wangerror.
107*2de3b87aSKai Wang.Sh RETURN VALUES
108*2de3b87aSKai WangFunction
109*2de3b87aSKai Wang.Fn dwarf_get_cie_info
110*2de3b87aSKai Wangreturns
111*2de3b87aSKai Wang.Dv DW_DLV_OK
112*2de3b87aSKai Wangwhen it succeeds.
113*2de3b87aSKai WangIn case of an error, it returns
114*2de3b87aSKai Wang.Dv DW_DLV_ERROR
115*2de3b87aSKai Wangand sets the argument
116*2de3b87aSKai Wang.Ar err .
117*2de3b87aSKai Wang.Sh ERRORS
118*2de3b87aSKai WangFunction
119*2de3b87aSKai Wang.Fn dwarf_get_cie_info
120*2de3b87aSKai Wangcan fail with:
121*2de3b87aSKai Wang.Bl -tag -width ".Bq Er DW_DLE_ARGUMENT"
122*2de3b87aSKai Wang.It Bq Er DW_DLE_ARGUMENT
123*2de3b87aSKai WangOne of the arguments
124*2de3b87aSKai Wang.Ar cie ,
125*2de3b87aSKai Wang.Ar cie_byte_len ,
126*2de3b87aSKai Wang.Ar version ,
127*2de3b87aSKai Wang.Ar augmentation ,
128*2de3b87aSKai Wang.Ar caf ,
129*2de3b87aSKai Wang.Ar daf ,
130*2de3b87aSKai Wang.Ar ra ,
131*2de3b87aSKai Wang.Ar init_inst
132*2de3b87aSKai Wangor
133*2de3b87aSKai Wang.Ar inst_len
134*2de3b87aSKai Wangwas NULL.
135*2de3b87aSKai Wang.El
136*2de3b87aSKai Wang.Sh SEE ALSO
137*2de3b87aSKai Wang.Xr dwarf 3 ,
138*2de3b87aSKai Wang.Xr dwarf_get_cie_index 3 ,
139*2de3b87aSKai Wang.Xr dwarf_get_cie_of_fde 3 ,
140*2de3b87aSKai Wang.Xr dwarf_get_fde_at_pc 3 ,
141*2de3b87aSKai Wang.Xr dwarf_get_fde_info_for_all_regs 3 ,
142*2de3b87aSKai Wang.Xr dwarf_get_fde_info_for_all_regs3 3 ,
143*2de3b87aSKai Wang.Xr dwarf_get_fde_info_for_cfa_reg3 3 ,
144*2de3b87aSKai Wang.Xr dwarf_get_fde_info_for_reg 3 ,
145*2de3b87aSKai Wang.Xr dwarf_get_fde_info_for_reg3 3 ,
146*2de3b87aSKai Wang.Xr dwarf_get_fde_instr_bytes 3 ,
147*2de3b87aSKai Wang.Xr dwarf_get_fde_list 3 ,
148*2de3b87aSKai Wang.Xr dwarf_get_fde_list_eh 3 ,
149*2de3b87aSKai Wang.Xr dwarf_get_fde_n 3 ,
150*2de3b87aSKai Wang.Xr dwarf_get_fde_range 3
151