* construct mappings from each TU to "vmlinux".
*/
- Dwfl *dwfl = simple_dwfl_new(builtin_objects[i]);
+ Dwfl *dwfl = simple_dwfl_new(builtin_objects[i], NULL);
Dwarf_Die *tu = NULL;
Dwarf_Addr junk;
* mappings from each TU to the module name.
*/
- Dwfl *dwfl = simple_dwfl_new(builtin_modules[i]);
+ Dwfl *dwfl = simple_dwfl_new(builtin_modules[i], NULL);
Dwarf_Die *tu = NULL;
Dwarf_Addr junk;
char *fn_module_name = fn_to_module(file_name);
const char *module_name = fn_module_name;
- Dwfl *dwfl = simple_dwfl_new(file_name);
+ Dwfl *dwfl = simple_dwfl_new(file_name, NULL);
GHashTable *seen_before = g_hash_table_new_full(g_str_hash, g_str_equal,
free, free);
Dwarf_Die *tu_die = NULL;
/*
* Convenience wrappers for functions in elfutils.
*
- * (C) 2014 Oracle, Inc. All rights reserved.
+ * (C) 2014, 2017 Oracle, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
* Wrap up dwfl_new() complexities.
*/
-Dwfl *simple_dwfl_new(const char *file_name)
+Dwfl *simple_dwfl_new(const char *file_name, Dwfl_Module **module)
{
const char *err;
static Dwfl_Callbacks cb = { .find_debuginfo = no_debuginfo,
.section_address = dwfl_offline_section_address };
Dwfl *dwfl = dwfl_begin(&cb);
+ Dwfl_Module *mod;
if (dwfl == NULL) {
err = "initialize libdwfl";
goto fail;
}
- if (private_dwfl_report_elf(dwfl, "", file_name, -1, 0) == NULL) {
+ mod = private_dwfl_report_elf(dwfl, "", file_name, -1, 0);
+ if (mod == NULL) {
err = "open object file with libdwfl";
goto fail;
}
+ if (module)
+ *module = mod;
if (dwfl_report_end(dwfl, NULL, NULL) != 0) {
err = "finish opening object file with libdwfl";
/*
* Simplifying wrappers for functions in elfutils.
*
- * (C) 2014 Oracle, Inc. All rights reserved.
+ * (C) 2014, 2017 Oracle, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
/*
* Wrap up dwfl_new() complexities.
*/
-Dwfl *simple_dwfl_new(const char *file_name);
+Dwfl *simple_dwfl_new(const char *file_name, Dwfl_Module **module);
/*
* The converse of simple_dwfl_new().
const char *module_path,
GHashTable *module_symbol_seen)
{
- Dwfl *dwfl = simple_dwfl_new(module_path);
+ Dwfl *dwfl = simple_dwfl_new(module_path, NULL);
Dwarf_Die *tu = NULL;
Dwarf_Addr junk;
unsigned int *module_idx = NULL;