Ulrich Drepper | b08d5a8 | 2005-07-26 05:00:05 +0000 | [diff] [blame^] | 1 | /* Return information about a module. |
| 2 | Copyright (C) 2005 Red Hat, Inc. |
| 3 | |
| 4 | This program is Open Source software; you can redistribute it and/or |
| 5 | modify it under the terms of the Open Software License version 1.0 as |
| 6 | published by the Open Source Initiative. |
| 7 | |
| 8 | You should have received a copy of the Open Software License along |
| 9 | with this program; if not, you may obtain a copy of the Open Software |
| 10 | License version 1.0 from http://www.opensource.org/licenses/osl.php or |
| 11 | by writing the Open Source Initiative c/o Lawrence Rosen, Esq., |
| 12 | 3001 King Ranch Road, Ukiah, CA 95482. */ |
| 13 | |
| 14 | #include "libdwflP.h" |
| 15 | |
| 16 | const char * |
| 17 | dwfl_module_info (Dwfl_Module *mod, void ***userdata, |
| 18 | Dwarf_Addr *start, Dwarf_Addr *end, |
| 19 | Dwarf_Addr *dwbias, Dwarf_Addr *symbias, |
| 20 | const char **mainfile, const char **debugfile) |
| 21 | { |
| 22 | if (mod == NULL) |
| 23 | return NULL; |
| 24 | |
| 25 | if (userdata) |
| 26 | *userdata = &mod->userdata; |
| 27 | if (start) |
| 28 | *start = mod->low_addr; |
| 29 | if (end) |
| 30 | *end = mod->high_addr; |
| 31 | |
| 32 | if (dwbias) |
| 33 | *dwbias = mod->debug.elf == NULL ? (Dwarf_Addr) -1 : mod->debug.bias; |
| 34 | if (symbias) |
| 35 | *symbias = mod->symfile == NULL ? (Dwarf_Addr) -1 : mod->symfile->bias; |
| 36 | |
| 37 | if (mainfile) |
| 38 | *mainfile = mod->main.name; |
| 39 | |
| 40 | if (debugfile) |
| 41 | *debugfile = mod->debug.name; |
| 42 | |
| 43 | return mod->name; |
| 44 | } |