xref: /freebsd/contrib/elftoolchain/libdwarf/dwarf_srcfiles.3 (revision ae500c1ff8974130f7f2692772cf288b90349e0d)
12de3b87aSKai Wang.\" Copyright (c) 2010 Joseph Koshy.  All rights reserved.
22de3b87aSKai Wang.\"
32de3b87aSKai Wang.\" Redistribution and use in source and binary forms, with or without
42de3b87aSKai Wang.\" modification, are permitted provided that the following conditions
52de3b87aSKai Wang.\" are met:
62de3b87aSKai Wang.\" 1. Redistributions of source code must retain the above copyright
72de3b87aSKai Wang.\"    notice, this list of conditions and the following disclaimer.
82de3b87aSKai Wang.\" 2. Redistributions in binary form must reproduce the above copyright
92de3b87aSKai Wang.\"    notice, this list of conditions and the following disclaimer in the
102de3b87aSKai Wang.\"    documentation and/or other materials provided with the distribution.
112de3b87aSKai Wang.\"
122de3b87aSKai Wang.\" This software is provided by Joseph Koshy ``as is'' and
132de3b87aSKai Wang.\" any express or implied warranties, including, but not limited to, the
142de3b87aSKai Wang.\" implied warranties of merchantability and fitness for a particular purpose
152de3b87aSKai Wang.\" are disclaimed.  in no event shall Joseph Koshy be liable
162de3b87aSKai Wang.\" for any direct, indirect, incidental, special, exemplary, or consequential
172de3b87aSKai Wang.\" damages (including, but not limited to, procurement of substitute goods
182de3b87aSKai Wang.\" or services; loss of use, data, or profits; or business interruption)
192de3b87aSKai Wang.\" however caused and on any theory of liability, whether in contract, strict
202de3b87aSKai Wang.\" liability, or tort (including negligence or otherwise) arising in any way
212de3b87aSKai Wang.\" out of the use of this software, even if advised of the possibility of
222de3b87aSKai Wang.\" such damage.
232de3b87aSKai Wang.\"
24*ae500c1fSEd Maste.\" $Id: dwarf_srcfiles.3 3640 2018-10-14 14:09:13Z jkoshy $
252de3b87aSKai Wang.\"
262de3b87aSKai Wang.Dd April 28, 2010
272de3b87aSKai Wang.Dt DWARF_SRCFILES 3
28*ae500c1fSEd Maste.Os
292de3b87aSKai Wang.Sh NAME
302de3b87aSKai Wang.Nm dwarf_srcfiles
312de3b87aSKai Wang.Nd retrieve source file information
322de3b87aSKai Wang.Sh LIBRARY
332de3b87aSKai Wang.Lb libdwarf
342de3b87aSKai Wang.Sh SYNOPSIS
352de3b87aSKai Wang.In libdwarf.h
362de3b87aSKai Wang.Ft int
372de3b87aSKai Wang.Fo dwarf_srcfiles
382de3b87aSKai Wang.Fa "Dwarf_Die die"
392de3b87aSKai Wang.Fa "char ***filenames"
402de3b87aSKai Wang.Fa "Dwarf_Signed *filenamecount"
412de3b87aSKai Wang.Fa "Dwarf_Error *err"
422de3b87aSKai Wang.Fc
432de3b87aSKai Wang.Sh DESCRIPTION
442de3b87aSKai WangFunction
452de3b87aSKai Wang.Fn dwarf_srcfiles
462de3b87aSKai Wangreturns the source file names associated with a compilation unit.
472de3b87aSKai WangSource file names are returned as an array of NUL-terminated strings.
482de3b87aSKai Wang.Pp
492de3b87aSKai WangArgument
502de3b87aSKai Wang.Ar die
512de3b87aSKai Wangshould reference a DWARF debugging information entry descriptor with
522de3b87aSKai Wangsource file information, see
532de3b87aSKai Wang.Xr dwarf 3 .
542de3b87aSKai WangArgument
552de3b87aSKai Wang.Ar filenames
562de3b87aSKai Wangshould point to a location that will hold a pointer to the returned array
572de3b87aSKai Wangof file names.
582de3b87aSKai WangArgument
592de3b87aSKai Wang.Ar filenamecount
602de3b87aSKai Wangshould point to a location that will hold the number of file names returned.
612de3b87aSKai WangIf argument
622de3b87aSKai Wang.Ar err
632de3b87aSKai Wangis not NULL, it will be used to store error information in case of an
642de3b87aSKai Wangerror.
652de3b87aSKai Wang.Ss Memory Management
662de3b87aSKai WangThe memory areas used for the file names and for array of pointers
672de3b87aSKai Wangbeing returned are managed by the DWARF(3) library.
682de3b87aSKai WangThe application should not attempt to directly free these memory areas.
692de3b87aSKai WangPortable code should indicate that the memory areas are to be freed
702de3b87aSKai Wangby using
712de3b87aSKai Wang.Xr dwarf_dealloc 3 .
722de3b87aSKai Wang.Sh RETURN VALUES
732de3b87aSKai WangFunction
742de3b87aSKai Wang.Fn dwarf_srcfiles
752de3b87aSKai Wangreturns
762de3b87aSKai Wang.Dv DW_DLV_OK
772de3b87aSKai Wangwhen it succeeds.
782de3b87aSKai WangIn case of an error, it returns
792de3b87aSKai Wang.Dv DW_DLV_ERROR
802de3b87aSKai Wangand sets the argument
812de3b87aSKai Wang.Ar err .
822de3b87aSKai Wang.Sh ERRORS
832de3b87aSKai WangFunction
842de3b87aSKai Wang.Fn dwarf_srcfiles
852de3b87aSKai Wangcan fail with:
862de3b87aSKai Wang.Bl -tag -width ".Bq Er DW_DLE_ARGUMENT"
872de3b87aSKai Wang.It Bq Er DW_DLE_ARGUMENT
882de3b87aSKai WangOne of the arguments
892de3b87aSKai Wang.Ar die ,
902de3b87aSKai Wang.Ar filenames
912de3b87aSKai Wangor
922de3b87aSKai Wang.Ar filenamecount
932de3b87aSKai Wangwas NULL.
942de3b87aSKai Wang.It Bq Er DW_DLE_NO_ENTRY
952de3b87aSKai WangThe compilation unit referenced by argument
962de3b87aSKai Wang.Ar die
972de3b87aSKai Wangdoes not have associated source file information.
982de3b87aSKai Wang.It Bq Er DW_DLE_MEMORY
992de3b87aSKai WangAn out of memory condition was encountered during the execution of
1002de3b87aSKai Wangthis function.
1012de3b87aSKai Wang.El
1022de3b87aSKai Wang.Sh SEE ALSO
1032de3b87aSKai Wang.Xr dwarf 3 ,
1042de3b87aSKai Wang.Xr dwarf_dealloc 3 ,
1052de3b87aSKai Wang.Xr dwarf_srclines 3
106