diff options
| author | Mark Wielaard <[email protected]> | 2014-05-01 14:48:27 +0200 |
|---|---|---|
| committer | Mark Wielaard <[email protected]> | 2014-05-02 17:00:48 +0200 |
| commit | df85bf99021119fcbb2ced66dd69f1cceafb180c (patch) | |
| tree | a0ee033052e69b9b00e87ee31bf4962dac3cec17 /libdwfl/linux-kernel-modules.c | |
| parent | d81d32d2a4f92355e4c677b578147dfe819251b9 (diff) | |
libdwfl: Move dwz alt multi file searching to find_debuginfo callback.
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]>
Diffstat (limited to 'libdwfl/linux-kernel-modules.c')
| -rw-r--r-- | libdwfl/linux-kernel-modules.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libdwfl/linux-kernel-modules.c b/libdwfl/linux-kernel-modules.c index 53075183..1ad7d2f6 100644 --- a/libdwfl/linux-kernel-modules.c +++ b/libdwfl/linux-kernel-modules.c @@ -1,5 +1,5 @@ /* Standard libdwfl callbacks for debugging the running Linux kernel. - Copyright (C) 2005-2011, 2013 Red Hat, Inc. + Copyright (C) 2005-2011, 2013, 2014 Red Hat, Inc. This file is part of elfutils. This file is free software; you can redistribute it and/or modify @@ -88,23 +88,22 @@ try_kernel_name (Dwfl *dwfl, char **fname, bool try_debug) if (fd < 0) { - char *debugfname = NULL; Dwfl_Module fakemod = { .dwfl = dwfl }; /* First try the file's unadorned basename as DEBUGLINK_FILE, to look for "vmlinux" files. */ fd = INTUSE(dwfl_standard_find_debuginfo) (&fakemod, NULL, NULL, 0, *fname, basename (*fname), 0, - &debugfname); + &fakemod.debug.name); if (fd < 0 && try_debug) /* Next, let the call use the default of basename + ".debug", to look for "vmlinux.debug" files. */ fd = INTUSE(dwfl_standard_find_debuginfo) (&fakemod, NULL, NULL, 0, *fname, NULL, 0, - &debugfname); - if (debugfname != NULL) + &fakemod.debug.name); + if (fakemod.debug.name != NULL) { free (*fname); - *fname = debugfname; + *fname = fakemod.debug.name; } } |
