diff options
Diffstat (limited to 'libdwfl/dwfl_module_getdwarf.c')
-rw-r--r-- | libdwfl/dwfl_module_getdwarf.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libdwfl/dwfl_module_getdwarf.c b/libdwfl/dwfl_module_getdwarf.c index 9ba499bb..6f98c02b 100644 --- a/libdwfl/dwfl_module_getdwarf.c +++ b/libdwfl/dwfl_module_getdwarf.c @@ -1362,11 +1362,14 @@ load_dw (Dwfl_Module *mod, struct dwfl_file *debugfile) } /* We might have already closed the fd when we asked dwarf_begin_elf to - create an Dwarf. Help out a little in case we need to find an alt or - dwo file later. */ - if (mod->dw->debugdir == NULL && mod->elfdir != NULL + create an Dwarf. Help out a little in case we need to find an alt, + dwo, or dwp file later. */ + if (mod->dw->elfpath == NULL && mod->elfpath != NULL && debugfile == &mod->main) - mod->dw->debugdir = strdup (mod->elfdir); + { + mod->dw->elfpath = strdup (mod->elfpath); + __libdw_set_debugdir (mod->dw); + } /* Until we have iterated through all CU's, we might do lazy lookups. */ mod->lazycu = 1; |