/illumos-gate/usr/src/tools/smatch/src/ |
H A D | ctags.c | 37 static void examine_symbol(struct symbol *sym); 68 static inline void show_symbol_tag(FILE *fp, struct symbol *sym) in show_symbol_tag() argument 70 fprintf(fp, "%s\t%s\t%d;\"\t%c\tfile:\n", show_ident(sym->ident), in show_symbol_tag() 71 stream_name(sym->pos.stream), sym->pos.line, (int)sym->kind); in show_symbol_tag() 76 struct symbol *sym; in show_tags() local 91 FOR_EACH_PTR(list, sym) { in show_tags() 92 if (ident == sym->ident && pos.line == sym->pos.line && in show_tags() 93 !strcmp(filename, stream_name(sym->pos.stream))) in show_tags() 96 show_symbol_tag(fp, sym); in show_tags() 97 ident = sym->ident; in show_tags() [all …]
|
H A D | symbol.c | 49 void access_symbol(struct symbol *sym) in access_symbol() argument 51 if (sym->ctype.modifiers & MOD_INLINE) { in access_symbol() 52 if (!sym->accessed) { in access_symbol() 53 add_symbol(&translation_unit_used_list, sym); in access_symbol() 54 sym->accessed = 1; in access_symbol() 61 struct symbol *sym; in lookup_symbol() local 63 for (sym = ident->symbols; sym; sym = sym->next_id) { in lookup_symbol() 64 if (sym->namespace & ns) { in lookup_symbol() 65 sym->used = 1; in lookup_symbol() 66 return sym; in lookup_symbol() [all …]
|
H A D | c2xml.c | 44 static void examine_symbol(struct symbol *sym, xmlNodePtr node); 65 static xmlNodePtr new_sym_node(struct symbol *sym, const char *name, xmlNodePtr parent) in new_sym_node() argument 68 const char *ident = show_ident(sym->ident); in new_sym_node() 71 assert(sym != NULL); in new_sym_node() 80 if (sym->ident && ident) in new_sym_node() 82 newProp(node, "file", stream_name(sym->pos.stream)); in new_sym_node() 84 newNumProp(node, "start-line", sym->pos.line); in new_sym_node() 85 newNumProp(node, "start-col", sym->pos.pos); in new_sym_node() 87 if (sym->endpos.type) { in new_sym_node() 88 newNumProp(node, "end-line", sym->endpos.line); in new_sym_node() [all …]
|
H A D | smatch_type.c | 26 struct symbol *get_real_base_type(struct symbol *sym) in get_real_base_type() argument 30 if (!sym) in get_real_base_type() 32 if (sym->type == SYM_BASETYPE) in get_real_base_type() 33 return sym; in get_real_base_type() 34 ret = get_base_type(sym); in get_real_base_type() 145 struct symbol *sym; in get_symbol_from_deref() local 151 sym = get_type(expr->deref); in get_symbol_from_deref() 152 if (!sym) { in get_symbol_from_deref() 156 if (sym->type == SYM_PTR) in get_symbol_from_deref() 157 sym = get_real_base_type(sym); in get_symbol_from_deref() [all …]
|
H A D | show-parse.c | 44 static int show_symbol_expr(struct symbol *sym); 47 static void do_debug_symbol(struct symbol *sym, int indent) in do_debug_symbol() argument 73 if (!sym) in do_debug_symbol() 76 indent, indent_string, typestr[sym->type], in do_debug_symbol() 77 sym->bit_size, sym->ctype.alignment, in do_debug_symbol() 78 modifier_string(sym->ctype.modifiers), show_ident(sym->ident), in do_debug_symbol() 79 show_as(sym->ctype.as), in do_debug_symbol() 80 sym, stream_name(sym->pos.stream), sym->pos.line, sym->pos.pos, in do_debug_symbol() 81 builtin_typename(sym) ?: ""); in do_debug_symbol() 83 FOR_EACH_PTR(sym->ctype.contexts, context) { in do_debug_symbol() [all …]
|
H A D | smatch_var_sym.c | 22 struct var_sym *alloc_var_sym(const char *var, struct symbol *sym) in alloc_var_sym() argument 28 tmp->sym = sym; in alloc_var_sym() 37 struct symbol *sym; in expr_to_vsl() local 68 var = expr_to_var_sym(expr, &sym); in expr_to_vsl() 69 if (!var || !sym) { in expr_to_vsl() 73 add_var_sym(&ret, var, sym); in expr_to_vsl() 94 if (!b->sym && a->sym) in cmp_var_sym() 96 if (!a->sym && b->sym) in cmp_var_sym() 98 if (a->sym < b->sym) in cmp_var_sym() 100 if (a->sym > b->sym) in cmp_var_sym() [all …]
|
H A D | graph.c | 82 printf("%s store(%s)", s, show_ident(insn->src->sym->ident)); in graph_ep() 89 printf("%s load(%s)", s, show_ident(insn->src->sym->ident)); in graph_ep() 138 internal == !(insn->func->sym->ctype.modifiers & MOD_EXTERN)) { in graph_calls() 141 struct symbol * sym; in graph_calls() local 143 for (sym = insn->func->sym->ident->symbols; in graph_calls() 144 sym; sym = sym->next_id) { in graph_calls() 145 if (sym->namespace & NS_SYMBOL && sym->ep) in graph_calls() 149 if (sym) in graph_calls() 152 bb, sym->ep->entry->bb, in graph_calls() 169 struct symbol *sym; in main() local [all …]
|
H A D | check_syscall_arg_type.c | 53 struct symbol *sym; member 73 if (tl->sym || tl->failed) in typedef_lookup() 75 tl->sym = _typedef_lookup(tl->name); in typedef_lookup() 76 if (!tl->sym) in typedef_lookup() 80 static int is_mode_t(struct symbol *sym) in is_mode_t() argument 86 if (!umode_t.sym) in is_mode_t() 88 type = get_base_type(sym); in is_mode_t() 89 if (type == umode_t.sym) in is_mode_t() 94 static int is_pid_t(struct symbol *sym) in is_pid_t() argument 100 if (!pid_t.sym) in is_pid_t() [all …]
|
H A D | test-dissect.c | 5 static inline char storage(struct symbol *sym) in storage() argument 7 int t = sym->type; in storage() 8 unsigned m = sym->ctype.modifiers; in storage() 11 return sym->pos.stream == dotc_stream ? 's' : 'g'; in storage() 32 static void print_usage(struct position *pos, struct symbol *sym, unsigned mode) in print_usage() argument 42 pos->line, pos->pos, storage(sym), show_mode(mode)); in print_usage() 45 static void r_symbol(unsigned mode, struct position *pos, struct symbol *sym) in r_symbol() argument 47 print_usage(pos, sym, mode); in r_symbol() 49 if (!sym->ident) in r_symbol() 50 sym->ident = built_in_ident("__asm__"); in r_symbol() [all …]
|
H A D | smatch_states.c | 131 static void call_tracker_hooks(int owner, const char *name, struct symbol *sym, struct smatch_state… in call_tracker_hooks() argument 141 (*fn)(owner, name, sym, state); in call_tracker_hooks() 151 struct sm_state *set_state(int owner, const char *name, struct symbol *sym, struct smatch_state *st… in set_state() argument 164 s = __get_state(owner, name, sym); in set_state() 174 call_tracker_hooks(owner, name, sym, state); in set_state() 180 set_state_stree_stack(&fake_cur_stree_stack, owner, name, sym, state); in set_state() 182 ret = set_state_stree(&cur_stree, owner, name, sym, state); in set_state() 190 struct symbol *sym; in set_state_expr() local 194 name = expr_to_var_sym(expr, &sym); in set_state_expr() 195 if (!name || !sym) in set_state_expr() [all …]
|
H A D | smatch_flow.c | 72 static void add_inline_function(struct symbol *sym); 190 struct symbol *sym; in inlinable() local 200 sym = get_base_type(expr->symbol); in inlinable() 201 if (sym->stmt && sym->stmt->type == STMT_COMPOUND) { in inlinable() 202 if (ptr_list_size((struct ptr_list *)sym->stmt->stmts) > 10) in inlinable() 204 if (sym->stmt->type != STMT_COMPOUND) in inlinable() 206 last_stmt = last_ptr_list((struct ptr_list *)sym->stmt->stmts); in inlinable() 208 if (sym->inline_stmt && sym->inline_stmt->type == STMT_COMPOUND) { in inlinable() 209 if (ptr_list_size((struct ptr_list *)sym->inline_stmt->stmts) > 10) in inlinable() 211 if (sym->inline_stmt->type != STMT_COMPOUND) in inlinable() [all …]
|
H A D | inline.c | 53 static struct symbol *copy_symbol(struct position pos, struct symbol *sym) in copy_symbol() argument 55 if (!sym) in copy_symbol() 56 return sym; in copy_symbol() 57 if (sym->ctype.modifiers & (MOD_STATIC | MOD_EXTERN | MOD_TOPLEVEL | MOD_INLINE)) in copy_symbol() 58 return sym; in copy_symbol() 59 if (!sym->replace) { in copy_symbol() 60 warning(pos, "unreplaced symbol '%s'", show_ident(sym->ident)); in copy_symbol() 61 return sym; in copy_symbol() 63 return sym->replace; in copy_symbol() 69 struct symbol *sym; in copy_symbol_list() local [all …]
|
H A D | check_leaks.c | 56 static char *alloc_parent_str(struct symbol *sym) in alloc_parent_str() argument 60 if (!sym || !sym->ident) in alloc_parent_str() 63 snprintf(buf, 255, "%s", sym->ident->name); in alloc_parent_str() 68 static char *get_parent_from_expr(struct expression *expr, struct symbol **sym) in get_parent_from_expr() argument 74 name = expr_to_str_sym(expr, sym); in get_parent_from_expr() 76 if (!name || !*sym || !(*sym)->ident) { in get_parent_from_expr() 77 *sym = NULL; in get_parent_from_expr() 80 return alloc_parent_str(*sym); in get_parent_from_expr() 86 struct symbol *sym; in is_local() local 89 name = expr_to_str_sym(expr, &sym); in is_local() [all …]
|
H A D | check_info_leak.c | 26 static char *my_get_variable(struct expression *expr, struct symbol **sym) in my_get_variable() argument 30 name = expr_to_var_sym(expr, sym); in my_get_variable() 32 if (!name || !*sym) in my_get_variable() 35 return (*sym)->ident->name; in my_get_variable() 41 struct symbol *sym; in match_kmalloc() local 43 name = my_get_variable(expr->left, &sym); in match_kmalloc() 46 set_state(my_id, name, sym, &alloced); in match_kmalloc() 53 struct symbol *sym; in match_strcpy() local 56 name = my_get_variable(dest, &sym); in match_strcpy() 57 if (!name || !sym) in match_strcpy() [all …]
|
H A D | smatch_equiv.c | 36 static struct relation *alloc_relation(const char *name, struct symbol *sym) in alloc_relation() argument 42 tmp->sym = sym; in alloc_relation() 65 if (a->sym > b->sym) in cmp_relation() 67 if (a->sym < b->sym) in cmp_relation() 105 static void add_related(struct related_list **rlist, const char *name, struct symbol *sym) in add_related() argument 111 .sym = sym in add_related() 119 new = alloc_relation(name, sym); in add_related() 123 new = alloc_relation(name, sym); in add_related() 127 … struct related_list *del_related(struct smatch_state *state, const char *name, struct symbol *sym) in del_related() argument 132 .sym = sym, in del_related() [all …]
|
H A D | check_puts_argument.c | 33 static void match_function_def(struct symbol *sym) in match_function_def() argument 35 this_func = sym; in match_function_def() 38 static int parent_is_arg(struct symbol *sym) in parent_is_arg() argument 43 if (sym == arg) in parent_is_arg() 52 struct symbol *sym; in match_put() local 57 name = expr_to_var_sym(tmp, &sym); in match_put() 59 if (parent_is_arg(sym) && sym->ident) in match_put() 60 set_state(my_id, sym->ident->name, sym, &putted); in match_put() 78 tmp->sym); in match_return() 82 tmp = get_sm_state(my_id, tracker->name, tracker->sym); in match_return() [all …]
|
H A D | smatch_tracker.c | 22 struct tracker *alloc_tracker(int owner, const char *name, struct symbol *sym) in alloc_tracker() argument 29 tmp->sym = sym; in alloc_tracker() 34 struct symbol *sym) in add_tracker() argument 38 if (in_tracker_list(*list, owner, name, sym)) in add_tracker() 40 tmp = alloc_tracker(owner, name, sym); in add_tracker() 47 struct symbol *sym; in add_tracker_expr() local 49 name = expr_to_var_sym(expr, &sym); in add_tracker_expr() 50 if (!name || !sym) in add_tracker_expr() 52 add_tracker(list, owner, name, sym); in add_tracker_expr() 64 struct symbol *sym) in del_tracker() argument [all …]
|
/illumos-gate/usr/src/cmd/sgs/elfedit/modules/common/ |
H A D | sym.c | 155 } sym; member 210 symstate->sym.sec->sec_shdr->sh_link, 0); in symstate_add_str() 219 symstate->sym.sec, &symstate->versym.data, &symstate->versym.n); in symstate_add_versym() 228 symstate->sym.sec, &symstate->xshndx.data, &symstate->xshndx.n); in symstate_add_xshndx() 250 Sym *sym; in dump_symtab() local 257 symsec = symstate->sym.sec; in dump_symtab() 258 sym = symstate->sym.data + ndx; in dump_symtab() 273 for (; cnt-- > 0; ndx++, sym++) { in dump_symtab() 278 symname = elfedit_offset_to_str(strsec, sym->st_name, in dump_symtab() 280 shndx = sym->st_shndx; in dump_symtab() [all …]
|
/illumos-gate/usr/src/uts/common/krtld/ |
H A D | reloc.h | 244 #define REL_ERR_UNIMPL(lml, file, sym, rtype) \ argument 246 _kobj_printf(ops, MSG_REL_SYM, ((sym) ? (sym) : MSG_STR_UNKNOWN)); \ 249 #define REL_ERR_UNSUPSZ(lml, file, sym, rtype, size) \ argument 252 _kobj_printf(ops, MSG_REL_SYM, ((sym) ? (sym) : MSG_STR_UNKNOWN)); \ 255 #define REL_ERR_NONALIGN(lml, file, sym, rtype, off) \ argument 258 _kobj_printf(ops, MSG_REL_SYM, ((sym) ? (sym) : MSG_STR_UNKNOWN)); \ 261 #define REL_ERR_UNNOBITS(lml, file, sym, rtype, nbits) \ argument 264 _kobj_printf(ops, MSG_REL_SYM, ((sym) ? (sym) : MSG_STR_UNKNOWN)); \ 267 #define REL_ERR_LOSEBITS(lml, file, sym, rtype, uvalue, nbits, off) \ argument 270 _kobj_printf(ops, MSG_REL_SYM, ((sym) ? (sym) : MSG_STR_UNKNOWN)); \ [all …]
|
/illumos-gate/usr/src/cmd/dis/ |
H A D | dis_target.c | 260 sym_entry_t *sym; in construct_symtab() local 299 for (i = 0, sym = p_symtab; i < tgt->dt_symcount; i++) { in construct_symtab() 300 if (gelf_getsym(symdata, i, &(sym->se_sym)) == NULL) { in construct_symtab() 310 if (!IS_DATA_TYPE(GELF_ST_TYPE(sym->se_sym.st_info))) { in construct_symtab() 315 if (sym->se_sym.st_shndx == SHN_XINDEX && symshndx != NULL) { in construct_symtab() 319 sym->se_shndx = -1; in construct_symtab() 321 sym->se_shndx = symshndx[i]; in construct_symtab() 324 sym->se_shndx = sym->se_sym.st_shndx; in construct_symtab() 328 if (sym->se_shndx == SHN_ABS) { in construct_symtab() 335 if (sym->se_sym.st_value == 0) { in construct_symtab() [all …]
|
/illumos-gate/usr/src/uts/common/sys/ |
H A D | linker_set.h | 47 #define __GLOBL(sym) __asm__(".globl " __XSTRING(sym)) argument 48 #define __WEAK(sym) __asm__(".weak " __XSTRING(sym)) argument 52 #define __MAKE_SET(set, sym) \ argument 56 __set_##set##_sym_##sym __section("set_" #set) \ 57 __used = &(sym) 62 #define TEXT_SET(set, sym) __MAKE_SET(set, sym) argument 63 #define DATA_SET(set, sym) __MAKE_SET(set, sym) argument 64 #define BSS_SET(set, sym) __MAKE_SET(set, sym) argument 65 #define ABS_SET(set, sym) __MAKE_SET(set, sym) argument 66 #define SET_ENTRY(set, sym) __MAKE_SET(set, sym) argument
|
/illumos-gate/usr/src/cmd/sgs/elfedit/common/ |
H A D | elfconst.c | 255 elfedit_atoui_sym_t *sym = &fill_state->desc[fill_state->cur++]; in libconv_fill_cb() local 257 sym->sym_name = str; in libconv_fill_cb() 258 sym->sym_value = value; in libconv_fill_cb() 268 libconv_fill_iter(sym_table_ent_t *sym, conv_iter_osabi_t osabi, Half mach, in libconv_fill_iter() argument 271 switch (sym->ste_type) { in libconv_fill_iter() 273 (void) (* sym->ste_conv_func.simple)( in libconv_fill_iter() 275 (void) (* sym->ste_conv_func.simple)( in libconv_fill_iter() 280 (void) (* sym->ste_conv_func.osabi)(osabi, in libconv_fill_iter() 282 (void) (* sym->ste_conv_func.osabi)(osabi, in libconv_fill_iter() 287 (void) (* sym->ste_conv_func.mach)(mach, in libconv_fill_iter() [all …]
|
H A D | util.c | 86 elfedit_atoi_value_to_str(const elfedit_atoi_sym_t *sym, elfedit_atoi_t value, in elfedit_atoi_value_to_str() argument 89 for (; sym->sym_name != NULL; sym++) in elfedit_atoi_value_to_str() 90 if (value == sym->sym_value) in elfedit_atoi_value_to_str() 91 return (sym->sym_name); in elfedit_atoi_value_to_str() 99 elfedit_atoui_value_to_str(const elfedit_atoui_sym_t *sym, in elfedit_atoui_value_to_str() argument 102 for (; sym->sym_name != NULL; sym++) in elfedit_atoui_value_to_str() 103 if (value == sym->sym_value) in elfedit_atoui_value_to_str() 104 return (sym->sym_name); in elfedit_atoui_value_to_str() 133 atoi_sym_process(const char *str, const elfedit_atoi_sym_t *sym, in atoi_sym_process() argument 148 for (; sym->sym_name != NULL; sym++) { in atoi_sym_process() [all …]
|
/illumos-gate/usr/src/cmd/mdb/common/modules/libumem/ |
H A D | misc.c | 59 GElf_Sym sym; in umem_set_standalone() local 62 if (mdb_lookup_by_obj(UMEM_OBJNAME, "umem_alloc", &sym) == 0) in umem_set_standalone() 64 else if (mdb_lookup_by_obj(MDB_OBJ_EXEC, "umem_alloc", &sym) == 0) in umem_set_standalone() 79 umem_lookup_by_name(const char *name, GElf_Sym *sym) in umem_lookup_by_name() argument 82 UMEM_OBJNAME), name, sym)); in umem_lookup_by_name() 89 GElf_Sym sym; in umem_readvar() local 91 if (umem_lookup_by_name(name, &sym)) in umem_readvar() 94 if (mdb_vread(buf, sym.st_size, (uintptr_t)sym.st_value) in umem_readvar() 95 == sym.st_size) in umem_readvar() 96 return ((ssize_t)sym.st_size); in umem_readvar() [all …]
|
/illumos-gate/usr/src/lib/libm/common/C/ |
H A D | libm.h | 54 #define LIBM_ANSI_PRAGMA_WEAK(sym,stype) \ argument 55 .weak __##sym; \ 56 .type __##sym,#stype; \ 57 __##sym = sym 84 #define PIC_SET(via,sym,dst) ldx [%via+sym],%dst argument 86 #define PIC_SET(via,sym,dst) ld [%via+sym],%dst argument 95 #define PIC_SET(via,sym,dst) setx sym,%g1,%dst argument 97 #define PIC_SET(via,sym,dst) set sym,%dst argument 153 #define LIBM_ANSI_PRAGMA_WEAK(sym,stype) \ argument 154 .weak __##sym; \ [all …]
|