diff options
Diffstat (limited to 'usr/src/tools/ctf/dwarf/common/dwarf_weaks.c')
-rw-r--r-- | usr/src/tools/ctf/dwarf/common/dwarf_weaks.c | 76 |
1 files changed, 42 insertions, 34 deletions
diff --git a/usr/src/tools/ctf/dwarf/common/dwarf_weaks.c b/usr/src/tools/ctf/dwarf/common/dwarf_weaks.c index addd6cfd6f..425916e62e 100644 --- a/usr/src/tools/ctf/dwarf/common/dwarf_weaks.c +++ b/usr/src/tools/ctf/dwarf/common/dwarf_weaks.c @@ -1,6 +1,7 @@ /* - Copyright (C) 2000, 2002 Silicon Graphics, Inc. All Rights Reserved. + Copyright (C) 2000-2005 Silicon Graphics, Inc. All Rights Reserved. + Portions Copyright (C) 2009-2010 David Anderson. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of version 2.1 of the GNU Lesser General Public License @@ -19,10 +20,10 @@ You should have received a copy of the GNU Lesser General Public License along with this program; if not, write the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301, USA. - Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky, + Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane, Mountain View, CA 94043, or: http://www.sgi.com @@ -43,33 +44,41 @@ int dwarf_get_weaks(Dwarf_Debug dbg, - Dwarf_Weak ** weaks, - Dwarf_Signed * ret_weak_count, Dwarf_Error * error) + Dwarf_Weak ** weaks, + Dwarf_Signed * ret_weak_count, Dwarf_Error * error) { - int res; - - res = - _dwarf_load_section(dbg, - dbg->de_debug_weaknames_index, - &dbg->de_debug_weaknames, - error); + int res = _dwarf_load_section(dbg, &dbg->de_debug_weaknames,error); if (res != DW_DLV_OK) { - return res; + return res; } - return _dwarf_internal_get_pubnames_like_data(dbg, dbg->de_debug_weaknames, dbg->de_debug_weaknames_size, (Dwarf_Global **) weaks, /* type - punning, - Dwarf_Type - is never - a - completed - type */ - ret_weak_count, - error, - DW_DLA_WEAK_CONTEXT, - DW_DLE_DEBUG_WEAKNAMES_LENGTH_BAD, - DW_DLE_DEBUG_WEAKNAMES_VERSION_ERROR); + return _dwarf_internal_get_pubnames_like_data(dbg, + dbg->de_debug_weaknames.dss_data, + dbg->de_debug_weaknames.dss_size, + (Dwarf_Global **) weaks, /* Type punning for sections + with identical format. */ + ret_weak_count, + error, + DW_DLA_WEAK_CONTEXT, + DW_DLA_WEAK, + DW_DLE_DEBUG_WEAKNAMES_LENGTH_BAD, + DW_DLE_DEBUG_WEAKNAMES_VERSION_ERROR); +} +/* Deallocating fully requires deallocating the list + and all entries. But some internal data is + not exposed, so we need a function with internal knowledge. +*/ + +void +dwarf_weaks_dealloc(Dwarf_Debug dbg, Dwarf_Weak * dwgl, + Dwarf_Signed count) +{ + _dwarf_internal_globals_dealloc(dbg, (Dwarf_Global *) dwgl, + count, + DW_DLA_WEAK_CONTEXT, + DW_DLA_WEAK, DW_DLA_LIST); + return; } @@ -80,8 +89,8 @@ dwarf_weakname(Dwarf_Weak weak_in, char **ret_name, Dwarf_Error * error) Dwarf_Global weak = (Dwarf_Global) weak_in; if (weak == NULL) { - _dwarf_error(NULL, error, DW_DLE_WEAK_NULL); - return (DW_DLV_ERROR); + _dwarf_error(NULL, error, DW_DLE_WEAK_NULL); + return (DW_DLV_ERROR); } *ret_name = (char *) (weak->gl_name); return DW_DLV_OK; @@ -90,7 +99,7 @@ dwarf_weakname(Dwarf_Weak weak_in, char **ret_name, Dwarf_Error * error) int dwarf_weak_die_offset(Dwarf_Weak weak_in, - Dwarf_Off * weak_off, Dwarf_Error * error) + Dwarf_Off * weak_off, Dwarf_Error * error) { Dwarf_Global weak = (Dwarf_Global) weak_in; @@ -100,7 +109,7 @@ dwarf_weak_die_offset(Dwarf_Weak weak_in, int dwarf_weak_cu_offset(Dwarf_Weak weak_in, - Dwarf_Off * weak_off, Dwarf_Error * error) + Dwarf_Off * weak_off, Dwarf_Error * error) { Dwarf_Global weak = (Dwarf_Global) weak_in; @@ -110,13 +119,12 @@ dwarf_weak_cu_offset(Dwarf_Weak weak_in, int dwarf_weak_name_offsets(Dwarf_Weak weak_in, - char **weak_name, - Dwarf_Off * die_offset, - Dwarf_Off * cu_offset, Dwarf_Error * error) + char **weak_name, + Dwarf_Off * die_offset, + Dwarf_Off * cu_offset, Dwarf_Error * error) { Dwarf_Global weak = (Dwarf_Global) weak_in; return dwarf_global_name_offsets(weak, - weak_name, - die_offset, cu_offset, error); + weak_name, die_offset, cu_offset, error); } |