summaryrefslogtreecommitdiffstats
path: root/libdw/dwarf_setalt.c
Commit message (Collapse)AuthorAgeFilesLines
* libdw: Resolve alt file on first use.Mark Wielaard2018-01-251-1/+10
| | | | | | | | | | | | | | | | | | | | | Add a new alt_fd field to the Dwarf struct. This tracks whether we tried to open the alt file ourselves. This is used in dwarf_getalt to see if we should try to find and open the alt file ourselves (if the user hasn't called dwarf_setalt yet). dwarf_formref_die and dwarf_formstring now call dwarf_getalt instead of accessing the alt_dwarf Dwarf field directly. For applications using libdwfl nothing changes (dwfl will find, set and clean up the alt file). For programs that set the alt file themselves already through other means, nothing changes. But for applications that don't create the Dwarf through libdwfl and don't set the alt file already libdw will now try to find and set it on first access. If found the application will now not get errors for missing alt files. Add a simple testcase based on the existing allfcts test which already tries to set the alt file, but is too simplistic to find it in some subdir (relative to the main debug file). Signed-off-by: Mark Wielaard <[email protected]>
* libdwfl: Move dwz alt multi file searching to find_debuginfo callback.Mark Wielaard2014-05-021-3/+0
| | | | | | | | | | Don't hard code the Dwarf dwz alt multi file search but allow the user to override it through the standard Dwfl_Callbacks. Also move ownership completely to the user of dwarf_setalt by removing free_alt from Dwarf and adding alt, fd and elf fields to Dwfl_Module. Add a relative .dwz file test case. Signed-off-by: Mark Wielaard <[email protected]>
* libdw: Add dwarf_getalt, dwarf_setaltFlorian Weimer2014-04-241-0/+43
Signed-off-by: Florian Weimer <[email protected]>