|
Packit Service |
97d2fb |
/* Return information about a module.
|
|
Packit Service |
97d2fb |
Copyright (C) 2005-2010 Red Hat, Inc.
|
|
Packit Service |
97d2fb |
This file is part of elfutils.
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
This file is free software; you can redistribute it and/or modify
|
|
Packit Service |
97d2fb |
it under the terms of either
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
* the GNU Lesser General Public License as published by the Free
|
|
Packit Service |
97d2fb |
Software Foundation; either version 3 of the License, or (at
|
|
Packit Service |
97d2fb |
your option) any later version
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
or
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
* the GNU General Public License as published by the Free
|
|
Packit Service |
97d2fb |
Software Foundation; either version 2 of the License, or (at
|
|
Packit Service |
97d2fb |
your option) any later version
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
or both in parallel, as here.
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
elfutils is distributed in the hope that it will be useful, but
|
|
Packit Service |
97d2fb |
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
97d2fb |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
97d2fb |
General Public License for more details.
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
You should have received copies of the GNU General Public License and
|
|
Packit Service |
97d2fb |
the GNU Lesser General Public License along with this program. If
|
|
Packit Service |
97d2fb |
not, see <http://www.gnu.org/licenses/>. */
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
#ifdef HAVE_CONFIG_H
|
|
Packit Service |
97d2fb |
# include <config.h>
|
|
Packit Service |
97d2fb |
#endif
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
#include "libdwflP.h"
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
const char *
|
|
Packit Service |
97d2fb |
dwfl_module_info (Dwfl_Module *mod, void ***userdata,
|
|
Packit Service |
97d2fb |
Dwarf_Addr *start, Dwarf_Addr *end,
|
|
Packit Service |
97d2fb |
Dwarf_Addr *dwbias, Dwarf_Addr *symbias,
|
|
Packit Service |
97d2fb |
const char **mainfile, const char **debugfile)
|
|
Packit Service |
97d2fb |
{
|
|
Packit Service |
97d2fb |
if (mod == NULL)
|
|
Packit Service |
97d2fb |
return NULL;
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
if (userdata)
|
|
Packit Service |
97d2fb |
*userdata = &mod->userdata;
|
|
Packit Service |
97d2fb |
if (start)
|
|
Packit Service |
97d2fb |
*start = mod->low_addr;
|
|
Packit Service |
97d2fb |
if (end)
|
|
Packit Service |
97d2fb |
*end = mod->high_addr;
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
if (dwbias)
|
|
Packit Service |
97d2fb |
*dwbias = (mod->debug.elf == NULL ? (Dwarf_Addr) -1
|
|
Packit Service |
97d2fb |
: dwfl_adjusted_dwarf_addr (mod, 0));
|
|
Packit Service |
97d2fb |
if (symbias)
|
|
Packit Service |
97d2fb |
*symbias = (mod->symfile == NULL ? (Dwarf_Addr) -1
|
|
Packit Service |
97d2fb |
: dwfl_adjusted_st_value (mod, mod->symfile->elf, 0));
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
if (mainfile)
|
|
Packit Service |
97d2fb |
*mainfile = mod->main.name;
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
if (debugfile)
|
|
Packit Service |
97d2fb |
*debugfile = mod->debug.name;
|
|
Packit Service |
97d2fb |
|
|
Packit Service |
97d2fb |
return mod->name;
|
|
Packit Service |
97d2fb |
}
|