Home | History | Annotate | Download | only in debuggerd

Lines Matching defs:table

35  *  Create a symbol table from a given file
42 * Free symbol table with symbol_table_free()
46 struct symbol_table *table = NULL;
53 XLOG2("Creating symbol table for %s\n", filename);
90 table = malloc(sizeof(struct symbol_table));
91 if(!table) {
94 table->name = strdup(filename);
95 table->num_symbols = 0;
122 // Iterate through the dynamic symbol table, and count how many symbols
133 // Iterate through the symbol table, and count how many symbols
145 // Now, create an entry in our symbol table structure for each symbol...
146 table->num_symbols += symbol_count + dynsymbol_count;
147 table->symbols = malloc(table->num_symbols * sizeof(struct symbol));
148 if(!table->symbols) {
149 free(table);
150 table = NULL;
160 table->symbols[j].name = strdup(dynstr + dynsyms[i].st_name);
161 table->symbols[j].addr = dynsyms[i].st_value;
162 table->symbols[j].size = dynsyms[i].st_size;
164 table->symbols[j].name, table->symbols[j].addr, table->symbols[j].size);
176 table->symbols[j].name = strdup(str + syms[i].st_name);
177 table->symbols[j].addr = syms[i].st_value;
178 table->symbols[j].size = syms[i].st_size;
180 table->symbols[j].name, table->symbols[j].addr, table->symbols[j].size);
186 // Sort the symbol table entries, so they can be bsearched later
187 qsort(table->symbols, table->num_symbols, sizeof(struct symbol), qcompar);
196 return table;
200 * Free a symbol table
203 * table - Table to free
205 void symbol_table_free(struct symbol_table *table)
209 if(!table) {
213 for(i=0; i<table->num_symbols; i++) {
214 free(table->symbols[i].name);
217 free(table->symbols);
218 free(table);
222 * Search for an address in the symbol table
225 * table - Table to search in
233 const struct symbol *symbol_table_lookup(struct symbol_table *table, unsigned int addr)
235 if(!table) {
239 return bsearch((void*)addr, table->symbols, table->num_symbols, sizeof(struct symbol), bcompar);