1 .\" $NetBSD: dwarf_lineno.3,v 1.2 2014/03/09 16:58:04 christos Exp $
3 .\" Copyright (c) 2011 Kai Wang
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
15 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 .\" Id: dwarf_lineno.3 2074 2011-10-27 03:34:33Z jkoshy
34 .Nm dwarf_linebeginstatement ,
36 .Nm dwarf_lineendsequence ,
40 .Nm dwarf_line_srcfileno
41 .Nd retrieve information associated with a DWARF line descriptor
50 .Fa "Dwarf_Error *err"
53 .Fo dwarf_linebeginstatement
56 .Fa "Dwarf_Error *err"
62 .Fa "Dwarf_Error *err"
65 .Fo dwarf_lineendsequence
68 .Fa "Dwarf_Error *err"
73 .Fa "Dwarf_Unsigned *ret"
74 .Fa "Dwarf_Error *err"
79 .Fa "Dwarf_Signed *ret"
80 .Fa "Dwarf_Error *err"
86 .Fa "Dwarf_Error *err"
89 .Fo dwarf_line_srcfileno
91 .Fa "Dwarf_Unsigned *ret"
92 .Fa "Dwarf_Error *err"
95 These functions retrieve specific line information associated with
96 the line descriptor specified by argument
98 and stores it in the location pointed to by argument
102 is not NULL, it will be used to store error information in case of an
107 stores the program address corresponding to the source line specified
110 into the location pointed to by argument
114 .Fn dwarf_linebeginstatement
115 sets the location pointed to by argument
117 to 1 if the source line specified by the line descriptor
119 is the beginning of a statement, or to 0 otherwise.
123 sets the location pointed to by argument
125 to 1 if the source line specified by the line descriptor
127 is the beginning of a basic block, or to 0 otherwise.
130 .Fn dwarf_lineendsequence
131 sets the location pointed to by argument
133 to 1 if the program address associated with the line descriptor
135 is the address immediately following the end of a sequence of target
136 machine instructions, or to 0 otherwise.
140 stores the line number of the source line associated with the line
143 into the location pointed to by argument
148 stores the column number within a line associated with descriptor
150 into the location pointed to by argument
152 The retrieved column numbers are 1-based, with the value -1 indicating
153 that column number information was not available.
157 stores a pointer to a NUL-terminated string containing the source file
158 name associated with line descriptor
160 into the location pointed to by argument
162 The full path of the source file is returned if possible.
163 The memory used for the source file name string is managed by the DWARF(3)
164 library and should not be directly freed by application code.
165 Instead, portable code should use
167 to indicate that the string should be freed.
170 .Fn dwarf_line_srcfileno
171 stores the index of the source file associated with the line descriptor
173 in the location pointed to by argument
175 The returned value is 1-based index into the array of source file
177 .Xr dwarf_srcfiles 3 .
179 On success, these functions returns
181 In case of an error, they return
186 These functions may fail with the following errors:
187 .Bl -tag -width ".Bq Er DW_DLE_LINE_FILE_NUM_BAD"
188 .It Bq Er DW_DLE_ARGUMENT
189 Either of the arguments
194 .It Bq Er DW_DLE_LINE_FILE_NUM_BAD
195 The source file name associated with the line descriptor
197 could not be retrieved by function
202 .Xr dwarf_dealloc 3 ,
203 .Xr dwarf_srcfiles 3 ,