DWARF_SRCFILES(3)
π NAME π
Okay so this is DWARF_SRCFILES(3), straight out of the Library Functions Manual, and it's the moment where dwarf_srcfiles β retrieve source file information β gets its main character energy. β¨
π LIBRARY π
DWARF Access Library (libdwarf, -ldwarf) π«Ά
β¨ SYNOPSIS β¨
#include <libdwarf.h>
int
dwarf_srcfiles(Dwarf_Die die, char ***filenames,
Dwarf_Signed *filenamecount, Dwarf_Error *err);
πΈ DESCRIPTION πΈ
Function dwarf_srcfiles() returns the source file names associated with a compilation unit. Source file names are returned as an array of NUL-terminated strings. No cap. π
Argument die should reference a DWARF debugging information entry descriptor with source file information, see dwarf(3). Argument filenames should point to a location that will hold a pointer to the returned array of file names. Argument filenamecount should point to a location that will hold the number of file names returned. If argument err is not NULL, it will be used to store error information in case of an error. π
π§ Memory Management π§
The memory areas used for the file names and for array of pointers being returned are managed by the DWARF(3) library. The application should not attempt to directly free these memory areas. Portable code should indicate that the memory areas are to be freed by using dwarf_dealloc(3). So like, do not go rogue and free it yourself, bestie β use the official dealloc route. π«Ά
π«Ά RETURN VALUES π«Ά
Function dwarf_srcfiles() returns DW_DLV_OK when it succeeds. In case of an error, it returns DW_DLV_ERROR and sets the argument err. That's the vibe check: OK means slay, ERROR means check err. π
π ERRORS π
Function dwarf_srcfiles() can fail with:
[DW_DLE_ARGUMENT]β one of the argumentsdie,filenamesorfilenamecountwasNULL.[DW_DLE_NO_ENTRY]β the compilation unit referenced by argumentdiedoes not have associated source file information.[DW_DLE_MEMORY]β an out of memory condition was encountered during the execution of this function.
π SEE ALSO π
dwarf(3), dwarf_dealloc(3), dwarf_srclines(3)
xoxo, your Debian bestie π β DWARF_SRCFILES(3) is dated April 28, 2010, and this page is signing off with source/version Debian. πβ¨
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: libdwarf 15.0.0
- Copyright (c) 2010 Joseph Koshy. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms