On Tue, 2013-12-17 at 21:32 +0100, Jan Kratochvil wrote: > I believe if executable_for_core is set it means the Dwfl is really for a core > file and the executable has been explicitly set by the user. Therefore it > should override/precede any searches.
Agreed. > I was experimenting also with replacing [exe]/[pie] by executable_for_core but > I do not see any end-user visible benefit from it and it is also an unrelated > patch. Yeah. > OK for check-in? Yes, with one small nitpick about the moved comment. > libdwfl/ > 2013-12-17 Jan Kratochvil <[email protected]> > > * argp-std.c (offline_find_elf): Remove. > (offline_callbacks): Use dwfl_build_id_find_elf instead. > * dwfl_build_id_find_elf.c (dwfl_build_id_find_elf): Move here the code > removed above. > [...] > > static const Dwfl_Callbacks proc_callbacks = > > diff --git a/libdwfl/dwfl_build_id_find_elf.c > > b/libdwfl/dwfl_build_id_find_elf.c > > index 9272c1f..86e97d0 100644 > > --- a/libdwfl/dwfl_build_id_find_elf.c > > +++ b/libdwfl/dwfl_build_id_find_elf.c > > @@ -116,6 +116,23 @@ dwfl_build_id_find_elf (Dwfl_Module *mod, > > char **file_name, Elf **elfp) > > { > > *elfp = NULL; > > + if (modname != NULL && mod->dwfl->executable_for_core != NULL > > + && (strcmp (modname, "[exe]") == 0 || strcmp (modname, "[pie]") == > > 0)) > > + { > > + /* When both --core and --executable are given dwfl_core_file_report > > is > > + called first and this callback will replace the Dwfl_Module > > main.name > > + with the recorded --executable file when the modname is [exe] or > > [pie] > > + (which then triggers opening and reporting of the executable). */ This should now mention "When dwfl_core_file_report was called with a non-NULL executable file name..." instead of the argp argument switches. Thanks, Mark
