00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #include "config.h"
00043 #include "dwarf_incl.h"
00044 #include <stdio.h>
00045 #include "dwarf_weaks.h"
00046 #include "dwarf_global.h"
00047
00048 int
00049 dwarf_get_weaks(Dwarf_Debug dbg,
00050 Dwarf_Weak ** weaks,
00051 Dwarf_Signed * ret_weak_count, Dwarf_Error * error)
00052 {
00053 int res;
00054
00055 res =
00056 _dwarf_load_section(dbg,
00057 dbg->de_debug_weaknames_index,
00058 &dbg->de_debug_weaknames,
00059 error);
00060 if (res != DW_DLV_OK) {
00061 return res;
00062 }
00063
00064 return _dwarf_internal_get_pubnames_like_data(dbg, dbg->de_debug_weaknames, dbg->de_debug_weaknames_size, (Dwarf_Global **) weaks,
00065
00066
00067
00068
00069
00070
00071 ret_weak_count,
00072 error,
00073 DW_DLA_WEAK_CONTEXT,
00074 DW_DLE_DEBUG_WEAKNAMES_LENGTH_BAD,
00075 DW_DLE_DEBUG_WEAKNAMES_VERSION_ERROR);
00076
00077 }
00078
00079
00080
00081 int
00082 dwarf_weakname(Dwarf_Weak weak_in, char **ret_name, Dwarf_Error * error)
00083 {
00084 Dwarf_Global weak = (Dwarf_Global) weak_in;
00085
00086 if (weak == NULL) {
00087 _dwarf_error(NULL, error, DW_DLE_WEAK_NULL);
00088 return (DW_DLV_ERROR);
00089 }
00090 *ret_name = (char *) (weak->gl_name);
00091 return DW_DLV_OK;
00092 }
00093
00094
00095 int
00096 dwarf_weak_die_offset(Dwarf_Weak weak_in,
00097 Dwarf_Off * weak_off, Dwarf_Error * error)
00098 {
00099 Dwarf_Global weak = (Dwarf_Global) weak_in;
00100
00101 return dwarf_global_die_offset(weak, weak_off, error);
00102 }
00103
00104
00105 int
00106 dwarf_weak_cu_offset(Dwarf_Weak weak_in,
00107 Dwarf_Off * weak_off, Dwarf_Error * error)
00108 {
00109 Dwarf_Global weak = (Dwarf_Global) weak_in;
00110
00111 return dwarf_global_cu_offset(weak, weak_off, error);
00112 }
00113
00114
00115 int
00116 dwarf_weak_name_offsets(Dwarf_Weak weak_in,
00117 char **weak_name,
00118 Dwarf_Off * die_offset,
00119 Dwarf_Off * cu_offset, Dwarf_Error * error)
00120 {
00121 Dwarf_Global weak = (Dwarf_Global) weak_in;
00122
00123 return dwarf_global_name_offsets(weak,
00124 weak_name,
00125 die_offset, cu_offset, error);
00126 }