Ulrich Drepper | b08d5a8 | 2005-07-26 05:00:05 +0000 | [diff] [blame^] | 1 | /* Fetch the CU DIE for a PC address in a given 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 | Dwarf_Die * |
| 17 | dwfl_module_addrdie (Dwfl_Module *mod, Dwarf_Addr addr, Dwarf_Addr *bias) |
| 18 | { |
| 19 | if (INTUSE(dwfl_module_getdwarf) (mod, bias) == NULL) |
| 20 | return NULL; |
| 21 | |
| 22 | struct dwfl_cu *cu; |
| 23 | Dwfl_Error error = __libdwfl_addrcu (mod, addr, &cu); |
| 24 | if (likely (error == DWFL_E_NOERROR)) |
| 25 | return &cu->die; |
| 26 | |
| 27 | __libdwfl_seterrno (error); |
| 28 | return NULL; |
| 29 | } |
| 30 | INTDEF (dwfl_module_addrdie) |