43 #include "filenames.h" 252 #define IF_KEYWORD_INDEX 0 273 #define LS_TOKEN_STOKEN(TOK) (TOK).data.string 274 #define LS_TOKEN_KEYWORD(TOK) (TOK).data.keyword 288 #define PARSER_STREAM(P) ((P)->lexer.stream) 299 #define PARSER_STATE(PPTR) (&(PPTR)->state) 303 #define PARSER_RESULT(PPTR) (&(PPTR)->result) 332 #define PARSER_EXPLICIT(PPTR) (&PARSER_RESULT ((PPTR))->explicit_loc) 357 bool completion_mode =
false);
368 const char *variable);
371 int funfirstline,
struct symbol *sym);
385 collect_symtabs_from_filename (
const char *file,
401 std::vector<symtab_and_line> *result);
410 static const char *
const linespec_quote_characters =
"\"\'";
444 && !strchr (linespec_quote_characters, *
PARSER_STREAM (parser)))
488 && isspace (p[nextlen]))
522 const char *p, *last;
525 while (p && *p !=
'\0' && *p !=
':')
559 if (strchr (linespec_quote_characters, *p))
572 char end_char, start_char;
577 if (start_char ==
'(')
579 else if (start_char ==
'<')
588 if (*p == start_char)
590 else if (*p == end_char)
610 const char *
string,
size_t string_len)
612 const char *end =
string + string_len;
615 while (p >
string && *p !=
' ')
620 size_t len = end - p;
621 for (
size_t i = 0; keywords[i] != NULL; ++i)
622 if (strncmp (keywords[i], p, len) == 0)
641 if (strchr (linespec_quote_characters, *
PARSER_STREAM (parser)))
648 && quote_char ==
'\"')
685 error (
_(
"unmatched quote"));
768 && strchr (linespec_quote_characters,
791 while (p > start && isspace (p[-1]))
798 || !(isalnum (p[-1]) || p[-1] ==
'_')))
893 case '0':
case '1':
case '2':
case '3':
case '4':
894 case '5':
case '6':
case '7':
case '8':
case '9':
895 if (!linespec_lexer_lex_number (parser, &(parser->
lexer.
current)))
911 case '\'':
case '\"':
978 else if (advance_word)
1019 std::vector<symtab_and_line> *sals,
1021 const char *symname,
int literal_canonical)
1023 sals->push_back (*sal);
1025 if (self->canonical)
1030 self->canonical_names,
1032 canonical = &
self->canonical_names[sals->size () - 1];
1033 if (!literal_canonical && sal->
symtab)
1040 if (symname != NULL && sal->
line != 0
1043 else if (symname != NULL)
1044 canonical->suffix = xstrdup (symname);
1047 canonical->symtab = sal->
symtab;
1051 if (symname != NULL)
1052 canonical->suffix = xstrdup (symname);
1054 canonical->suffix = xstrdup (
"<unknown>");
1055 canonical->symtab = NULL;
1068 hash = iterative_hash_object (aep->
pspace, 0);
1069 return iterative_hash_object (aep->
addr,
hash);
1095 slot = htab_find_slot (
set, &e, INSERT);
1126 if (search_pspace != NULL && search_pspace != pspace)
1161 (
block, lookup_name, name_domain, [&] (
symbol *sym)
1166 return callback (sym);
1179 static const struct block *
1238 method_counter >= 0;
1242 char dem_opname[64];
1248 if (cplus_demangle_opname (method_name, dem_opname, DMGL_ANSI))
1249 method_name = dem_opname;
1250 else if (cplus_demangle_opname (method_name, dem_opname, 0))
1251 method_name = dem_opname;
1254 if (symbol_name_compare (method_name, lookup_name, NULL))
1264 const char *phys_name;
1298 if (*
scan == quoted)
1300 else if (*
scan ==
'\\' && *(
scan + 1))
1303 else if (*
scan == c && ! quoted && depth == 0)
1305 else if (*
scan ==
'"' || *
scan ==
'\'')
1307 else if (*
scan ==
'(' || *
scan ==
'<')
1309 else if ((*
scan ==
')' || *
scan ==
'>') && depth > 0)
1311 else if (*
scan ==
'o' && !quoted && depth == 0)
1319 while (isspace (*
scan))
1364 const char *s = haystack;
1381 while (s != NULL && *s !=
'\0');
1393 if (canonical->
symtab == NULL)
1394 return xstrdup (canonical->
suffix);
1405 std::vector<symtab_and_line> *result,
1415 for (
size_t j = 0; j < result->size (); ++j)
1421 canonical = &
self->canonical_names[j];
1425 if (strcmp (
name, fullform) == 0)
1426 lsal.
sals.push_back ((*result)[j]);
1431 if (!lsal.
sals.empty ())
1434 self->canonical->lsals.push_back (std::move (lsal));
1438 self->canonical->pre_expanded = 0;
1445 std::vector<symtab_and_line> *result)
1450 lsal.
sals = std::move (*result);
1451 self->canonical->lsals.push_back (std::move (lsal));
1499 std::vector<symtab_and_line> *result,
1500 const char *select_mode)
1517 items_count = result->size ();
1520 for (i = 0; i < items_count; ++i)
1525 canonical = &
self->canonical_names[i];
1532 if (canonical->
symtab == NULL)
1536 const char *fn_for_display;
1551 if (items_count >= 2)
1556 for (src = &items[1]; src < &items[items_count]; src++)
1559 items_count = dst + 1 - items;
1563 error (
_(
"canceled because the command is ambiguous\n" 1564 "See set/show multiple-symbol."));
1574 for (i = 0; i < items_count; i++)
1577 prompt = getenv (
"PS2");
1584 if (args == 0 || *args == 0)
1608 if (num >= items_count)
1638 static void ATTRIBUTE_NORETURN
1648 _(
"No symbol table is loaded. Use the \"file\" command."));
1658 _(
"Undefined convenience variable or function \"%s\" " 1659 "not defined in \"%s\"."),
symbol, filename);
1662 _(
"Undefined convenience variable or function \"%s\" " 1663 "not defined."),
symbol);
1669 _(
"Function \"%s\" not defined in \"%s\"."),
1673 _(
"Function \"%s\" not defined."),
symbol);
1680 static void ATTRIBUTE_NORETURN
1684 static const char * token_type_strings[]
1685 = {
"keyword",
"colon",
"string",
"number",
"comma",
"end of input"};
1699 _(
"malformed linespec error: unexpected %s, \"%s\""),
1700 token_type_strings[
token.type],
string);
1704 _(
"malformed linespec error: unexpected %s"),
1705 token_type_strings[
token.type]);
1710 static void ATTRIBUTE_NORETURN
1713 if (
function != NULL)
1715 _(
"No label \"%s\" defined in function \"%s\"."),
1719 _(
"No label \"%s\" defined in current function."),
1725 static void ATTRIBUTE_NORETURN
1747 const char *start =
string;
1755 else if (*
string ==
'-')
1761 if (*
string !=
'\0' && !isdigit (*
string))
1762 error (
_(
"malformed line offset: \"%s\""), start);
1872 const char *source_filename
1905 &symbols, &minimal_symbols);
1907 if (symbols != NULL || minimal_symbols != NULL)
1919 labels = find_label_symbols (
PARSER_STATE (parser), NULL,
2136 static std::vector<symtab_and_line>
2140 int use_default = 0;
2151 const char *fullname;
2161 ls->file_symtabs = collect_symtabs_from_filename (fullname,
2162 self->search_pspace);
2174 val.
line =
self->default_line + val.
line;
2181 val.
line =
self->default_line - val.
line;
2190 std::vector<symtab_and_line> values;
2191 if (self->list_mode)
2198 std::vector<symtab_and_line> intermediate_results
2200 if (intermediate_results.empty () && best_entry != NULL)
2218 for (i = 0; i < intermediate_results.size (); ++i)
2224 intermediate_results[i].section);
2227 for (i = 0; i < intermediate_results.size (); ++i)
2229 if (blocks[i] != NULL)
2230 for (j = i + 1; j < intermediate_results.size (); ++j)
2232 if (blocks[j] == blocks[i])
2240 for (i = 0; i < intermediate_results.size (); ++i)
2243 struct symbol *sym = (blocks[i]
2247 if (self->funfirstline)
2251 intermediate_results[i].line = val.
line;
2257 if (values.empty ())
2272 static std::vector<symtab_and_line>
2281 std::vector<symtab_and_line> sals;
2289 static std::vector<symtab_and_line>
2292 std::vector<symtab_and_line> sals;
2294 if (ls->
labels.label_symbols != NULL)
2311 else if (ls->function_symbols != NULL || ls->minimal_symbols != NULL)
2320 if (ls->function_symbols != NULL)
2339 if (ls->minimal_symbols != NULL)
2382 if (!sals.empty () && state->
canonical != NULL)
2394 const char *source_filename,
2395 const char *function_name,
2397 const char *label_name,
2405 if (source_filename != NULL)
2409 result->file_symtabs
2410 = symtabs_from_filename (source_filename, self->search_pspace);
2425 if (function_name != NULL)
2428 function_name, fname_match_type,
2429 &symbols, &minimal_symbols);
2431 if (symbols == NULL && minimal_symbols == NULL)
2436 result->function_symbols = symbols;
2437 result->minimal_symbols = minimal_symbols;
2440 if (label_name != NULL)
2443 labels = find_label_symbols (
self, result->function_symbols,
2444 &symbols, label_name);
2451 result->
labels.label_symbols = labels;
2452 result->
labels.function_symbols = symbols;
2461 static std::vector<symtab_and_line>
2526 static std::vector<symtab_and_line>
2540 && strchr (linespec_quote_characters, *
arg) != NULL)
2567 std::vector<symtab_and_line> values
2569 if (!values.empty ())
2578 if ((
arg[0] ==
'-' ||
arg[0] ==
'+') &&
arg[1] ==
'\0')
2610 goto convert_to_sals;
2630 char *user_filename;
2640 = symtabs_from_filename (user_filename,
2645 file_exception = ex;
2649 if (file_exception.
reason >= 0)
2663 xfree (user_filename);
2696 if (file_exception.
reason < 0)
2736 struct symtab *default_symtab,
2740 memset (
self, 0,
sizeof (*
self));
2744 self->search_pspace = search_pspace;
2745 self->default_symtab = default_symtab;
2746 self->default_line = default_line;
2747 self->canonical = canonical;
2751 self->is_linespec = 0;
2760 struct symtab *default_symtab,
2772 default_symtab, default_line, canonical);
2780 htab_delete (self->addr_set);
2806 if (
PARSER_RESULT (parser)->labels.function_symbols != NULL)
2822 if (stringp == NULL || *stringp == NULL)
2849 const char *
function,
2851 const char *source_filename)
2855 if (source_filename != NULL)
2858 function,
function, source_filename);
2863 function,
function);
2876 const char *source_filename)
2895 if (source_filename == NULL)
2908 char *fn = fn_list[0].release ();
2915 char quote_char_str[2] = { tracker.
quote_char () };
2917 fn = reconcat (fn, fn, quote_char_str, (
char *) NULL);
2921 fn = reconcat (fn, fn,
":", (
char *) NULL);
2922 fn_list[0].reset (fn);
2938 const char *label_name)
2940 VEC (
symbolp) *label_function_symbols = NULL;
2944 &label_function_symbols,
2962 const char *source_filename,
2963 const char *function_name,
2965 const char *label_name)
2981 func_name_match_type,
2982 NULL, unknown_offset);
3004 const char *orig = text;
3067 func_name, match_type,
3068 &function_symbols, &minimal_symbols);
3070 PARSER_RESULT (&parser)->function_symbols = function_symbols;
3179 if (end > orig && end[-1] ==
' ')
3195 static std::vector<symtab_and_line>
3199 std::vector<symtab_and_line> result;
3225 if (addr_string != NULL)
3227 char *expr = xstrdup (addr_string);
3272 struct symtab *default_symtab,
3274 const char *select_mode,
3306 if (!result.empty ())
3311 for (i = 0; i < result.size (); ++i)
3318 if (select_mode == NULL)
3345 std::vector<symtab_and_line>
3355 search_pspace, default_symtab,
3356 default_line, NULL);
3370 std::vector<symtab_and_line>
3374 error (
_(
"Empty line specification."));
3382 std::vector<symtab_and_line> sals
3386 error (
_(
"Junk at end of line specification: %s"),
string);
3393 std::vector<symtab_and_line>
3397 error (
_(
"Empty line specification."));
3401 std::vector<symtab_and_line> sals
3407 (
struct symtab *) NULL, 0));
3410 error (
_(
"Junk at end of line specification: %s"),
string);
3423 if (*default_symtab == 0)
3431 *default_symtab = cursal.
symtab;
3432 *default_line = cursal.
line;
3448 "program space is in startup"));
3463 static std::vector<symtab_and_line>
3468 const char *new_argptr;
3473 info.file_symtabs = NULL;
3476 info.
result.symbols = NULL;
3477 info.
result.minimal_symbols = NULL;
3489 std::vector<symtab_and_line> values;
3495 saved_arg = (
char *) alloca (new_argptr -
arg + 1);
3496 memcpy (saved_arg,
arg, new_argptr -
arg);
3497 saved_arg[new_argptr -
arg] =
'\0';
3500 ls->function_symbols = info.
result.symbols;
3501 ls->minimal_symbols = info.
result.minimal_symbols;
3504 if (self->canonical)
3509 self->canonical->pre_expanded = 1;
3516 str = holder.c_str ();
3521 self->canonical->location
3536 class decode_compound_collector
3539 decode_compound_collector ()
3542 m_unique_syms = htab_create_alloc (1, htab_hash_pointer,
3543 htab_eq_pointer, NULL,
3547 ~decode_compound_collector ()
3549 if (m_unique_syms != NULL)
3550 htab_delete (m_unique_syms);
3562 bool operator () (
symbol *sym);
3567 htab_t m_unique_syms;
3574 decode_compound_collector::operator () (
symbol *sym)
3589 slot = htab_find_slot (m_unique_syms, sym, INSERT);
3605 const char *class_name)
3609 decode_compound_collector collector;
3619 NULL,
false, collector);
3622 NULL,
false, collector);
3635 return collector.release_symbols ();
3645 struct symbol *
const *sa = (
struct symbol *
const*) a;
3646 struct symbol *
const *sb = (
struct symbol *
const*) b;
3657 uia = (uintptr_t) *sa;
3658 uib = (uintptr_t) *sb;
3687 uia = (uintptr_t) sa->
minsym;
3688 uib = (uintptr_t) sb->
minsym;
3727 iter_classes = superclasses;
3742 iter_classes = new_supers;
3754 const char *class_name,
const char *method_name,
3761 int last_result_len;
3774 info.file_symtabs = file_symtabs;
3775 info.
result.symbols = NULL;
3776 info.
result.minimal_symbols = NULL;
3787 superclass_vec = NULL;
3789 result_names = NULL;
3791 last_result_len = 0;
3804 method_name, &result_names, &superclass_vec);
3833 *symbols = info.
result.symbols;
3834 *minsyms = info.
result.minimal_symbols;
3851 class symtab_collector
3857 m_symtab_table = htab_create (1, htab_hash_pointer, htab_eq_pointer,
3861 ~symtab_collector ()
3863 if (m_symtab_table != NULL)
3864 htab_delete (m_symtab_table);
3868 bool operator () (
symtab *sym);
3883 htab_t m_symtab_table;
3891 slot = htab_find_slot (m_symtab_table,
symtab, INSERT);
3908 collect_symtabs_from_filename (
const char *file,
3911 symtab_collector collector;
3914 if (search_pspace == NULL)
3933 return collector.release_symtabs ();
3940 symtabs_from_filename (
const char *filename,
3945 result = collect_symtabs_from_filename (filename, search_pspace);
3951 _(
"No symbol table is loaded. " 3952 "Use the \"file\" command."));
3976 info.
result.symbols = NULL;
3977 info.
result.minimal_symbols = NULL;
3978 info.file_symtabs = file_symtabs;
3997 *symbols = info.
result.symbols;
4005 *minsyms = info.
result.minimal_symbols;
4014 const char *lookup_name,
4020 if (!canon.empty ())
4021 lookup_name = canon.c_str ();
4043 const char *last, *p, *scope_op;
4066 klass =
std::string (lookup_name, last - lookup_name);
4069 last += strlen (scope_op);
4073 classes = lookup_prefix_sym (state, file_symtabs, klass.c_str ());
4083 klass.c_str (), method.c_str (),
4084 classes, symbols, minsyms);
4111 bool completion_mode,
4115 if (completion_mode)
4119 size_t name_len = strlen (
name);
4121 int (*cmp) (
const char *,
const char *, size_t);
4157 bool completion_mode)
4164 if (function_symbols == NULL)
4178 &result, label_funcs_ret);
4189 &result, label_funcs_ret);
4200 static std::vector<symtab_and_line>
4210 std::vector<symtab_and_line> values;
4237 static std::vector<symtab_and_line>
4246 std::vector<symtab_and_line> sals;
4249 std::vector<CORE_ADDR> pcs;
4264 sals.push_back (std::move (sal));
4282 p = (variable[1] ==
'$') ? variable + 2 : variable + 1;
4285 while (*p >=
'0' && *p <=
'9')
4290 struct value *val_history;
4292 sscanf ((variable[1] ==
'$') ? variable + 2 : variable + 1,
"%d", &index);
4296 error (
_(
"History values used in line " 4297 "specs must have integer values."));
4319 error (
_(
"Convenience variables used in line " 4320 "specs must have integer values."));
4338 std::vector<symtab_and_line> *result)
4347 if (self->funfirstline)
4442 if (info->
symtab != NULL)
4480 memset (&local, 0,
sizeof (local));
4495 if (search_pspace != NULL && search_pspace !=
pspace)
4544 info->
result.minimal_symbols, item);
4573 pspace,
true, [&] (
symbol *sym)
4574 { return info->add_symbol (sym); });
4607 int funfirstline,
struct symbol *sym)
4627 else if (funfirstline)
4650 xfree (lsal.canonical);
4658 return linespec_quote_characters;
void error_no_arg(const char *why)
void iterate_over_minimal_symbols(struct objfile *objf, const lookup_name_info &lookup_name, void(*callback)(struct minimal_symbol *, void *), void *user_data)
void(* expand_symtabs_matching)(struct objfile *objfile, gdb::function_view< expand_symtabs_file_matcher_ftype > file_matcher, const lookup_name_info &lookup_name, gdb::function_view< expand_symtabs_symbol_matcher_ftype > symbol_matcher, gdb::function_view< expand_symtabs_exp_notify_ftype > expansion_notify, enum search_domain kind)
#define PARSER_STATE(PPTR)
static void minsym_found(struct linespec_state *self, struct objfile *objfile, struct minimal_symbol *msymbol, std::vector< symtab_and_line > *result)
static void linespec_parse_basic(linespec_parser *parser)
static linespec_token linespec_lexer_peek_token(linespec_parser *parser)
const char * symtab_to_filename_for_display(struct symtab *symtab)
#define SYMTAB_COMPUNIT(symtab)
#define SYMTAB_LANGUAGE(symtab)
int is_ada_operator(const char *string)
static void convert_results_to_lsals(struct linespec_state *self, std::vector< symtab_and_line > *result)
static const char * find_toplevel_string(const char *haystack, const char *needle)
static int classify_mtype(enum minimal_symbol_type t)
bool add_symbol(symbol *sym)
struct symbol * block_containing_function(const struct block *bl)
static void ATTRIBUTE_NORETURN source_file_not_found_error(const char *name)
int completion_quote_char
#define TYPE_N_BASECLASSES(thistype)
static void linespec_parser_delete(void *arg)
const char multiple_symbols_cancel[]
static std::vector< symtab_and_line > decode_objc(struct linespec_state *self, linespec_p ls, const char *arg)
#define TYPE_NFN_FIELDS(thistype)
static char * copy_token_string(linespec_token token)
static void linespec_parser_new(linespec_parser *parser, int flags, const struct language_defn *language, struct program_space *search_pspace, struct symtab *default_symtab, int default_line, struct linespec_result *canonical)
char * command_line_input(const char *, int, const char *)
LONGEST value_as_long(struct value *val)
bool have_completions() const
void set_default_source_symtab_and_line(void)
static linespec_token linespec_lexer_lex_string(linespec_parser *parser)
const char * completion_word
static void scan(struct macro_buffer *dest, struct macro_buffer *src, struct macro_name_list *no_loop, macro_lookup_ftype *lookup_func, void *lookup_baton)
void add_completions(completion_list &&list)
const char *const linespec_keywords[]
static void linespec_state_destructor(struct linespec_state *self)
struct program_space * pspace
void complete_expression(completion_tracker &tracker, const char *text, const char *word)
struct internalvar * lookup_only_internalvar(const char *name)
symbol_name_matcher_ftype * get_symbol_name_matcher(const language_defn *lang, const lookup_name_info &lookup_name)
static void iterate_over_all_matching_symtabs(struct linespec_state *state, const lookup_name_info &lookup_name, const domain_enum name_domain, enum search_domain search_domain, struct program_space *search_pspace, bool include_inline, gdb::function_view< symbol_found_callback_ftype > callback)
enum language set_language(enum language lang)
event_location_up new_linespec_location(const char **linespec, symbol_name_match_type match_type)
static void find_function_symbols(struct linespec_state *state, VEC(symtab_ptr) *file_symtabs, const char *name, symbol_name_match_type name_match_type, VEC(symbolp) **symbols, VEC(bound_minimal_symbol_d) **minsyms)
int get_internalvar_integer(struct internalvar *var, LONGEST *result)
std::vector< T, gdb::default_init_allocator< T > > def_vector
struct symtab_and_line get_current_source_symtab_and_line(void)
enum domain_enum_tag domain_enum
void set_quote_char(int quote_char)
void collect_file_symbol_completion_matches(completion_tracker &tracker, complete_symbol_mode mode, symbol_name_match_type name_match_type, const char *text, const char *word, const char *srcfile)
void complete_on_enum(completion_tracker &tracker, const char *const *enumlist, const char *text, const char *word)
#define SYMBOL_CLASS(symbol)
void * memset(T *s, int c, size_t n)=delete
struct ui_out * interp_ui_out(struct interp *interp)
const struct language_defn * language_def(enum language lang)
void linespec_complete_label(completion_tracker &tracker, const struct language_defn *language, const char *source_filename, const char *function_name, symbol_name_match_type func_name_match_type, const char *label_name)
const char * advance_to_expression_complete_word_point(completion_tracker &tracker, const char *text)
const struct gdb_exception exception_none
event_location_up copy_event_location(const struct event_location *src)
bool() symbol_name_matcher_ftype(const char *symbol_search_name, const lookup_name_info &lookup_name, completion_match_result *comp_match_res)
void discard_completions()
bool completes_to_completion_word(const char *word)
const char * get_address_string_location(const struct event_location *location)
const char multiple_symbols_ask[]
struct line_offset line_offset
int have_partial_symbols(void)
void collect_symbol_completion_matches(completion_tracker &tracker, complete_symbol_mode mode, symbol_name_match_type name_match_type, const char *text, const char *word)
enum language la_language
DEF_VEC_O(bound_minimal_symbol_d)
static hashval_t hash_address_entry(const void *p)
#define VEC_safe_push(T, V, O)
#define BLOCKVECTOR_BLOCK(blocklist, n)
struct obj_section * section
struct block_symbol lookup_symbol(const char *name, const struct block *block, domain_enum domain, struct field_of_this_result *is_a_field_of_this)
static std::vector< symtab_and_line > decode_digits_list_mode(struct linespec_state *self, linespec_p ls, struct symtab_and_line val)
char * skip_spaces(char *chp)
event_location_up location
static std::vector< symtab_and_line > parse_linespec(linespec_parser *parser, const char *arg, symbol_name_match_type match_type)
struct explicit_location explicit_loc
struct symtab_and_line find_function_start_sal(struct symbol *sym, int funfirstline)
CORE_ADDR get_address_location(const struct event_location *location)
static void find_label_symbols_in_block(const struct block *block, const char *name, struct symbol *fn_sym, bool completion_mode, VEC(symbolp) **result, VEC(symbolp) **label_funcs_ret)
#define PARSER_RESULT(PPTR)
static void convert_explicit_location_to_linespec(struct linespec_state *self, linespec_p result, const char *source_filename, const char *function_name, symbol_name_match_type fname_match_type, const char *label_name, struct line_offset line_offset)
static const struct block * get_current_search_block(void)
symbol_name_match_type match_type
static const char * skip_quote_char(const char *string, char quote_char)
static void decode_line_2(struct linespec_state *self, std::vector< symtab_and_line > *result, const char *select_mode)
std::vector< CORE_ADDR > find_pcs_for_symtab_line(struct symtab *symtab, int line, struct linetable_entry **best_item)
static char * canonical_to_fullform(const struct linespec_canonical_name *canonical)
const char * multiple_symbols_select_mode(void)
struct obj_section * find_pc_overlay(CORE_ADDR pc)
#define BLOCK_FUNCTION(bl)
void set_current_program_space(struct program_space *pspace)
const char * completion_quote_end
const char * symtab_to_fullname(struct symtab *s)
std::vector< symtab_and_line > decode_line_with_last_displayed(const char *string, int flags)
enum offset_relative_sign sign
#define MSYMBOL_OBJ_SECTION(objfile, symbol)
#define LA_ITERATE_OVER_SYMBOLS(BLOCK, NAME, DOMAIN, CALLBACK)
mach_port_t kern_return_t mach_port_t msgports mach_port_t kern_return_t pid_t pid mach_port_t kern_return_t mach_port_t task mach_port_t kern_return_t int flags
completion_list complete_source_filenames(const char *text)
void null_cleanup(void *arg)
#define SYMTAB_BLOCKVECTOR(symtab)
static std::vector< symtab_and_line > convert_linespec_to_sals(struct linespec_state *state, linespec_p ls)
const struct explicit_location * get_explicit_location_const(const struct event_location *location)
#define TYPE_FN_FIELD_PHYSNAME(thisfn, n)
#define VEC_iterate(T, V, I, P)
struct type * check_typedef(struct type *type)
#define SYMBOL_VALUE_ADDRESS(symbol)
const struct language_defn * language
std::string cp_canonicalize_string_no_typedefs(const char *string)
#define CATCH(EXCEPTION, MASK)
const char * remove_trailing_whitespace(const char *start, const char *s)
static void canonicalize_linespec(struct linespec_state *state, const linespec_p ls)
static void complete_linespec_component(linespec_parser *parser, completion_tracker &tracker, const char *text, linespec_complete_what component, const char *source_filename)
std::vector< symtab_and_line > sals
static std::vector< symtab_and_line > convert_address_location_to_sals(struct linespec_state *self, CORE_ADDR address)
std::unique_ptr< T, xfree_deleter< T > > unique_xmalloc_ptr
#define SYMBOL_DOMAIN(symbol)
struct symtab_and_line find_pc_line(CORE_ADDR pc, int notcurrent)
void linespec_complete_function(completion_tracker &tracker, const char *function, symbol_name_match_type func_match_type, const char *source_filename)
objfile(bfd *, const char *, objfile_flags)
const char * const_char_ptr
static void add_matching_symbols_to_info(const char *name, symbol_name_match_type name_match_type, enum search_domain search_domain, struct collect_info *info, struct program_space *pspace)
#define SYMTAB_OBJFILE(symtab)
linespec_complete_what complete_what
std::vector< gdb::unique_xmalloc_ptr< char > > completion_list
const linespec_location * get_linespec_location(const struct event_location *location)
void set_suppress_append_ws(bool suppress)
#define gdb_assert_not_reached(message)
void free_current_contents(void *ptr)
const struct sym_fns * sf
static linespec_token linespec_lexer_consume_token(linespec_parser *parser)
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
struct gdbarch * get_objfile_arch(const struct objfile *objfile)
static void ATTRIBUTE_NORETURN unexpected_linespec_error(linespec_parser *parser)
static void add_minsym(struct minimal_symbol *minsym, void *d)
struct ls_parser::@80 lexer
void(* la_iterate_over_symbols)(const struct block *block, const lookup_name_info &name, domain_enum domain, gdb::function_view< symbol_found_callback_ftype > callback)
static std::vector< symtab_and_line > decode_digits_ordinary(struct linespec_state *self, linespec_p ls, int line, struct linetable_entry **best_entry)
#define VEC_index(T, V, I)
#define BLOCK_SUPERBLOCK(bl)
struct program_space * search_pspace
#define MSYMBOL_NATURAL_NAME(symbol)
#define SYMBOL_LINE(symbol)
#define SYMTAB_PSPACE(symtab)
void decode_line_full(const struct event_location *location, int flags, struct program_space *search_pspace, struct symtab *default_symtab, int default_line, struct linespec_result *canonical, const char *select_mode, const char *filter)
static int startswith(const char *string, const char *pattern)
const char * linespec_lexer_lex_keyword(const char *p)
int is_operator_name(const char *name)
event_location_up new_explicit_location(const struct explicit_location *explicit_loc)
struct completion_tracker * completion_tracker
const char * skip_to_space(const char *chp)
std::unique_ptr< event_location, event_location_deleter > event_location_up
static struct line_offset linespec_parse_variable(struct linespec_state *self, const char *variable)
struct linespec_result * canonical
const char * get_gdb_linespec_parser_quote_characters(void)
struct linespec_state * state
void advance_custom_word_point_by(size_t len)
static void complete_label(completion_tracker &tracker, linespec_parser *parser, const char *label_name)
#define TYPE_BASECLASS(thistype, index)
char * xstrprintf(const char *format,...)
static struct value * const_expr(union exp_element **pc)
void printf_unfiltered(const char *format,...)
CORE_ADDR linespec_expression_to_pc(const char **exp_ptr)
VEC(so_list_ptr) *added_solibs
int get_last_displayed_line(void)
const char * find_imps(const char *method, VEC(const_char_ptr) **symbol_names)
static void iterate_over_file_blocks(struct symtab *symtab, const lookup_name_info &name, domain_enum domain, gdb::function_view< symbol_found_callback_ftype > callback)
std::vector< linespec_sals > lsals
#define XRESIZEVEC(T, P, N)
void skip_prologue_sal(struct symtab_and_line *sal)
static void add_all_symbol_names_from_pspace(struct collect_info *info, struct program_space *pspace, VEC(const_char_ptr) *names, enum search_domain search_domain)
const struct block * block_for_pc_sect(CORE_ADDR pc, struct obj_section *section)
static linespec_token save_stream_and_consume_token(linespec_parser *parser)
static std::vector< symtab_and_line > convert_explicit_location_to_sals(struct linespec_state *self, linespec_p result, const struct explicit_location *explicit_loc)
#define ALL_OBJFILE_COMPUNITS(objfile, cu)
enum ls_token_type linespec_token_type
std::vector< symtab_and_line > decode_line_1(const struct event_location *location, int flags, struct program_space *search_pspace, struct symtab *default_symtab, int default_line)
struct symtab * get_last_displayed_symtab(void)
unsigned long hash(const void *addr, int length)
struct value * parse_to_comma_and_eval(const char **expp)
int have_minimal_symbols(void)
struct program_space * pspace
#define VEC_truncate(T, V, I)
void throw_exception(struct gdb_exception exception)
static void set_completion_after_number(linespec_parser *parser, linespec_complete_what next)
symbol_name_match_type func_name_match_type
#define MSYMBOL_TYPE(msymbol)
static int compare_symbols(const void *a, const void *b)
void discard_cleanups(struct cleanup *old_chain)
const struct language_defn * current_language
int last_displayed_sal_is_valid(void)
void linespec_lex_to_end(const char **stringp)
struct linespec_canonical_name * canonical_names
struct line_offset linespec_parse_line_offset(const char *string)
#define ALL_PSPACES(pspace)
void iterate_over_symtabs(const char *name, gdb::function_view< bool(symtab *)> callback)
char * explicit_location_to_linespec(const struct explicit_location *explicit_loc)
static linespec_token linespec_lexer_lex_one(linespec_parser *parser)
static int symbol_to_sal(struct symtab_and_line *result, int funfirstline, struct symbol *sym)
struct symtab * default_symtab
#define SYMBOL_BLOCK_VALUE(symbol)
#define TYPE_CODE(thistype)
static void find_linespec_symbols(struct linespec_state *state, VEC(symtab_ptr) *file_symtabs, const char *lookup_name, symbol_name_match_type name_match_type, VEC(symbolp) **symbols, VEC(bound_minimal_symbol_d) **minsyms)
struct linespec * linespec_p
struct minimal_symbol * minsym
static size_t string_find_incomplete_keyword_at_end(const char *const *keywords, const char *string, size_t string_len)
static int compare_msymbols(const void *a, const void *b)
std::vector< symtab_and_line > decode_line_with_current_source(const char *string, int flags)
struct program_space * pspace
const struct ada_opname_map ada_opname_table[]
static void ATTRIBUTE_NORETURN undefined_label_error(const char *function, const char *label)
bool msymbol_is_function(struct objfile *objfile, minimal_symbol *minsym, CORE_ADDR *func_address_p)
#define SYMBOL_LANGUAGE(symbol)
static void find_methods(struct type *t, enum language t_lang, const char *name, VEC(const_char_ptr) **result_names, VEC(typep) **superclasses)
void add_completion(gdb::unique_xmalloc_ptr< char > name, completion_match_for_lcd *match_for_lcd=NULL, const char *text=NULL, const char *word=NULL)
#define COMPUNIT_FILETABS(cust)
#define VEC_address(T, V)
int symbol_matches_domain(enum language symbol_language, domain_enum symbol_domain, domain_enum domain)
#define BLOCKVECTOR_NBLOCKS(blocklist)
std::string string_printf(const char *fmt,...)
void set_event_location_string(struct event_location *location, const char *string)
int have_full_symbols(void)
static void 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(bound_minimal_symbol_d) **minsyms)
#define COMPUNIT_LOCATIONS_VALID(cust)
static void find_superclass_methods(VEC(typep) *superclasses, const char *name, enum language name_lang, VEC(const_char_ptr) **result_names)
#define PARSER_EXPLICIT(PPTR)
static void ATTRIBUTE_NORETURN symbol_not_found_error(const char *symbol, const char *filename)
const struct block * get_selected_block(CORE_ADDR *addr_in_block)
static void add_sal_to_sals(struct linespec_state *self, std::vector< symtab_and_line > *sals, struct symtab_and_line *sal, const char *symname, int literal_canonical)
#define SYMBOL_NATURAL_NAME(symbol)
struct program_space * current_program_space
#define LS_TOKEN_KEYWORD(TOK)
#define SYMBOL_SEARCH_NAME(symbol)
struct symtab_and_line find_pc_sect_line(CORE_ADDR pc, struct obj_section *section, int notcurrent)
char * savestring(const char *ptr, size_t len)
static void initialize_defaults(struct symtab **default_symtab, int *default_line)
static std::vector< symtab_and_line > event_location_to_sals(linespec_parser *parser, const struct event_location *location)
struct interp * top_level_interpreter(void)
const char * find_toplevel_char(const char *s, char c)
static int eq_address_entry(const void *a, const void *b)
struct type * value_type(const struct value *value)
#define SYMBOL_INLINED(symbol)
#define SYMBOL_TYPE(symbol)
const char * core_addr_to_string(const CORE_ADDR addr)
struct value * access_value_history(int num)
CORE_ADDR value_as_address(struct value *val)
int gdbarch_skip_entrypoint_p(struct gdbarch *gdbarch)
static int is_closing_quote_enclosed(const char *p)
#define TYPE_FN_FIELDLIST_NAME(thistype, n)
const char * type_name_no_tag(const struct type *type)
CORE_ADDR gdbarch_skip_entrypoint(struct gdbarch *gdbarch, CORE_ADDR ip)
static void filter_results(struct linespec_state *self, std::vector< symtab_and_line > *result, VEC(const_char_ptr) *filters)
void linespec_complete(completion_tracker &tracker, const char *text, symbol_name_match_type match_type)
#define TYPE_FN_FIELDLIST_LENGTH(thistype, n)
static int decode_line_2_compare_items(const void *ap, const void *bp)
#define ALL_OBJFILES(obj)
struct program_space * program_space
static const char * find_parameter_list_end(const char *input)
const struct quick_symbol_functions * qf
PTR xcalloc(size_t number, size_t size)
struct symtab * symbol_symtab(const struct symbol *symbol)
#define LS_TOKEN_STOKEN(TOK)
static int compare_msyms(const void *a, const void *b)
static void search_minsyms_for_name(struct collect_info *info, const lookup_name_info &name, struct program_space *search_pspace, struct symtab *symtab)
struct symtab * find_line_symtab(struct symtab *symtab, int line, int *index, int *exact_match)
const char multiple_symbols_all[]
event_location_up string_to_event_location(const char **stringp, const struct language_defn *language, symbol_name_match_type match_type)
void error(const char *fmt,...)
static int maybe_add_address(htab_t set, struct program_space *pspace, CORE_ADDR addr)
struct linespec_state state
#define ALL_BLOCK_SYMBOLS(block, iter, sym)
#define TYPE_FN_FIELDLIST1(thistype, n)
void throw_error(enum errors error, const char *fmt,...)
void do_cleanups(struct cleanup *old_chain)
#define MSYMBOL_VALUE_ADDRESS(objfile, symbol)
static std::vector< symtab_and_line > create_sals_line_offset(struct linespec_state *self, linespec_p ls)
struct explicit_location * get_explicit_location(struct event_location *location)
enum return_reason reason
static void linespec_state_constructor(struct linespec_state *self, int flags, const struct language_defn *language, struct program_space *search_pspace, struct symtab *default_symtab, int default_line, struct linespec_result *canonical)
#define TYPE_FN_FIELD_STUB(thisfn, n)