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_types.h"
00046 #include "dwarf_global.h"
00047
00048 int
00049 dwarf_get_types(Dwarf_Debug dbg,
00050 Dwarf_Type ** types,
00051 Dwarf_Signed * ret_type_count, Dwarf_Error * error)
00052 {
00053 int res;
00054
00055 res =
00056 _dwarf_load_section(dbg,
00057 dbg->de_debug_typenames_index,
00058 &dbg->de_debug_typenames,
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_typenames, dbg->de_debug_typenames_size, (Dwarf_Global **) types,
00065
00066
00067
00068
00069
00070
00071 ret_type_count,
00072 error,
00073 DW_DLA_TYPENAME_CONTEXT,
00074 DW_DLE_DEBUG_TYPENAMES_LENGTH_BAD,
00075 DW_DLE_DEBUG_TYPENAMES_VERSION_ERROR);
00076
00077 }
00078
00079
00080 int
00081 dwarf_typename(Dwarf_Type type_in, char **ret_name, Dwarf_Error * error)
00082 {
00083 Dwarf_Global type = (Dwarf_Global) type_in;
00084
00085 if (type == NULL) {
00086 _dwarf_error(NULL, error, DW_DLE_TYPE_NULL);
00087 return (DW_DLV_ERROR);
00088 }
00089
00090 *ret_name = (char *) (type->gl_name);
00091 return DW_DLV_OK;
00092 }
00093
00094
00095 int
00096 dwarf_type_die_offset(Dwarf_Type type_in,
00097 Dwarf_Off * ret_offset, Dwarf_Error * error)
00098 {
00099 Dwarf_Global type = (Dwarf_Global) type_in;
00100
00101 return dwarf_global_die_offset(type, ret_offset, error);
00102 }
00103
00104
00105 int
00106 dwarf_type_cu_offset(Dwarf_Type type_in,
00107 Dwarf_Off * ret_offset, Dwarf_Error * error)
00108 {
00109 Dwarf_Global type = (Dwarf_Global) type_in;
00110
00111 return dwarf_global_cu_offset(type, ret_offset, error);
00112
00113 }
00114
00115
00116 int
00117 dwarf_type_name_offsets(Dwarf_Type type_in,
00118 char **returned_name,
00119 Dwarf_Off * die_offset,
00120 Dwarf_Off * cu_die_offset, Dwarf_Error * error)
00121 {
00122 Dwarf_Global type = (Dwarf_Global) type_in;
00123
00124 return dwarf_global_name_offsets(type,
00125 returned_name,
00126 die_offset, cu_die_offset, error);
00127 }