{
/* In list mode, add all matching symbols, regardless of class.
This allows the user to type "list a_global_variable". */
- if (SYMBOL_CLASS (bsym->symbol) == LOC_BLOCK || this->state->list_mode)
+ if (bsym->symbol->aclass () == LOC_BLOCK || this->state->list_mode)
this->result.symbols->push_back (*bsym);
/* Continue iterating. */
{
/* Restrict calls to CALLBACK to symbols
representing inline symbols only. */
- if (SYMBOL_INLINED (bsym->symbol))
+ if (bsym->symbol->is_inlined ())
return callback (bsym);
return true;
});
superclasses->push_back (TYPE_BASECLASS (t, ibase));
}
-/* Find an instance of the character C in the string S that is outside
- of all parenthesis pairs, single-quoted strings, and double-quoted
- strings. Also, ignore the char within a template name, like a ','
- within foo<int, int>, while considering C++ operator</operator<<. */
-
-const char *
-find_toplevel_char (const char *s, char c)
-{
- int quoted = 0; /* zero if we're not in quotes;
- '"' if we're in a double-quoted string;
- '\'' if we're in a single-quoted string. */
- int depth = 0; /* Number of unclosed parens we've seen. */
- const char *scan;
-
- for (scan = s; *scan; scan++)
- {
- if (quoted)
- {
- if (*scan == quoted)
- quoted = 0;
- else if (*scan == '\\' && *(scan + 1))
- scan++;
- }
- else if (*scan == c && ! quoted && depth == 0)
- return scan;
- else if (*scan == '"' || *scan == '\'')
- quoted = *scan;
- else if (*scan == '(' || *scan == '<')
- depth++;
- else if ((*scan == ')' || *scan == '>') && depth > 0)
- depth--;
- else if (*scan == 'o' && !quoted && depth == 0)
- {
- /* Handle C++ operator names. */
- if (strncmp (scan, CP_OPERATOR_STR, CP_OPERATOR_LEN) == 0)
- {
- scan += CP_OPERATOR_LEN;
- if (*scan == c)
- return scan;
- while (isspace (*scan))
- {
- ++scan;
- if (*scan == c)
- return scan;
- }
- if (*scan == '\0')
- break;
-
- switch (*scan)
- {
- /* Skip over one less than the appropriate number of
- characters: the for loop will skip over the last
- one. */
- case '<':
- if (scan[1] == '<')
- {
- scan++;
- if (*scan == c)
- return scan;
- }
- break;
- case '>':
- if (scan[1] == '>')
- {
- scan++;
- if (*scan == c)
- return scan;
- }
- break;
- }
- }
- }
- }
-
- return 0;
-}
-
/* The string equivalent of find_toplevel_char. Returns a pointer
to the location of NEEDLE in HAYSTACK, ignoring any occurrences
inside "()" and "<>". Returns NULL if NEEDLE was not found. */
if (state->funfirstline
&& !ls->minimal_symbols.empty ()
- && SYMBOL_CLASS (sym.symbol) == LOC_BLOCK)
+ && sym.symbol->aclass () == LOC_BLOCK)
{
const CORE_ADDR addr
= BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (sym.symbol));
struct type *t;
struct symbol *sym = bsym->symbol;
- if (SYMBOL_CLASS (sym) != LOC_TYPEDEF)
+ if (sym->aclass () != LOC_TYPEDEF)
return true; /* Continue iterating. */
- t = SYMBOL_TYPE (sym);
+ t = sym->type ();
t = check_typedef (t);
if (t->code () != TYPE_CODE_STRUCT
&& t->code () != TYPE_CODE_UNION
pspace = symbol_symtab (sym)->pspace ();
gdb_assert (!pspace->executing_startup);
set_current_program_space (pspace);
- t = check_typedef (SYMBOL_TYPE (sym));
+ t = check_typedef (sym->type ());
find_methods (t, sym->language (),
method_name, &result_names, &superclass_vec);
ALL_BLOCK_SYMBOLS (block, iter, sym)
{
if (symbol_matches_domain (sym->language (),
- SYMBOL_DOMAIN (sym), LABEL_DOMAIN)
+ sym->domain (), LABEL_DOMAIN)
&& cmp (sym->search_name (), name, name_len) == 0)
{
result->push_back ({sym, block});
if (!list_mode && !msymbol_is_function (objfile, minsym))
return;
- struct bound_minimal_symbol mo = {minsym, objfile};
- msyms->push_back (mo);
+ msyms->emplace_back (minsym, objfile);
return;
}
symbol_to_sal (struct symtab_and_line *result,
int funfirstline, struct symbol *sym)
{
- if (SYMBOL_CLASS (sym) == LOC_BLOCK)
+ if (sym->aclass () == LOC_BLOCK)
{
*result = find_function_start_sal (sym, funfirstline);
return 1;
}
else
{
- if (SYMBOL_CLASS (sym) == LOC_LABEL && SYMBOL_VALUE_ADDRESS (sym) != 0)
+ if (sym->aclass () == LOC_LABEL && SYMBOL_VALUE_ADDRESS (sym) != 0)
{
*result = {};
result->symtab = symbol_symtab (sym);
result->symbol = sym;
- result->line = SYMBOL_LINE (sym);
+ result->line = sym->line ();
result->pc = SYMBOL_VALUE_ADDRESS (sym);
result->pspace = result->symtab->pspace ();
result->explicit_pc = 1;
{
/* Nothing. */
}
- else if (SYMBOL_LINE (sym) != 0)
+ else if (sym->line () != 0)
{
/* We know its line number. */
*result = {};
result->symtab = symbol_symtab (sym);
result->symbol = sym;
- result->line = SYMBOL_LINE (sym);
+ result->line = sym->line ();
result->pc = SYMBOL_VALUE_ADDRESS (sym);
result->pspace = result->symtab->pspace ();
return 1;