libdwarf_die.c (6cec9cad762b6476313fb1f8e931a1647822db6b) | libdwarf_die.c (cf781b2e16c26535788abe648f5917f4db09c123) |
---|---|
1/*- 2 * Copyright (c) 2007 John Birrell (jb@freebsd.org) 3 * Copyright (c) 2009-2011 Kai Wang 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 13 unchanged lines hidden (view full) --- 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27 28#include "_libdwarf.h" 29 | 1/*- 2 * Copyright (c) 2007 John Birrell (jb@freebsd.org) 3 * Copyright (c) 2009-2011 Kai Wang 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 13 unchanged lines hidden (view full) --- 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27 28#include "_libdwarf.h" 29 |
30ELFTC_VCSID("$Id: libdwarf_die.c 2948 2013-05-30 21:25:52Z kaiwang27 $"); | 30ELFTC_VCSID("$Id: libdwarf_die.c 3039 2014-05-18 15:10:56Z kaiwang27 $"); |
31 32int 33_dwarf_die_alloc(Dwarf_Debug dbg, Dwarf_Die *ret_die, Dwarf_Error *error) 34{ 35 Dwarf_Die die; 36 37 assert(ret_die != NULL); 38 --- 37 unchanged lines hidden (view full) --- 76 return (DW_DLE_NONE); 77} 78 79/* Find die at offset 'off' within the same CU. */ 80Dwarf_Die 81_dwarf_die_find(Dwarf_Die die, Dwarf_Unsigned off) 82{ 83 Dwarf_Debug dbg; | 31 32int 33_dwarf_die_alloc(Dwarf_Debug dbg, Dwarf_Die *ret_die, Dwarf_Error *error) 34{ 35 Dwarf_Die die; 36 37 assert(ret_die != NULL); 38 --- 37 unchanged lines hidden (view full) --- 76 return (DW_DLE_NONE); 77} 78 79/* Find die at offset 'off' within the same CU. */ 80Dwarf_Die 81_dwarf_die_find(Dwarf_Die die, Dwarf_Unsigned off) 82{ 83 Dwarf_Debug dbg; |
84 Dwarf_Section *ds; |
|
84 Dwarf_CU cu; 85 Dwarf_Die die1; 86 Dwarf_Error de; 87 int ret; 88 89 cu = die->die_cu; 90 dbg = die->die_dbg; | 85 Dwarf_CU cu; 86 Dwarf_Die die1; 87 Dwarf_Error de; 88 int ret; 89 90 cu = die->die_cu; 91 dbg = die->die_dbg; |
92 ds = cu->cu_is_info ? dbg->dbg_info_sec : dbg->dbg_types_sec; |
|
91 | 93 |
92 ret = _dwarf_die_parse(dbg, dbg->dbg_info_sec, cu, cu->cu_dwarf_size, 93 off, cu->cu_next_offset, &die1, 0, &de); | 94 ret = _dwarf_die_parse(dbg, ds, cu, cu->cu_dwarf_size, off, 95 cu->cu_next_offset, &die1, 0, &de); |
94 95 if (ret == DW_DLE_NONE) 96 return (die1); 97 else 98 return (NULL); 99} 100 101int --- 354 unchanged lines hidden --- | 96 97 if (ret == DW_DLE_NONE) 98 return (die1); 99 else 100 return (NULL); 101} 102 103int --- 354 unchanged lines hidden --- |