xref: /minix3/external/bsd/elftoolchain/dist/libdwarf/dwarf_srcfiles.3 (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc.\"	$NetBSD: dwarf_srcfiles.3,v 1.2 2014/03/09 16:58:04 christos Exp $
2*0a6a1f1dSLionel Sambuc.\"
3*0a6a1f1dSLionel Sambuc.\" Copyright (c) 2010 Joseph Koshy.  All rights reserved.
4*0a6a1f1dSLionel Sambuc.\"
5*0a6a1f1dSLionel Sambuc.\" Redistribution and use in source and binary forms, with or without
6*0a6a1f1dSLionel Sambuc.\" modification, are permitted provided that the following conditions
7*0a6a1f1dSLionel Sambuc.\" are met:
8*0a6a1f1dSLionel Sambuc.\" 1. Redistributions of source code must retain the above copyright
9*0a6a1f1dSLionel Sambuc.\"    notice, this list of conditions and the following disclaimer.
10*0a6a1f1dSLionel Sambuc.\" 2. Redistributions in binary form must reproduce the above copyright
11*0a6a1f1dSLionel Sambuc.\"    notice, this list of conditions and the following disclaimer in the
12*0a6a1f1dSLionel Sambuc.\"    documentation and/or other materials provided with the distribution.
13*0a6a1f1dSLionel Sambuc.\"
14*0a6a1f1dSLionel Sambuc.\" This software is provided by Joseph Koshy ``as is'' and
15*0a6a1f1dSLionel Sambuc.\" any express or implied warranties, including, but not limited to, the
16*0a6a1f1dSLionel Sambuc.\" implied warranties of merchantability and fitness for a particular purpose
17*0a6a1f1dSLionel Sambuc.\" are disclaimed.  in no event shall Joseph Koshy be liable
18*0a6a1f1dSLionel Sambuc.\" for any direct, indirect, incidental, special, exemplary, or consequential
19*0a6a1f1dSLionel Sambuc.\" damages (including, but not limited to, procurement of substitute goods
20*0a6a1f1dSLionel Sambuc.\" or services; loss of use, data, or profits; or business interruption)
21*0a6a1f1dSLionel Sambuc.\" however caused and on any theory of liability, whether in contract, strict
22*0a6a1f1dSLionel Sambuc.\" liability, or tort (including negligence or otherwise) arising in any way
23*0a6a1f1dSLionel Sambuc.\" out of the use of this software, even if advised of the possibility of
24*0a6a1f1dSLionel Sambuc.\" such damage.
25*0a6a1f1dSLionel Sambuc.\"
26*0a6a1f1dSLionel Sambuc.\" Id: dwarf_srcfiles.3 2075 2011-10-27 03:47:28Z jkoshy
27*0a6a1f1dSLionel Sambuc.\"
28*0a6a1f1dSLionel Sambuc.Dd April 28, 2010
29*0a6a1f1dSLionel Sambuc.Os
30*0a6a1f1dSLionel Sambuc.Dt DWARF_SRCFILES 3
31*0a6a1f1dSLionel Sambuc.Sh NAME
32*0a6a1f1dSLionel Sambuc.Nm dwarf_srcfiles
33*0a6a1f1dSLionel Sambuc.Nd retrieve source file information
34*0a6a1f1dSLionel Sambuc.Sh LIBRARY
35*0a6a1f1dSLionel Sambuc.Lb libdwarf
36*0a6a1f1dSLionel Sambuc.Sh SYNOPSIS
37*0a6a1f1dSLionel Sambuc.In libdwarf.h
38*0a6a1f1dSLionel Sambuc.Ft int
39*0a6a1f1dSLionel Sambuc.Fo dwarf_srcfiles
40*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Die die"
41*0a6a1f1dSLionel Sambuc.Fa "char ***filenames"
42*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Signed *filenamecount"
43*0a6a1f1dSLionel Sambuc.Fa "Dwarf_Error *err"
44*0a6a1f1dSLionel Sambuc.Fc
45*0a6a1f1dSLionel Sambuc.Sh DESCRIPTION
46*0a6a1f1dSLionel SambucFunction
47*0a6a1f1dSLionel Sambuc.Fn dwarf_srcfiles
48*0a6a1f1dSLionel Sambucreturns the source file names associated with a compilation unit.
49*0a6a1f1dSLionel SambucSource file names are returned as an array of NUL-terminated strings.
50*0a6a1f1dSLionel Sambuc.Pp
51*0a6a1f1dSLionel SambucArgument
52*0a6a1f1dSLionel Sambuc.Ar die
53*0a6a1f1dSLionel Sambucshould reference a DWARF debugging information entry descriptor with
54*0a6a1f1dSLionel Sambucsource file information, see
55*0a6a1f1dSLionel Sambuc.Xr dwarf 3 .
56*0a6a1f1dSLionel SambucArgument
57*0a6a1f1dSLionel Sambuc.Ar filenames
58*0a6a1f1dSLionel Sambucshould point to a location that will hold a pointer to the returned array
59*0a6a1f1dSLionel Sambucof file names.
60*0a6a1f1dSLionel SambucArgument
61*0a6a1f1dSLionel Sambuc.Ar filenamecount
62*0a6a1f1dSLionel Sambucshould point to a location that will hold the number of file names returned.
63*0a6a1f1dSLionel SambucIf argument
64*0a6a1f1dSLionel Sambuc.Ar err
65*0a6a1f1dSLionel Sambucis not NULL, it will be used to store error information in case of an
66*0a6a1f1dSLionel Sambucerror.
67*0a6a1f1dSLionel Sambuc.Ss Memory Management
68*0a6a1f1dSLionel SambucThe memory areas used for the file names and for array of pointers
69*0a6a1f1dSLionel Sambucbeing returned are managed by the DWARF(3) library.
70*0a6a1f1dSLionel SambucThe application should not attempt to directly free these memory areas.
71*0a6a1f1dSLionel SambucPortable code should indicate that the memory areas are to be freed
72*0a6a1f1dSLionel Sambucby using
73*0a6a1f1dSLionel Sambuc.Xr dwarf_dealloc 3 .
74*0a6a1f1dSLionel Sambuc.Sh RETURN VALUES
75*0a6a1f1dSLionel SambucFunction
76*0a6a1f1dSLionel Sambuc.Fn dwarf_srcfiles
77*0a6a1f1dSLionel Sambucreturns
78*0a6a1f1dSLionel Sambuc.Dv DW_DLV_OK
79*0a6a1f1dSLionel Sambucwhen it succeeds.
80*0a6a1f1dSLionel SambucIn case of an error, it returns
81*0a6a1f1dSLionel Sambuc.Dv DW_DLV_ERROR
82*0a6a1f1dSLionel Sambucand sets the argument
83*0a6a1f1dSLionel Sambuc.Ar err .
84*0a6a1f1dSLionel Sambuc.Sh ERRORS
85*0a6a1f1dSLionel SambucFunction
86*0a6a1f1dSLionel Sambuc.Fn dwarf_srcfiles
87*0a6a1f1dSLionel Sambuccan fail with:
88*0a6a1f1dSLionel Sambuc.Bl -tag -width ".Bq Er DW_DLE_ARGUMENT"
89*0a6a1f1dSLionel Sambuc.It Bq Er DW_DLE_ARGUMENT
90*0a6a1f1dSLionel SambucOne of the arguments
91*0a6a1f1dSLionel Sambuc.Ar die ,
92*0a6a1f1dSLionel Sambuc.Ar filenames
93*0a6a1f1dSLionel Sambucor
94*0a6a1f1dSLionel Sambuc.Ar filenamecount
95*0a6a1f1dSLionel Sambucwas NULL.
96*0a6a1f1dSLionel Sambuc.It Bq Er DW_DLE_NO_ENTRY
97*0a6a1f1dSLionel SambucThe compilation unit referenced by argument
98*0a6a1f1dSLionel Sambuc.Ar die
99*0a6a1f1dSLionel Sambucdoes not have associated source file information.
100*0a6a1f1dSLionel Sambuc.It Bq Er DW_DLE_MEMORY
101*0a6a1f1dSLionel SambucAn out of memory condition was encountered during the execution of
102*0a6a1f1dSLionel Sambucthis function.
103*0a6a1f1dSLionel Sambuc.El
104*0a6a1f1dSLionel Sambuc.Sh SEE ALSO
105*0a6a1f1dSLionel Sambuc.Xr dwarf 3 ,
106*0a6a1f1dSLionel Sambuc.Xr dwarf_dealloc 3 ,
107*0a6a1f1dSLionel Sambuc.Xr dwarf_srclines 3
108