CORE_ADDR addr;
};
-/* A helper struct which just holds a minimal symbol and the object
- file from which it came. */
+typedef struct bound_minimal_symbol bound_minimal_symbol_d;
-typedef struct minsym_and_objfile
-{
- struct minimal_symbol *minsym;
- struct objfile *objfile;
-} minsym_and_objfile_d;
-
-DEF_VEC_O (minsym_and_objfile_d);
+DEF_VEC_O (bound_minimal_symbol_d);
/* An enumeration of possible signs for a line offset. */
enum offset_relative_sign
/* A list of matching function symbols and minimal symbols. Both lists
may be NULL if no matching symbols were found. */
VEC (symbolp) *function_symbols;
- VEC (minsym_and_objfile_d) *minimal_symbols;
+ VEC (bound_minimal_symbol_d) *minimal_symbols;
/* The name of a label and matching symbols. */
struct
{
VEC (symbolp) *symbols;
- VEC (minsym_and_objfile_d) *minimal_symbols;
+ VEC (bound_minimal_symbol_d) *minimal_symbols;
} result;
};
VEC (symtab_ptr) *file_symtabs,
const char *name,
VEC (symbolp) **symbols,
- VEC (minsym_and_objfile_d) **minsyms);
+ VEC (bound_minimal_symbol_d) **minsyms);
static struct line_offset
linespec_parse_variable (struct linespec_state *self,
char *name;
linespec_token token;
VEC (symbolp) *symbols, *labels;
- VEC (minsym_and_objfile_d) *minimal_symbols;
+ VEC (bound_minimal_symbol_d) *minimal_symbols;
struct cleanup *cleanup;
/* Get the next token. */
int i;
struct symtab_and_line sal;
struct symbol *sym;
- minsym_and_objfile_d *elem;
+ bound_minimal_symbol_d *elem;
struct program_space *pspace;
if (ls->function_symbols != NULL)
if (ls->minimal_symbols != NULL)
{
/* Sort minimal symbols by program space, too. */
- qsort (VEC_address (minsym_and_objfile_d, ls->minimal_symbols),
- VEC_length (minsym_and_objfile_d, ls->minimal_symbols),
- sizeof (minsym_and_objfile_d), compare_msymbols);
+ qsort (VEC_address (bound_minimal_symbol_d, ls->minimal_symbols),
+ VEC_length (bound_minimal_symbol_d, ls->minimal_symbols),
+ sizeof (bound_minimal_symbol_d), compare_msymbols);
for (i = 0;
- VEC_iterate (minsym_and_objfile_d, ls->minimal_symbols, i, elem);
+ VEC_iterate (bound_minimal_symbol_d, ls->minimal_symbols,
+ i, elem);
++i)
{
pspace = elem->objfile->pspace;
VEC_free (symbolp, PARSER_RESULT (parser)->function_symbols);
if (PARSER_RESULT (parser)->minimal_symbols != NULL)
- VEC_free (minsym_and_objfile_d, PARSER_RESULT (parser)->minimal_symbols);
+ VEC_free (bound_minimal_symbol_d, PARSER_RESULT (parser)->minimal_symbols);
if (PARSER_RESULT (parser)->labels.label_symbols != NULL)
VEC_free (symbolp, PARSER_RESULT (parser)->labels.label_symbols);
add_all_symbol_names_from_pspace (&info, NULL, symbol_names);
if (!VEC_empty (symbolp, info.result.symbols)
- || !VEC_empty (minsym_and_objfile_d, info.result.minimal_symbols))
+ || !VEC_empty (bound_minimal_symbol_d, info.result.minimal_symbols))
{
char *saved_arg;
static int
compare_msymbols (const void *a, const void *b)
{
- const struct minsym_and_objfile *sa = a;
- const struct minsym_and_objfile *sb = b;
+ const struct bound_minimal_symbol *sa = a;
+ const struct bound_minimal_symbol *sb = b;
uintptr_t uia, uib;
uia = (uintptr_t) sa->objfile->pspace;
find_method (struct linespec_state *self, VEC (symtab_ptr) *file_symtabs,
const char *class_name, const char *method_name,
VEC (symbolp) *sym_classes, VEC (symbolp) **symbols,
- VEC (minsym_and_objfile_d) **minsyms)
+ VEC (bound_minimal_symbol_d) **minsyms)
{
struct symbol *sym;
struct cleanup *cleanup = make_cleanup (null_cleanup, NULL);
}
if (!VEC_empty (symbolp, info.result.symbols)
- || !VEC_empty (minsym_and_objfile_d, info.result.minimal_symbols))
+ || !VEC_empty (bound_minimal_symbol_d, info.result.minimal_symbols))
{
*symbols = info.result.symbols;
*minsyms = info.result.minimal_symbols;
find_function_symbols (struct linespec_state *state,
VEC (symtab_ptr) *file_symtabs, const char *name,
VEC (symbolp) **symbols,
- VEC (minsym_and_objfile_d) **minsyms)
+ VEC (bound_minimal_symbol_d) **minsyms)
{
struct collect_info info;
VEC (const_char_ptr) *symbol_names = NULL;
else
*symbols = info.result.symbols;
- if (VEC_empty (minsym_and_objfile_d, info.result.minimal_symbols))
+ if (VEC_empty (bound_minimal_symbol_d, info.result.minimal_symbols))
{
- VEC_free (minsym_and_objfile_d, info.result.minimal_symbols);
+ VEC_free (bound_minimal_symbol_d, info.result.minimal_symbols);
*minsyms = NULL;
}
else
VEC (symtab_ptr) *file_symtabs,
const char *name,
VEC (symbolp) **symbols,
- VEC (minsym_and_objfile_d) **minsyms)
+ VEC (bound_minimal_symbol_d) **minsyms)
{
struct cleanup *cleanup;
char *canon;
the name into class and method names and searching the class and its
baseclasses. */
if (VEC_empty (symbolp, *symbols)
- && VEC_empty (minsym_and_objfile_d, *minsyms))
+ && VEC_empty (bound_minimal_symbol_d, *minsyms))
{
char *klass, *method;
const char *last, *p, *scope_op;
int list_mode;
/* The resulting symbols. */
- VEC (minsym_and_objfile_d) *msyms;
+ VEC (bound_minimal_symbol_d) *msyms;
};
/* A helper function to classify a minimal_symbol_type according to
static int
compare_msyms (const void *a, const void *b)
{
- const minsym_and_objfile_d *moa = a;
- const minsym_and_objfile_d *mob = b;
+ const bound_minimal_symbol_d *moa = a;
+ const bound_minimal_symbol_d *mob = b;
enum minimal_symbol_type ta = MSYMBOL_TYPE (moa->minsym);
enum minimal_symbol_type tb = MSYMBOL_TYPE (mob->minsym);
add_minsym (struct minimal_symbol *minsym, void *d)
{
struct collect_minsyms *info = d;
- minsym_and_objfile_d mo;
+ bound_minimal_symbol_d mo;
/* Exclude data symbols when looking for breakpoint locations. */
if (!info->list_mode)
mo.minsym = minsym;
mo.objfile = info->objfile;
- VEC_safe_push (minsym_and_objfile_d, info->msyms, &mo);
+ VEC_safe_push (bound_minimal_symbol_d, info->msyms, &mo);
}
/* Search minimal symbols in all objfiles for NAME. If SEARCH_PSPACE
local.funfirstline = info->state->funfirstline;
local.list_mode = info->state->list_mode;
- cleanup = make_cleanup (VEC_cleanup (minsym_and_objfile_d),
+ cleanup = make_cleanup (VEC_cleanup (bound_minimal_symbol_d),
&local.msyms);
ALL_OBJFILES (objfile)
iterate_over_minimal_symbols (objfile, name, add_minsym, &local);
}
- if (!VEC_empty (minsym_and_objfile_d, local.msyms))
+ if (!VEC_empty (bound_minimal_symbol_d, local.msyms))
{
int classification;
int ix;
- minsym_and_objfile_d *item;
+ bound_minimal_symbol_d *item;
- qsort (VEC_address (minsym_and_objfile_d, local.msyms),
- VEC_length (minsym_and_objfile_d, local.msyms),
- sizeof (minsym_and_objfile_d),
+ qsort (VEC_address (bound_minimal_symbol_d, local.msyms),
+ VEC_length (bound_minimal_symbol_d, local.msyms),
+ sizeof (bound_minimal_symbol_d),
compare_msyms);
/* Now the minsyms are in classification order. So, we walk
over them and process just the minsyms with the same
classification as the very first minsym in the list. */
- item = VEC_index (minsym_and_objfile_d, local.msyms, 0);
+ item = VEC_index (bound_minimal_symbol_d, local.msyms, 0);
classification = classify_mtype (MSYMBOL_TYPE (item->minsym));
for (ix = 0;
- VEC_iterate (minsym_and_objfile_d, local.msyms, ix, item);
+ VEC_iterate (bound_minimal_symbol_d, local.msyms, ix, item);
++ix)
{
if (classify_mtype (MSYMBOL_TYPE (item->minsym)) != classification)
break;
- VEC_safe_push (minsym_and_objfile_d,
+ VEC_safe_push (bound_minimal_symbol_d,
info->result.minimal_symbols, item);
}
}