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 #ifndef pu_info_INCLUDED
00041 #define pu_info_INCLUDED
00042
00043 #include <elf.h>
00044
00045 #include "dwarf_DST_mem.h"
00046
00047 #if 0
00048 #ifndef _symtab_INCLUDED
00049 #include "symtab.h"
00050 #endif
00051 #endif
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067 #define PU_HEADER_VERSION 1
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081 #define WT_SYMTAB 0x0
00082 #define WT_TREE 0x1
00083 #define WT_DEPGRAPH 0x2
00084 #define WT_PREFETCH 0x3
00085 #define WT_REGIONS 0x4
00086 #define WT_FEEDBACK 0x5
00087 #define WT_FREQ 0x6
00088 #define WT_AC_INTERNAL 0x7
00089 #define WT_ALIAS_CLASS 0x8
00090
00091 #define WT_SUBSECTIONS 0x9
00092 #define WT_LAST WT_SUBSECTIONS
00093 #define WT_PROC_SYM -1
00094
00095
00096
00097
00098 #define PU_HAS_GLOBALS 0x1
00099
00100 #define PU_HAS_NESTED_PU 0x2
00101 #define PU_IS_COMPILER_GENERATED 0x4
00102 #define PU_IS_DRA_CLONE 0x8
00103 #define PU_PREGS_RENUMBERED 0x10
00104
00105
00106
00107
00108 #ifdef KEY
00109 #define PU_IS_PROFILER 0x20
00110 #endif
00111
00112 #define PU_INTERNAL_MASK 0xf0000000
00113 #define PU_DELETED 0x10000000
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131 typedef struct pu_info {
00132 struct pu_info *next;
00133 struct pu_info *child;
00134 mINT32 state;
00135
00136 ST_IDX proc_sym;
00137 mINT32 flags;
00138 DST_IDX pu_dst;
00139 DST_IDX cu_dst;
00140
00141
00142
00143 struct {
00144 Elf64_Word offset;
00145 union {
00146 Elf64_Word size;
00147 void *ptr;
00148 } u;
00149 } subsect[WT_SUBSECTIONS];
00150
00151
00152 struct wn_map_tab *maptab;
00153 } PU_Info;
00154
00155
00156 #define PU_Info_proc_sym(pu) (pu)->proc_sym
00157 #define PU_Info_proc_id(pu) (pu)->proc_sym
00158
00159 #if 0
00160 #ifdef __cplusplus
00161
00162 inline PU &
00163 PU_Info_pu(PU_Info *ppui)
00164 {
00165 return Pu_Table[ST_pu(St_Table[PU_Info_proc_sym(ppui)])];
00166 }
00167 #endif
00168 #endif
00169
00170 #define PU_Info_subsect_offset(pu,scn) (pu)->subsect[scn].offset
00171 #define PU_Info_subsect_size(pu,scn) (pu)->subsect[scn].u.size
00172 #define PU_Info_subsect_ptr(pu,scn) (pu)->subsect[scn].u.ptr
00173 #define PU_Info_flags(pu) (pu)->flags
00174 #define PU_Info_pu_dst(pu) (pu)->pu_dst
00175 #define PU_Info_cu_dst(pu) (pu)->cu_dst
00176 #define PU_Info_cu_dst(pu) (pu)->cu_dst
00177 #define PU_Info_maptab(pu) (pu)->maptab
00178 #define PU_Info_next(pu) (pu)->next
00179 #define PU_Info_child(pu) (pu)->child
00180
00181 #define Set_PU_Info_flags(pu,flag_value) (pu)->flags |= (flag_value)
00182 #define Clear_PU_Info_flags(pu,flag_value) (pu)->flags &= ~(flag_value)
00183 #define Is_Set_PU_Info_flags(pu,flag_value) ((pu)->flags & (flag_value))
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196 typedef enum subsect_state {
00197 Subsect_Missing = 0,
00198 Subsect_Exists = 1,
00199 Subsect_InMem = 2,
00200 Subsect_Written = 3
00201 } Subsect_State;
00202
00203 #define PU_Info_state(pu, ndx) \
00204 (Subsect_State)(((pu)->state >> (((ndx) + 1) << 1)) & 0x3)
00205 #define Set_PU_Info_state(pu, ndx, st) (pu)->state = (pu)->state & \
00206 ~(0x3 << (((ndx) + 1) << 1)) | (st << (((ndx) + 1) << 1))
00207
00208
00209
00210
00211
00212
00213 #define PU_Info_symtab_ptr(pu) \
00214 (LOCAL_SYMTAB_HEADER_TABLE *) PU_Info_subsect_ptr((pu), WT_SYMTAB)
00215 #define PU_Info_tree_ptr(pu) \
00216 (WN *)PU_Info_subsect_ptr((pu), WT_TREE)
00217 #define PU_Info_depgraph_ptr(pu) \
00218 (void *)PU_Info_subsect_ptr((pu), WT_DEPGRAPH)
00219 #define PU_Info_regions_ptr(pu) \
00220 (struct region_id *)PU_Info_subsect_ptr((pu), WT_REGIONS)
00221 #define PU_Info_feedback_ptr(pu) \
00222 (void *)PU_Info_subsect_ptr((pu), WT_FEEDBACK)
00223 #define PU_Info_frequencies_ptr(pu) \
00224 (INT32 *) PU_Info_subsect_ptr((pu), WT_FREQ)
00225 #define PU_Info_alias_class_ptr(pu) \
00226 (INT32 *) PU_Info_subsect_ptr((pu), WT_ALIAS_CLASS)
00227 #define PU_Info_ac_internal_ptr(pu) \
00228 (void *) PU_Info_subsect_ptr((pu), WT_AC_INTERNAL)
00229
00230 #define Set_PU_Info_tree_ptr(pu,x) \
00231 PU_Info_subsect_ptr((pu), WT_TREE) = (void *)(x)
00232 #define Set_PU_Info_symtab_ptr(pu,x) \
00233 PU_Info_subsect_ptr((pu), WT_SYMTAB) = (void *)(x)
00234 #define Set_PU_Info_depgraph_ptr(pu,x) \
00235 PU_Info_subsect_ptr((pu), WT_DEPGRAPH) = (void *)(x)
00236 #define Set_PU_Info_regions_ptr(pu,x) \
00237 PU_Info_subsect_ptr((pu), WT_REGIONS) = (void *)(x)
00238 #define Set_PU_Info_feedback_ptr(pu,x) \
00239 PU_Info_subsect_ptr((pu), WT_FEEDBACK) = (void *)(x)
00240 #define Set_PU_Info_frequencies_ptr(pu,x) \
00241 PU_Info_subsect_ptr((pu), WT_FREQ) = (void *) (x)
00242 #define Set_PU_Info_alias_class_ptr(pu,x) \
00243 PU_Info_subsect_ptr((pu), WT_ALIAS_CLASS) = (void *) (x)
00244 #define Set_PU_Info_ac_internal_ptr(pu,x) \
00245 PU_Info_subsect_ptr((pu), WT_AC_INTERNAL) = (void *) (x)
00246
00247 #define Set_PU_Info_pu_dst(pu, x) \
00248 PU_Info_pu_dst(pu) = x;
00249 #define Set_PU_Info_cu_dst(pu, x) \
00250 PU_Info_cu_dst(pu) = x;
00251
00252
00253 #ifdef __cplusplus
00254 extern "C" {
00255 #endif
00256
00257 extern void PU_Info_init (PU_Info *pu);
00258 extern INT Sizeof_PU_Infos (PU_Info *pu_tree);
00259 extern INT Write_PU_Infos (PU_Info *pu_tree, char *base);
00260 extern PU_Info *Read_PU_Infos (char *base, INT32 size, INT32 *p_num_PUs);
00261
00262 extern PU_Info *Current_PU_Info;
00263
00264 extern void Save_Local_Symtab (SYMTAB_IDX level, PU_Info *pu);
00265 extern void Restore_Local_Symtab (PU_Info *pu);
00266
00267 #ifdef __cplusplus
00268 }
00269 #endif
00270
00271 #if 0
00272 #ifdef __cplusplus
00273
00274 inline PU &
00275 Current_PU_Info_pu()
00276 {
00277 return PU_Info_pu(Current_PU_Info);
00278 }
00279 #endif
00280 #endif
00281
00282 #ifdef FIL
00283 extern PU_Info *Last_PU;
00284 #endif
00285 #endif