19 #ifndef __DWDEBUG_PRIV_H__
20 #define __DWDEBUG_PRIV_H__
25 #define LOGDUMPSYMBOL(dl,lt,lf,s) \
26 vdebugc((dl),(lt),(lf), \
27 "symbol(%s,%s,0x%"PRIxSMOFFSET",refcnt=%"PRIiREFCNT")", \
28 symbol_get_name((s)),SYMBOL_TYPE((s)->type),(s)->ref,(s)->refcnt);
30 #define LOGDUMPSYMBOL_NL(dl,lt,lf,s) \
31 LOGDUMPSYMBOL((dl),(lt),(lf),(s)); \
32 vdebugc((dl),(lt),(lf),"\n");
34 #define WARNDUMPSYMBOL(s) \
35 vwarnc("symbol(%s,%s,0x%"PRIxSMOFFSET",refcnt=%"PRIiREFCNT")", \
36 symbol_get_name((s)),SYMBOL_TYPE((s)->type),(s)->ref,(s)->refcnt);
38 #define WARNDUMPSYMBOL_NL(s) \
39 WARNDUMPSYMBOL((s)); \
42 #define WARNOPTDUMPSYMBOL(wl,lt,lf,s) \
43 vwarnoptc(wl,lt,lf,"symbol(%s,%s,0x%"PRIxSMOFFSET",refcnt=%"PRIiREFCNT")", \
44 symbol_get_name((s)),SYMBOL_TYPE((s)->type),(s)->ref,(s)->refcnt);
46 #define WARNOPTDUMPSYMBOL_NL(wl,lt,lf,s) \
47 WARNOPTDUMPSYMBOL(wl,lt,lf,(s)); \
48 vwarnoptc(wl,lt,lf,"\n");
50 #define ERRORDUMPSYMBOL(s) \
51 verrorc("symbol(%s,%s,0x%"PRIxSMOFFSET",refcnt=%"PRIiREFCNT")", \
52 symbol_get_name((s)),SYMBOL_TYPE((s)->type),(s)->ref,(s)->refcnt);
54 #define ERRORDUMPSYMBOL_NL(s) \
55 ERRORDUMPSYMBOL((s)); \
59 #define LOGDUMPSCOPE(dl,lt,lf,s) \
60 vdebugc((dl),(lt),(lf), \
61 "scope(%s:0x%"PRIxSMOFFSET",[0x%"PRIxADDR",0x%"PRIxADDR"%s]," \
62 " refcnt=%"PRIiREFCNT")", \
63 ((s)->symbol) ? symbol_get_name((s)->symbol) : "NULL", \
64 (s)->ref,((s)->range) ? (s)->range->start : 0, \
65 ((s)->range) ? (s)->range->end : 0, \
66 ((s)->range && (s)->range->next) ? ",..." : "",(s)->refcnt);
68 #define LOGDUMPSCOPE_NL(dl,lt,lf,s) \
69 LOGDUMPSCOPE((dl),(lt),(lf),(s)); \
70 vdebugc((dl),(lt),(lf),"\n");
72 #define ERRORDUMPSCOPE(s) \
73 verrorc("scope(%s:0x%"PRIxSMOFFSET",[0x%"PRIxADDR",0x%"PRIxADDR"%s]," \
74 " refcnt=%"PRIiREFCNT")", \
75 ((s)->symbol) ? symbol_get_name((s)->symbol) : "NULL", \
76 (s)->ref,((s)->range) ? (s)->range->start : 0, \
77 ((s)->range) ? (s)->range->end : 0, \
78 ((s)->range && (s)->range->next) ? ",..." : "",(s)->refcnt);
80 #define ERRORDUMPSCOPE_NL(s) \
81 ERRORDUMPSCOPE((s)); \
84 #define WARNDUMPSCOPE(s) \
85 vwarnc( "scope(%s:0x%"PRIxSMOFFSET",[0x%"PRIxADDR",0x%"PRIxADDR"%s]," \
86 " refcnt=%"PRIiREFCNT")", \
87 ((s)->symbol) ? symbol_get_name((s)->symbol) : "NULL", \
88 (s)->ref,((s)->range) ? (s)->range->start : 0, \
89 ((s)->range) ? (s)->range->end : 0, \
90 ((s)->range && (s)->range->next) ? ",..." : "",(s)->refcnt);
92 #define WARNDUMPSCOPE_NL(s) \
97 #define LOGDUMPLSYMBOL(dl,lt,lf,s) \
98 vdebugc((dl),(lt),(lf), \
99 "lsymbol(%s,%s,0x%"PRIxSMOFFSET";chainlen=%d)", \
100 symbol_get_name((s)->symbol),SYMBOL_TYPE((s)->symbol->type), \
101 (s)->symbol->ref,array_list_len((s)->chain));
103 #define LOGDUMPLSYMBOL_NL(dl,lt,lf,s) \
104 LOGDUMPLSYMBOL((dl),(lt),(lf),(s)); \
105 vdebugc((dl),(lt),(lf),"\n");
107 #define ERRORDUMPLSYMBOL(s) \
108 verrorc("lsymbol(%s,%s,0x%"PRIxSMOFFSET";chainlen=%d)", \
109 symbol_get_name((s)->symbol),SYMBOL_TYPE((s)->symbol->type), \
110 (s)->symbol->ref,array_list_len((s)->chain));
112 #define ERRORDUMPLSYMBOL_NL(s) \
113 ERRORDUMPLSYMBOL((s)); \
182 int (*
fini)(
struct debugfile *debugfile);
203 const unsigned char *
data,Dwarf_Word
len,
225 struct symbol *declaration,
226 struct symbol *definition);
228 struct symbol *specification,
229 struct symbol *definition);
234 char *name,
const char *delim,
235 struct rfilter *srcfile_filter,
238 char *filename,
int line,
319 const char *name,
const char *delim);
326 return array_list_len(lsymbol->
chain);
329 if (array_list_len(lsymbol->
chain) > 0)
330 return (
struct symbol *) \
331 array_list_item(lsymbol->
chain,array_list_len(lsymbol->
chain) - 1);
335 static inline struct symbol *lsymbol_symbol(
struct lsymbol *lsymbol,
int i) {
336 return (
struct symbol *)array_list_item(lsymbol->
chain,i);
413 int no_main,
int no_dup,
int no_anon);
506 static inline struct symbol *scope_get_symbol(
struct scope *
scope) {
513 const char *name,
const char *delim,
525 ADDR *high_addr_saveptr,
int *is_noncontiguous);
536 #define LOCTYPE_BITS 5
537 static inline const char *LOCTYPE(
int n) {
550 default:
return NULL;
570 #define LOCATION_REMAINING_BITS (__WORDSIZE - LOCTYPE_BITS - 1)
594 #if LOCATION_REMAINING_BITS > 32
610 #define LOCATION_IS_UNKNOWN(loc) ((loc)->loctype == LOCTYPE_UNKNOWN)
611 #define LOCATION_IS_ADDR(loc) ((loc)->loctype == LOCTYPE_ADDR)
612 #define LOCATION_IS_REG(loc) ((loc)->loctype == LOCTYPE_REG)
613 #define LOCATION_IS_REG_ADDR(loc) ((loc)->loctype == LOCTYPE_REG_ADDR)
614 #define LOCATION_IS_REG_OFFSET(loc) ((loc)->loctype == LOCTYPE_REG_OFFSET)
615 #define LOCATION_IS_M_OFFSET(loc) ((loc)->loctype == LOCTYPE_MEMBER_OFFSET)
616 #define LOCATION_IS_FB_OFFSET(loc) ((loc)->loctype == LOCTYPE_FBREG_OFFSET)
617 #define LOCATION_IS_LOCLIST(loc) ((loc)->loctype == LOCTYPE_LOCLIST)
618 #define LOCATION_IS_IMPLICIT_WORD(loc) ((loc)->loctype == LOCTYPE_IMPLICIT_WORD)
619 #define LOCATION_IS_IMPLICIT_DATA(loc) ((loc)->loctype == LOCTYPE_IMPLICIT_DATA)
620 #define LOCATION_IS_RUNTIME(loc) ((loc)->loctype == LOCTYPE_RUNTIME)
622 #define LOCATION_ADDR(loc) (loc)->l.addr
623 #define LOCATION_REG(loc) (loc)->l.reg
624 #define LOCATION_OFFSET(loc) (loc)->l.offset
625 #define LOCATION_LOCLIST(loc) (loc)->l.loclist
626 #define LOCATION_WORD(loc) (loc)->l.word
628 #define LOCATION_GET_REGOFFSET(loc,reg,offset) \
630 reg = (REG)(loc)->extra; \
631 offset = (loc)->l.offset; \
633 #define LOCATION_GET_DATA(loc,buf,buflen) \
635 buflen = (int)(loc)->extra; \
636 buf = (loc)->l.data; \
655 struct symbol *symbol,
struct location *o_loc);
768 struct symbol_type_members;
903 #define SIZE_BITS_SIZE 10
904 #define SIZE_OFFSET_SIZE 10
905 #define SIZE_CTBYTES_SIZE 12
1117 #define SYMBOL_IS_DWARF(sym) ((sym) && (sym)->source == SYMBOL_SOURCE_DWARF)
1118 #define SYMBOL_IS_ELF(sym) ((sym) && (sym)->source == SYMBOL_SOURCE_ELF)
1120 #define SYMBOL_IS_FULL(sym) ((sym)->loadtag == LOADTYPE_FULL)
1121 #define SYMBOL_IS_PARTIAL(sym) ((sym)->loadtag == LOADTYPE_PARTIAL)
1123 #define SYMBOL_IS_ROOT(sym) ((sym)->type == SYMBOL_TYPE_ROOT)
1124 #define SYMBOL_IS_TYPE(sym) ((sym)->type == SYMBOL_TYPE_TYPE)
1125 #define SYMBOL_IS_VAR(sym) ((sym)->type == SYMBOL_TYPE_VAR)
1126 #define SYMBOL_IS_FUNC(sym) ((sym)->type == SYMBOL_TYPE_FUNC)
1127 #define SYMBOL_IS_LABEL(sym) ((sym)->type == SYMBOL_TYPE_LABEL)
1128 #define SYMBOL_IS_BLOCK(sym) ((sym)->type == SYMBOL_TYPE_BLOCK)
1129 #define SYMBOL_IS_INSTANCE(sym) ((sym)->type != SYMBOL_TYPE_TYPE \
1130 && (sym)->type != SYMBOL_TYPE_ROOT \
1131 && (sym)->type != SYMBOL_TYPE_NONE)
1133 #define SYMBOL_IS_FULL_ROOT(sym) ((sym)->type == SYMBOL_TYPE_ROOT \
1134 && (sym)->extra.exists)
1135 #define SYMBOL_IS_FULL_VAR(sym) ((sym)->type == SYMBOL_TYPE_VAR \
1136 && (sym)->extra.exists)
1137 #define SYMBOL_IS_FULL_FUNC(sym) ((sym)->type == SYMBOL_TYPE_FUNC \
1138 && (sym)->extra.exists)
1139 #define SYMBOL_IS_FULL_LABEL(sym) ((sym)->type == SYMBOL_TYPE_LABEL \
1140 && (sym)->extra.exists)
1141 #define SYMBOL_IS_FULL_BLOCK(sym) ((sym)->type == SYMBOL_TYPE_BLOCK \
1142 && (sym)->extra.exists)
1144 #define SYMBOL_IST_VOID(sym) (SYMBOL_IS_TYPE(sym) \
1145 && (sym)->datatype_code == DATATYPE_VOID)
1146 #define SYMBOL_IST_ARRAY(sym) (SYMBOL_IS_TYPE(sym) \
1147 && (sym)->datatype_code == DATATYPE_ARRAY)
1148 #define SYMBOL_IST_STRUCT(sym) (SYMBOL_IS_TYPE(sym) \
1149 && (sym)->datatype_code == DATATYPE_STRUCT)
1150 #define SYMBOL_IST_ENUM(sym) (SYMBOL_IS_TYPE(sym) \
1151 && (sym)->datatype_code == DATATYPE_ENUM)
1152 #define SYMBOL_IST_PTR(sym) (SYMBOL_IS_TYPE(sym) \
1153 && ((sym)->datatype_code == DATATYPE_PTR \
1154 || (sym)->datatype_code == DATATYPE_REF))
1155 #define SYMBOL_IST_FUNC(sym) (SYMBOL_IS_TYPE(sym) \
1156 && (sym)->datatype_code == DATATYPE_FUNC)
1157 #define SYMBOL_IST_TYPEDEF(sym) (SYMBOL_IS_TYPE(sym) \
1158 && (sym)->datatype_code \
1159 == DATATYPE_TYPEDEF)
1160 #define SYMBOL_IST_UNION(sym) (SYMBOL_IS_TYPE(sym) \
1161 && (sym)->datatype_code == DATATYPE_UNION)
1162 #define SYMBOL_IST_BASE(sym) (SYMBOL_IS_TYPE(sym) \
1163 && (sym)->datatype_code == DATATYPE_BASE)
1164 #define SYMBOL_IST_CONST(sym) (SYMBOL_IS_TYPE(sym) \
1165 && (sym)->datatype_code == DATATYPE_CONST)
1166 #define SYMBOL_IST_VOL(sym) (SYMBOL_IS_TYPE(sym) \
1167 && (sym)->datatype_code == DATATYPE_VOL)
1168 #define SYMBOL_IST_NAMESPACE(sym)(SYMBOL_IS_TYPE(sym) \
1169 && (sym)->datatype_code == DATATYPE_NAMESPACE)
1170 #define SYMBOL_IST_CLASS(sym) (SYMBOL_IS_TYPE(sym) \
1171 && (sym)->datatype_code == DATATYPE_CLASS)
1172 #define SYMBOL_IST_TEMPLATE(sym) (SYMBOL_IS_TYPE(sym) \
1173 && (sym)->datatype_code == DATATYPE_TEMPLATE)
1175 #define SYMBOL_IST_STUN(sym) (SYMBOL_IS_TYPE(sym) \
1176 && ((sym)->datatype_code == DATATYPE_STRUCT \
1177 || (sym)->datatype_code == DATATYPE_UNION))
1178 #define SYMBOL_IST_STUNC(sym) (SYMBOL_IS_TYPE(sym) \
1179 && ((sym)->datatype_code == DATATYPE_STRUCT \
1180 || (sym)->datatype_code == DATATYPE_UNION \
1181 || (sym)->datatype_code == DATATYPE_CLASS))
1183 #define SYMBOL_TYPE_FLAG_MATCHES(sym,flags) \
1184 (flags == SYMBOL_TYPE_FLAG_NONE \
1185 || ((flags & SYMBOL_TYPE_FLAG_TYPE && SYMBOL_IS_TYPE(sym)) \
1186 || (flags & SYMBOL_TYPE_FLAG_VAR && SYMBOL_IS_VAR(sym)) \
1187 || (flags & SYMBOL_TYPE_FLAG_VAR_ARG && SYMBOL_IS_VAR(sym) \
1188 && (sym)->isparam) \
1189 || (flags & SYMBOL_TYPE_FLAG_VAR_MEMBER && SYMBOL_IS_VAR(sym) \
1190 && (sym)->ismember) \
1191 || (flags & SYMBOL_TYPE_FLAG_VAR_GLOBAL && SYMBOL_IS_VAR(sym) \
1192 && (sym)->isexternal) \
1193 || (flags & SYMBOL_TYPE_FLAG_VAR_LOCAL && SYMBOL_IS_VAR(sym) \
1194 && !((sym)->isparam || (sym)->isexternal || (sym)->ismember \
1195 || (sym)->isenumval)) \
1196 || (flags & SYMBOL_TYPE_FLAG_FUNC && SYMBOL_IS_FUNC(sym)) \
1197 || (flags & SYMBOL_TYPE_FLAG_LABEL && SYMBOL_IS_LABEL(sym)) \
1198 || (flags & SYMBOL_TYPE_FLAG_ROOT && SYMBOL_IS_ROOT(sym)) \
1199 || (flags & SYMBOL_TYPE_FLAG_BLOCK && SYMBOL_IS_BLOCK(sym))))
1201 #define SYMBOL_IST_CONTAINER(sym) (SYMBOL_IS_TYPE(sym) \
1202 && ((sym)->datatype_code == DATATYPE_FUNC \
1203 || (sym)->datatype_code == DATATYPE_STRUCT \
1204 || (sym)->datatype_code == DATATYPE_UNION \
1205 || (sym)->datatype_code == DATATYPE_NAMESPACE \
1206 || (sym)->datatype_code == DATATYPE_CLASS \
1207 || (sym)->datatype_code == DATATYPE_TEMPLATE))
1208 #define SYMBOL_HAS_MEMBERS(sym) \
1209 (SYMBOL_IST_CONTAINER(sym) || SYMBOL_IST_ENUM(sym) \
1210 || SYMBOL_IS_ROOT(sym) || SYMBOL_IS_FUNC(sym) || SYMBOL_IS_BLOCK(sym))
1211 #define SYMBOL_CAN_OWN_SCOPE(sym) \
1212 (SYMBOL_IST_CONTAINER(sym) \
1213 || SYMBOL_IS_ROOT(sym) || SYMBOL_IS_FUNC(sym) || SYMBOL_IS_BLOCK(sym))
1214 #define SYMBOL_IS_OWN_DATATYPE(sym) \
1215 (SYMBOL_IST_VOID(sym) || SYMBOL_IST_STUN(sym) || SYMBOL_IST_BASE(sym) \
1216 || SYMBOL_IST_NAMESPACE(sym) || SYMBOL_IST_CLASS(sym) \
1217 || SYMBOL_IST_TEMPLATE(sym))
1219 #define SYMBOL_IS_INLINEABLE(sym) \
1220 (SYMBOL_IS_FUNC(sym) || SYMBOL_IS_VAR(sym) \
1221 || SYMBOL_IS_LABEL(sym) || SYMBOL_IS_BLOCK(sym))
1223 #define SYMBOL_IS_CONTAINER(sym) \
1224 (SYMBOL_IST_CONTAINER(sym) \
1225 || SYMBOL_IS_ROOT(sym) || SYMBOL_IS_FUNC(sym) || SYMBOL_IS_BLOCK(sym))
1226 #define SYMBOL_HAS_EXTRA(sym) ((sym)->extra.exists != NULL)
1227 #define SYMBOL_HAS_INLINE(sym) \
1228 (SYMBOL_HAS_EXTRA(sym) \
1229 && ((SYMBOL_IS_VAR(sym) && SYMBOLX_VAR(sym)->ii) \
1230 || (SYMBOL_IS_FUNC(sym) && SYMBOLX_FUNC(sym)->ii) \
1231 || (SYMBOL_IS_LABEL(sym) && SYMBOLX_LABEL(sym)->ii) \
1232 || (SYMBOL_IS_BLOCK(sym) && SYMBOLX_BLOCK(sym)->ii)))
1234 #define SYMBOLX_ROOT(sym) (sym)->extra.root
1235 #define SYMBOL_RX_ROOT(sym,rvar) struct symbol_root *rvar = SYMBOLX_ROOT(sym)
1236 #define SYMBOL_WX_ROOT(sym,wvar,reterr) \
1237 struct symbol_root *wvar; \
1238 if (!SYMBOL_IS_ROOT(sym)) return reterr; \
1239 if ((sym)->extra.root) \
1240 wvar = (sym)->extra.root; \
1242 wvar = (sym)->extra.root = (struct symbol_root *) \
1243 calloc(1,sizeof(*(sym)->extra.root));
1244 #define SYMBOLX_ENCODING_V(sym) (sym)->extra.encoding
1245 #define SYMBOLX_SUBRANGES(sym) (sym)->extra.subranges
1246 #define SYMBOLX_CONTAINER(sym) (sym)->extra.container
1247 #define SYMBOL_RX_CONTAINER(sym,rvar) \
1248 struct symbol_type_container *rvar = SYMBOLX_CONTAINER(sym)
1249 #define SYMBOL_WX_CONTAINER(sym,wvar,reterr) \
1250 struct symbol_type_container *wvar; \
1251 if (!SYMBOL_IST_CONTAINER(sym)) return reterr; \
1252 if ((sym)->extra.container) \
1253 wvar = (sym)->extra.container; \
1255 wvar = (sym)->extra.container = (struct symbol_type_container *) \
1256 calloc(1,sizeof(*(sym)->extra.container));
1257 #define SYMBOLX_FUNC(sym) (sym)->extra.function
1258 #define SYMBOL_RX_FUNC(sym,rvar) struct symbol_function *rvar = SYMBOLX_FUNC(sym)
1259 #define SYMBOL_WX_FUNC(sym,wvar,reterr) \
1260 struct symbol_function *wvar; \
1261 if (!SYMBOL_IS_FUNC(sym)) return reterr; \
1262 if ((sym)->extra.function) \
1263 wvar = (sym)->extra.function; \
1265 wvar = (sym)->extra.function = (struct symbol_function *) \
1266 calloc(1,sizeof(*(sym)->extra.function));
1268 #define SYMBOLX_VAR(sym) (sym)->extra.variable
1269 #define SYMBOL_RX_VAR(sym,rvar) struct symbol_variable *rvar = SYMBOLX_VAR(sym)
1270 #define SYMBOL_WX_VAR(sym,wvar,reterr) \
1271 struct symbol_variable *wvar; \
1272 if (!SYMBOL_IS_VAR(sym)) return reterr; \
1273 if ((sym)->extra.variable) \
1274 wvar = (sym)->extra.variable; \
1276 wvar = (sym)->extra.variable = (struct symbol_variable *) \
1277 calloc(1,sizeof(*(sym)->extra.variable));
1278 #define SYMBOLX_LABEL(sym) (sym)->extra.label
1279 #define SYMBOL_RX_LABEL(sym,rvar) struct symbol_label *rvar = SYMBOLX_LABEL(sym)
1280 #define SYMBOL_WX_LABEL(sym,wvar,reterr) \
1281 struct symbol_label *wvar; \
1282 if (!SYMBOL_IS_LABEL(sym)) return reterr; \
1283 if ((sym)->extra.label) \
1284 wvar = (sym)->extra.label; \
1286 wvar = (sym)->extra.label = (struct symbol_label *) \
1287 calloc(1,sizeof(*(sym)->extra.label));
1288 #define SYMBOLX_BLOCK(sym) (sym)->extra.block
1289 #define SYMBOL_RX_BLOCK(sym,rvar) struct symbol_block *rvar = SYMBOLX_BLOCK(sym)
1290 #define SYMBOL_WX_BLOCK(sym,wvar,reterr) \
1291 struct symbol_block *wvar; \
1292 if (!SYMBOL_IS_BLOCK(sym)) return reterr; \
1293 if ((sym)->extra.block) \
1294 wvar = (sym)->extra.block; \
1296 wvar = (sym)->extra.block = (struct symbol_block *) \
1297 calloc(1,sizeof(*(sym)->extra.block));
1298 #define SYMBOLX_INLINE(sym) \
1299 (!SYMBOL_HAS_EXTRA(sym) ? NULL : \
1300 (SYMBOL_IS_VAR(sym) ? SYMBOLX_VAR(sym)->ii : \
1301 (SYMBOL_IS_FUNC(sym) ? SYMBOLX_FUNC(sym)->ii : \
1302 (SYMBOL_IS_LABEL(sym) ? SYMBOLX_LABEL(sym)->ii : \
1303 (SYMBOL_IS_BLOCK(sym) ? SYMBOLX_BLOCK(sym)->ii : NULL)))))
1304 #define SYMBOL_RX_INLINE(sym,rvar) \
1305 struct symbol_inline *rvar = SYMBOLX_INLINE(sym)
1306 #define SYMBOL_WX_INLINE(sym,wvar,reterr) \
1307 struct symbol_inline *wvar; \
1308 if (SYMBOL_IS_FUNC(sym)) { \
1309 SYMBOL_WX_FUNC(sym,sf,reterr); \
1310 if (!sf->ii) sf->ii = calloc(1,sizeof(*(sf->ii))); \
1313 else if (SYMBOL_IS_VAR(sym)) { \
1314 SYMBOL_WX_VAR(sym,sv,reterr); \
1315 if (!sv->ii) sv->ii = calloc(1,sizeof(*(sv->ii))); \
1318 else if (SYMBOL_IS_LABEL(sym)) { \
1319 SYMBOL_WX_LABEL(sym,sl,reterr); \
1320 if (!sl->ii) sl->ii = calloc(1,sizeof(*(sl->ii))); \
1323 else if (SYMBOL_IS_BLOCK(sym)) { \
1324 SYMBOL_WX_BLOCK(sym,sb,reterr); \
1325 if (!sb->ii) sb->ii = calloc(1,sizeof(*(sb->ii))); \
1330 #define SYMBOLX_MEMBERS(sym) \
1331 (!SYMBOL_HAS_EXTRA(sym) ? NULL : \
1332 (SYMBOL_IS_FUNC(sym) ? SYMBOLX_FUNC(sym)->members : \
1333 (SYMBOL_IS_FUNC(sym) ? SYMBOLX_FUNC(sym)->members : \
1334 (SYMBOL_IST_ENUM(sym) ? (sym)->extra.members : \
1335 (SYMBOL_IST_CONTAINER(sym) ? SYMBOLX_CONTAINER(sym)->members : NULL)))))
1336 #define SYMBOLX_SCOPE(sym) \
1337 (!SYMBOL_HAS_EXTRA(sym) ? NULL : \
1338 (SYMBOL_IS_FUNC(sym) ? SYMBOLX_FUNC(sym)->scope : \
1339 (SYMBOL_IST_CONTAINER(sym) ? SYMBOLX_CONTAINER(sym)->scope : \
1340 (SYMBOL_IS_ROOT(sym) ? SYMBOLX_ROOT(sym)->scope : \
1341 (SYMBOL_IS_BLOCK(sym) ? SYMBOLX_BLOCK(sym)->scope : NULL)))))
1342 #define SYMBOLX_VAR_LOC(sym) \
1343 (!SYMBOL_HAS_EXTRA(sym) ? NULL : \
1344 (SYMBOL_IS_VAR(sym) ? SYMBOLX_VAR(sym)->loc : NULL))
1345 #define SYMBOLX_VAR_CONSTVAL(sym) \
1346 (!SYMBOL_HAS_EXTRA(sym) ? NULL : \
1347 (SYMBOL_IS_VAR(sym) ? SYMBOLX_VAR(sym)->constval : NULL))
1349 #define SYMBOL_EXPAND_WARN(symbol) \
1351 if (!SYMBOL_IS_FULL(symbol)) { \
1352 if (symbol_expand(symbol)) \
1353 vwarn("could not expand datatype symbol %s; continuing!\n", \
1354 symbol_get_name(symbol)); \
1357 #define SYMBOL_EXPAND_ERROR_RET(symbol,retval) \
1359 if (!SYMBOL_IS_FULL(symbol)) { \
1360 if (symbol_expand(symbol)) { \
1361 verror("could not expand datatype symbol %s; continuing!\n", \
1362 symbol_get_name(symbol)); \
1367 #define SYMBOL_EXPAND_ERROR_OUT(symbol,label) \
1369 if (!SYMBOL_IS_FULL(symbol)) { \
1370 if (symbol_expand(symbol)) { \
1371 verror("could not expand datatype symbol %s; continuing!\n", \
1372 symbol_get_name(symbol)); \
1406 const char *name,
const char *delim,
1409 const char *name,
const char *delim);
1426 struct symbol *newparent);
1444 struct scope *new_parent);
1446 #define symbol_set_external(s) (s)->isexternal = 1
1447 #define symbol_set_parameter(s) (s)->isparam = 1
1448 #define symbol_set_enumval(s) (s)->isenumval = 1
1449 #define symbol_set_member(s) (s)->ismember = 1
1450 #define symbol_set_unspec_params(s) (s)->has_unspec_params = 1
1461 short int lang_code);
1489 gpointer
value,gpointer userdata);
1491 gpointer
value,gpointer userdata);
struct scope * symbol_containing_scope(struct symbol *symbol)
int(* getaddrsize)(struct location_ctxt *lctxt)
int symbol_insert_symbol(struct symbol *parent, struct symbol *child)
struct debugfile * debugfile_create_basic(debugfile_type_t dtype, debugfile_type_flags_t dtflags, char *filename, struct debugfile_load_opts *opts)
void symbol_build_extname(struct symbol *symbol)
struct symdict * symdict_create(void)
void location_ctxt_free(struct location_ctxt *lctxt)
struct location * location_copy(struct location *location)
void debugfile_save_declaration(struct debugfile *debugfile, struct symbol *symbol)
unsigned int decltypedefined
struct debugfile_ops dwarf_debugfile_ops
unsigned int orig_name_offset
int location_set_reg_offset(struct location *l, REG reg, OFFSET offset)
int location_set_implicit_data(struct location *loc, char *data, int len, int nocopy)
struct symbol_label * label
int debugfile_lookup_addr_alt__int(struct debugfile *debugfile, ADDR addr, struct lsymbol **primary, struct lsymbol **alt)
void location_dump(struct location *location, struct dump_info *ud)
Dwarf_Off first_top_level_die_offset
void symbol_set_srcline(struct symbol *s, int sl)
struct location_ops * ops
unsigned int guessed_size
void symdict_dump(struct symdict *symdict, struct dump_info *ud)
void g_hash_foreach_dump_symbol_list(gpointer key __attribute__((unused)), gpointer value, gpointer userdata)
void symbol_free_extra(struct symbol *symbol)
#define SYMBOL_SOURCE_BITS
static uint64_t unsigned int i
struct symbol * debugfile_lookup_root_name(struct debugfile *debugfile, char *name)
int(* writeword)(struct location_ctxt *lctxt, ADDR real_addr, ADDR pval)
struct location * dwarf_get_static_ops(struct symbol_root_dwarf *srd, const unsigned char *data, Dwarf_Word len, unsigned int attr)
int scope_insert_symbol(struct scope *scope, struct symbol *symbol)
GSList * symdict_match_syms(struct symdict *symdict, struct rfilter *symbol_filter, symbol_type_flag_t flags)
struct array_list __attribute__
int debugfile_replace_type(struct debugfile *debugfile, struct symbol *symbol)
struct lsymbol * lsymbol_create_from_member__int(struct lsymbol *parent, struct symbol *member)
int(* relocate)(struct location_ctxt *lctxt, ADDR obj_addr, ADDR *real_addr)
int(* frame_read_cfa)(struct debugfile *debugfile, struct location_ctxt *lctxt, ADDR *o_cfaaddr)
REFCNT debugfile_free(struct debugfile *debugfile, int force)
void location_internal_free(struct location *location)
int symbol_add_subrange(struct symbol *symbol, int subrange)
struct lsymbol * lsymbol_lookup_sym__int(struct lsymbol *lsymbol, const char *name, const char *delim)
int debugfile_type_flags_t
unsigned int size_is_bytes
REFCNT symbol_free(struct symbol *symbol, int force)
clmatchone_t top_level_die_offsets
void symbol_set_addr(struct symbol *s, ADDR a)
struct scope * symbol_link_owned_scope(struct symbol *symbol, struct scope *new_parent)
struct symbol_block * block
int symdict_get_size(struct symdict *symdict)
struct scope * symbol_write_owned_scope(struct symbol *symbol)
int(* frame_read_all_saved_reg)(struct debugfile *debugfile, struct location_ctxt *lctxt, GHashTable *regcache)
GSList * symdict_match_syms_by_tab(struct symdict *symdict, struct rfilter *symbol_filter, symbol_type_flag_t flags, int no_main, int no_dup, int no_anon)
int symdict_get_size_simple(struct symdict *symdict)
void symbol_set_bitoffset(struct symbol *s, uint32_t bo)
struct lsymbol * lsymbol_create_noninline__int(struct lsymbol *lsymbol)
struct symbol * debugfile_lookup_root(struct debugfile *debugfile, SMOFFSET offset)
struct symbol_inline * ii
int location_ctxt_write_reg(REG reg, struct location_ctxt *lctxt, REGVAL regval)
int debugfile_load_debuginfo(struct debugfile *debugfile)
int symbol_set_root_compdir(struct symbol *symbol, char *compdirname, int copy)
int location_ctxt_read_retaddr(struct location_ctxt *lctxt, ADDR *o_retaddr)
int(* frame_read_saved_reg)(struct debugfile *debugfile, struct location_ctxt *lctxt, REG reg, REGVAL *o_regval)
int symdict_insert_symbol_anon(struct symdict *symdict, struct symbol *symbol)
int(* symbol_root_priv_free)(struct debugfile *debugfile, struct symbol *root)
int location_ctxt_read_reg(struct location_ctxt *lctxt, REG reg, REGVAL *o_regval)
symdict_symbol_dtor_t default_symdict_symbol_dtor
void debugfile_resolve_declarations(struct debugfile *debugfile)
struct symbol_inline * ii
GSList * scope_match_syms(struct scope *scope, struct rfilter *symbol_filter, symbol_type_flag_t flags)
REFCNT scope_free(struct scope *scope, int force)
int symbol_remove_symbol(struct symbol *parent, struct symbol *child)
int location_update_loclist(struct location *loc, ADDR start, ADDR end, struct location *rloc, int *action)
int location_set_implicit_word(struct location *loc, ADDR word)
int debugfile_remove_root(struct debugfile *debugfile, struct symbol *symbol)
struct symbol_variable * variable
struct symbol_type_container * container
struct symbol * scope_get_sym(struct scope *scope, const char *name, symbol_type_flag_t flags)
loctype_t dwarf_location_resolve(const unsigned char *data, unsigned int len, struct location_ctxt *lctxt, struct symbol *symbol, struct location *o_loc)
#define SYMBOL_IS_LABEL(sym)
struct symbol * debugfile_find_type(struct debugfile *debugfile, char *typename)
int symbol_set_location(struct symbol *symbol, struct location *loc)
unsigned int constval_nofree
struct lsymbol * lsymbol_create_from_symbol__int(struct symbol *symbol)
int(* load)(struct debugfile *debugfile)
int(* symbol_expand)(struct debugfile *debugfile, struct symbol *root, struct symbol *symbol)
int(* fini)(struct debugfile *debugfile)
struct loclistloc * loclist
void symbol_set_name(struct symbol *symbol, char *name, int name_copy)
int location_set_reg(struct location *l, REG reg)
GSList * inline_instances
int debugfile_add_global(struct debugfile *debugfile, struct symbol *symbol)
void lsymbol_append(struct lsymbol *lsymbol, struct symbol *symbol)
int symdict_remove_symbol(struct symdict *symdict, struct symbol *symbol)
datatype_code_t datatype_code
unsigned int isprototyped
int scope_hold_symbol(struct scope *scope, struct symbol *symbol)
int(* init)(struct debugfile *debugfile)
struct dt_argp_state opts
int(* cachereg)(struct location_ctxt *lctxt, REG regno, REGVAL regval)
int location_ctxt_get_lops(struct location_ctxt *lctxt, struct location_ops **ops, void **priv)
struct debugfile * debugfile
struct symbol_inline * ii
struct symbol_inline * ii
struct lsymbol * lsymbol_create(struct symbol *symbol, struct array_list *chain)
int location_set_member_offset(struct location *l, OFFSET offset)
REFCNT lsymbol_free(struct lsymbol *lsymbol, int force)
void lsymbol_prepend(struct lsymbol *lsymbol, struct symbol *symbol)
#define SYMBOL_IS_BLOCK(sym)
void symbol_set_bitsize(struct symbol *s, uint32_t b)
int symbol_has_ext_name(struct symbol *symbol)
struct symbol * __symbol_get_one_member__int(struct symbol *symbol, char *member, struct array_list **chainptr)
struct debugfile * debugfile
struct location_ctxt * location_ctxt_create(struct location_ops *ops, void *priv)
int(* readipreg)(struct location_ctxt *lctxt, REGVAL *regval)
int(* frame_read_retaddr)(struct debugfile *debugfile, struct location_ctxt *lctxt, ADDR *o_retaddr)
int location_set_runtime(struct location *l, char *data, int len, int nocopy)
unsigned int has_linkage_name
struct symbol * symbol_get_one_member__int(struct symbol *symbol, char *member)
int scope_remove_symbol(struct scope *scope, struct symbol *symbol)
void lsymbol_hold_int(struct lsymbol *lsymbol)
unsigned int has_unspec_params
int symbol_change_parent(struct symbol *parent, struct symbol *child, struct symbol *newparent)
void(* symdict_symbol_dtor_t)(struct symbol *symbol, void *priv)
int(* symbol_root_expand)(struct debugfile *debugfile, struct symbol *root)
int location_set_addr(struct location *l, ADDR addr)
struct lsymbol * scope_lookup_sym__int(struct scope *scope, const char *name, const char *delim, symbol_type_flag_t flags)
int(* readreg)(struct location_ctxt *lctxt, REG regno, REGVAL *regval)
int location_set_reg_addr(struct location *l, REG reg)
char * symbol_get_name_orig(struct symbol *symbol)
uint64_t frame_sec_offset
unsigned int isdeclaration
int symbol_set_root_priv(struct symbol *symbol, void *priv)
unsigned int isdeclinline
int symbol_set_inline_origin(struct symbol *symbol, SMOFFSET ref, struct symbol *origin)
int(* setcurrentframe)(struct location_ctxt *lctxt, int frame)
int debugfile_insert_root(struct debugfile *debugfile, struct symbol *symbol)
#define SYMBOL_IS_TYPE(sym)
struct lsymbol * debugfile_lookup_sym_line__int(struct debugfile *debugfile, char *filename, int line, SMOFFSET *offset, ADDR *addr)
int symdict_get_sizes(struct symdict *symdict, int *named, int *duplicated, int *anon)
int debugfile_load_elfsymtab(struct debugfile *debugfile, Elf *elf, char *elf_filename)
struct lsymbol * symbol_lookup_sym__int(struct symbol *symbol, const char *name, const char *delim)
void symdict_free(struct symdict *symdict, symdict_symbol_dtor_t ssd, void *priv)
void debugfile_resolve_one_declaration(struct debugfile *debugfile, char *name)
struct lsymbol * debugfile_lookup_addr__int(struct debugfile *debugfile, ADDR addr)
void g_hash_foreach_dump_symbol(gpointer key __attribute__((unused)), gpointer value, gpointer userdata)
int(* unrelocate)(struct location_ctxt *lctxt, ADDR real_addr, ADDR *obj_addr)
int location_set_fbreg_offset(struct location *l, OFFSET offset)
#define LOCATION_REMAINING_BITS
void symbol_set_bytesize(struct symbol *s, uint32_t b)
void scope_update_range(struct scope *scope, ADDR start, ADDR end, int *action)
int scope_remove_scope(struct scope *parent, struct scope *child)
struct binfile * binfile_pointing
int scope_get_sizes(struct scope *scope, int *named, int *duplicated, int *anon, int *numscopes)
int symbol_set_encoding(struct symbol *symbol, encoding_t num)
int debugfile_declaration_copy_definition(struct debugfile *debugfile, struct symbol *declaration, struct symbol *definition)
int symdict_get_size_named(struct symdict *symdict)
struct lsymbol * debugfile_lookup_sym__int(struct debugfile *debugfile, char *name, const char *delim, struct rfilter *srcfile_filter, symbol_type_flag_t flags)
int symbol_add_inline_instance(struct symbol *symbol, struct symbol *instance)
void symbol_set_bitsize_all(struct symbol *s, uint32_t b, uint32_t bo, uint32_t ctb)
int scope_insert_scope(struct scope *parent, struct scope *child)
int location_set_loclist(struct location *l, struct loclistloc *list)
int symbol_set_inline_info(struct symbol *symbol, int isinlined, int isdeclinline)
struct debugfile * debugfile_create(debugfile_type_t dtype, debugfile_type_flags_t dtflags, struct binfile *binfile, struct debugfile_load_opts *opts, struct binfile *binfile_pointing)
#define SYMBOL_IS_ROOT(sym)
int(* getregno)(struct location_ctxt *lctxt, common_reg_t reg, REG *o_reg)
void scope_dump(struct scope *scope, struct dump_info *ud)
int symbol_set_root_language(struct symbol *symbol, char *language, int copy, short int lang_code)
struct symbol_root * root
int debugfile_add_type(struct debugfile *debugfile, struct symbol *symbol)
int symbol_expand(struct symbol *symbol)
struct lsymbol * scope_lookup_sym(struct scope *scope, const char *name, const char *delim, symbol_type_flag_t flags)
struct array_list * chain
int symbol_set_root_producer(struct symbol *symbol, char *producer, int copy)
int(* writereg)(struct location_ctxt *lctxt, REG regno, REGVAL regval)
unsigned int isinlineinstance
int scope_contains_addr(struct scope *scope, ADDR addr)
loctype_t location_resolve(struct location *loc, struct location_ctxt *lctxt, struct symbol *symbol, struct location *o_loc)
char * scope_get_name(struct scope *scope)
int(* symbol_replace)(struct debugfile *debugfile, struct symbol *old, struct symbol *new)
#define SIZE_CTBYTES_SIZE
int symbol_set_constval(struct symbol *symbol, void *value, int len, int copy)
int scope_get_overall_range(struct scope *scope, ADDR *low_addr_saveptr, ADDR *high_addr_saveptr, int *is_noncontiguous)
uint8_t compdirname_nofree
#define SYMBOL_IS_FUNC(sym)
struct symbol * symdict_get_sym(struct symdict *symdict, const char *name, symbol_type_flag_t flags)
int(* readword)(struct location_ctxt *lctxt, ADDR real_addr, ADDR *pval)
unsigned int usesshareddatatype
unsigned int size_is_bits
int debugfile_update_root(struct debugfile *debugfile, struct symbol *symbol)
#define SYMBOL_IS_VAR(sym)
int symdict_insert_symbol(struct symdict *symdict, struct symbol *symbol)
#define DATATYPE_CODE_BITS
int symbol_set_entry_pc(struct symbol *symbol, ADDR entry_pc)
int debugfile_define_by_specification(struct debugfile *debugfile, struct symbol *specification, struct symbol *definition)
struct scope * scope_create(struct symbol *owner, SMOFFSET ref)
struct scope * symbol_read_owned_scope(struct symbol *symbol)
void debugfile_handle_declaration(struct debugfile *debugfile, struct symbol *symbol)