GDB (xrefs)

Classes | Macros | Typedefs | Enumerations | Functions | Variables
/tmp/gdb-8.1/gdb/linespec.c File Reference
`#include "defs.h"`
`#include "symtab.h"`
`#include "frame.h"`
`#include "command.h"`
`#include "symfile.h"`
`#include "objfiles.h"`
`#include "source.h"`
`#include "demangle.h"`
`#include "value.h"`
`#include "completer.h"`
`#include "cp-abi.h"`
`#include "cp-support.h"`
`#include "parser-defs.h"`
`#include "block.h"`
`#include "objc-lang.h"`
`#include "linespec.h"`
`#include "language.h"`
`#include "interps.h"`
`#include "mi/mi-cmds.h"`
`#include "target.h"`
`#include "arch-utils.h"`
`#include <ctype.h>`
`#include "cli/cli-utils.h"`
`#include "filenames.h"`
`#include "ada-lang.h"`
`#include "stack.h"`
`#include "location.h"`
`#include "common/function-view.h"`
`#include "common/def-vector.h"`

Go to the source code of this file.

## Classes
struct | address_entry
struct | linespec
struct | linespec_canonical_name
struct | linespec_state
struct | collect_info
struct | ls_token
struct | ls_parser
struct | decode_line_2_item
struct | collect_minsyms

## Macros
#define | IF_KEYWORD_INDEX 0
#define | LS_TOKEN_STOKEN(TOK) (TOK).data.string
#define | LS_TOKEN_KEYWORD(TOK) (TOK).data.keyword
#define | PARSER_STREAM(P) ((P)->lexer.stream)
#define | PARSER_STATE(PPTR) (&(PPTR)->state)
#define | PARSER_RESULT(PPTR) (&(PPTR)->result)
#define | PARSER_EXPLICIT(PPTR) (&PARSER_RESULT ((PPTR))->explicit_loc)

## Typedefs
typedef struct symbol * | symbolp
typedef struct type * | typep
typedef struct bound_minimal_symbol | bound_minimal_symbol_d
typedef struct linespec * | linespec_p
typedef enum ls_token_type | linespec_token_type
typedef struct ls_token | linespec_token
typedef struct ls_parser | linespec_parser

## Enumerations
enum | linespec_complete_what { linespec_complete_what::NOTHING, linespec_complete_what::FUNCTION, linespec_complete_what::LABEL, linespec_complete_what::EXPRESSION, linespec_complete_what::KEYWORD }
enum | ls_token_type { LSTOKEN_KEYWORD = 0, LSTOKEN_COLON, LSTOKEN_STRING, LSTOKEN_NUMBER, LSTOKEN_COMMA, LSTOKEN_EOI, LSTOKEN_CONSUMED }

## Functions
| DEF_VEC_P (symbolp)
| DEF_VEC_P (typep)
| DEF_VEC_O (bound_minimal_symbol_d)
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)
static void | initialize_defaults (struct symtab **default_symtab, int *default_line)
CORE_ADDR | linespec_expression_to_pc (const char **exp_ptr)
static std::vector< symtab_and_line > | decode_objc (struct linespec_state *self, linespec_p ls, const char *arg)
static | VEC (symtab_ptr)
const char * | linespec_lexer_lex_keyword (const char *p)
int | is_ada_operator (const char *string)
static const char * | skip_quote_char (const char *string, char quote_char)
static char * | copy_token_string (linespec_token token)
static int | is_closing_quote_enclosed (const char *p)
static const char * | find_parameter_list_end (const char *input)
static size_t | string_find_incomplete_keyword_at_end (const char *const *keywords, const char *string, size_t string_len)
static linespec_token | linespec_lexer_lex_string (linespec_parser *parser)
static linespec_token | linespec_lexer_lex_one (linespec_parser *parser)
static linespec_token | linespec_lexer_consume_token (linespec_parser *parser)
static linespec_token | linespec_lexer_peek_token (linespec_parser *parser)
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)
static hashval_t | hash_address_entry (const void *p)
static int | eq_address_entry (const void *a, const void *b)
static int | maybe_add_address (htab_t set, struct program_space *pspace, CORE_ADDR addr)
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)
static const struct block * | get_current_search_block (void)
static void | find_methods (struct type *t, enum language t_lang, const char *name, VEC(const_char_ptr) **result_names, VEC(typep) **superclasses)
const char * | find_toplevel_char (const char *s, char c)
static const char * | find_toplevel_string (const char *haystack, const char *needle)
static char * | canonical_to_fullform (const struct linespec_canonical_name *canonical)
static void | filter_results (struct linespec_state *self, std::vector< symtab_and_line > *result, VEC(const_char_ptr) *filters)
static void | convert_results_to_lsals (struct linespec_state *self, std::vector< symtab_and_line > *result)
static int | decode_line_2_compare_items (const void *ap, const void *bp)
static void | decode_line_2 (struct linespec_state *self, std::vector< symtab_and_line > *result, const char *select_mode)
static void ATTRIBUTE_NORETURN | symbol_not_found_error (const char *symbol, const char *filename)
static void ATTRIBUTE_NORETURN | unexpected_linespec_error (linespec_parser *parser)
static void ATTRIBUTE_NORETURN | undefined_label_error (const char *function, const char *label)
static void ATTRIBUTE_NORETURN | source_file_not_found_error (const char *name)
static linespec_token | save_stream_and_consume_token (linespec_parser *parser)
struct line_offset | linespec_parse_line_offset (const char *string)
static void | set_completion_after_number (linespec_parser *parser, linespec_complete_what next)
static void | linespec_parse_basic (linespec_parser *parser)
static void | canonicalize_linespec (struct linespec_state *state, const linespec_p ls)
static std::vector< symtab_and_line > | create_sals_line_offset (struct linespec_state *self, linespec_p ls)
static std::vector< symtab_and_line > | convert_address_location_to_sals (struct linespec_state *self, CORE_ADDR address)
static std::vector< symtab_and_line > | convert_linespec_to_sals (struct linespec_state *state, linespec_p ls)
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 std::vector< symtab_and_line > | convert_explicit_location_to_sals (struct linespec_state *self, linespec_p result, const struct explicit_location *explicit_loc)
static std::vector< symtab_and_line > | parse_linespec (linespec_parser *parser, const char *arg, symbol_name_match_type match_type)
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)
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)
static void | linespec_state_destructor (struct linespec_state *self)
static void | linespec_parser_delete (void *arg)
void | linespec_lex_to_end (const char **stringp)
void | linespec_complete_function (completion_tracker &tracker, const char *function, symbol_name_match_type func_match_type, const char *source_filename)
static void | complete_linespec_component (linespec_parser *parser, completion_tracker &tracker, const char *text, linespec_complete_what component, const char *source_filename)
static void | complete_label (completion_tracker &tracker, linespec_parser *parser, const char *label_name)
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)
void | linespec_complete (completion_tracker &tracker, const char *text, symbol_name_match_type match_type)
static std::vector< symtab_and_line > | event_location_to_sals (linespec_parser *parser, const struct event_location *location)
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)
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)
std::vector< symtab_and_line > | decode_line_with_current_source (const char *string, int flags)
std::vector< symtab_and_line > | decode_line_with_last_displayed (const char *string, int flags)
static | VEC (symbolp)
static int | compare_symbols (const void *a, const void *b)
static int | compare_msymbols (const void *a, const void *b)
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)
static void | find_superclass_methods (VEC(typep) *superclasses, const char *name, enum language name_lang, VEC(const_char_ptr) **result_names)
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)
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)
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)
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)
static std::vector< symtab_and_line > | decode_digits_list_mode (struct linespec_state *self, linespec_p ls, struct symtab_and_line val)
static std::vector< symtab_and_line > | decode_digits_ordinary (struct linespec_state *self, linespec_p ls, int line, struct linetable_entry **best_entry)
static struct line_offset | linespec_parse_variable (struct linespec_state *self, const char *variable)
static void | minsym_found (struct linespec_state *self, struct objfile *objfile, struct minimal_symbol *msymbol, std::vector< symtab_and_line > *result)
static int | classify_mtype (enum minimal_symbol_type t)
static int | compare_msyms (const void *a, const void *b)
static void | add_minsym (struct minimal_symbol *minsym, void *d)
static void | search_minsyms_for_name (struct collect_info *info, const lookup_name_info &name, struct program_space *search_pspace, struct symtab *symtab)
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)
static int | symbol_to_sal (struct symtab_and_line *result, int funfirstline, struct symbol *sym)
const char * | get_gdb_linespec_parser_quote_characters (void)

## Variables
const char *const | linespec_keywords [] = { "if", "thread", "task", NULL }

## Macro Definition Documentation

## ◆ IF_KEYWORD_INDEX

#define IF_KEYWORD_INDEX 0

Definition at line 252 of file linespec.c.

Referenced by linespec_lexer_lex_keyword().

## ◆ LS_TOKEN_KEYWORD

#define LS_TOKEN_KEYWORD | ( |  | TOK | ) | (TOK).data.keyword

Definition at line 274 of file linespec.c.

Referenced by copy_token_string(), and linespec_lexer_lex_one().

## ◆ LS_TOKEN_STOKEN

#define LS_TOKEN_STOKEN | ( |  | TOK | ) | (TOK).data.string

Definition at line 273 of file linespec.c.

Referenced by copy_token_string(), linespec_lexer_consume_token(), linespec_lexer_lex_one(), linespec_lexer_lex_string(), linespec_parse_basic(), and parse_linespec().

## ◆ PARSER_EXPLICIT

#define PARSER_EXPLICIT | ( |  | PPTR | ) | (&PARSER_RESULT ((PPTR))->explicit_loc)

Definition at line 332 of file linespec.c.

Referenced by complete_linespec_component(), linespec_complete(), linespec_parse_basic(), linespec_parser_delete(), linespec_parser_new(), and parse_linespec().

## ◆ PARSER_RESULT

#define PARSER_RESULT | ( |  | PPTR | ) | (&(PPTR)->result)

Definition at line 303 of file linespec.c.

Referenced by complete_label(), event_location_to_sals(), linespec_complete(), linespec_complete_label(), linespec_parse_basic(), linespec_parser_delete(), linespec_parser_new(), and parse_linespec().

## ◆ PARSER_STATE

#define PARSER_STATE | ( |  | PPTR | ) | (&(PPTR)->state)

Definition at line 299 of file linespec.c.

Referenced by complete_label(), decode_line_full(), event_location_to_sals(), linespec_complete(), linespec_complete_label(), linespec_lexer_lex_string(), linespec_parse_basic(), linespec_parser_delete(), linespec_parser_new(), and parse_linespec().

## ◆ PARSER_STREAM

#define PARSER_STREAM | ( |  | P | ) | ((P)->lexer.stream)

Definition at line 288 of file linespec.c.

Referenced by linespec_complete(), linespec_lex_to_end(), linespec_lexer_consume_token(), linespec_lexer_lex_one(), linespec_lexer_lex_string(), linespec_lexer_peek_token(), linespec_parse_basic(), parse_linespec(), save_stream_and_consume_token(), and set_completion_after_number().

## Typedef Documentation

## ◆ bound_minimal_symbol_d

typedef struct bound_minimal_symbol bound_minimal_symbol_d

Definition at line 95 of file linespec.c.

## ◆ linespec_p

typedef struct linespec* linespec_p

Definition at line 128 of file linespec.c.

## ◆ linespec_parser

typedef struct ls_parser linespec_parser

Definition at line 328 of file linespec.c.

## ◆ linespec_token

typedef struct ls_token linespec_token

Definition at line 271 of file linespec.c.

## ◆ linespec_token_type

typedef enum ls_token_type linespec_token_type

Definition at line 247 of file linespec.c.

## ◆ symbolp

typedef struct symbol* symbolp

Definition at line 79 of file linespec.c.

## ◆ typep

typedef struct type* typep

Definition at line 82 of file linespec.c.

## Enumeration Type Documentation

## ◆ linespec_complete_what

enum linespec_complete_what
| strong

Enumerator
NOTHING |
FUNCTION |
LABEL |
EXPRESSION |
KEYWORD |

Definition at line 53 of file linespec.c.

## ◆ ls_token_type

enum ls_token_type

Enumerator
LSTOKEN_KEYWORD |
LSTOKEN_COLON |
LSTOKEN_STRING |
LSTOKEN_NUMBER |
LSTOKEN_COMMA |
LSTOKEN_EOI |
LSTOKEN_CONSUMED |

Definition at line 224 of file linespec.c.

## Function Documentation

## ◆ add_all_symbol_names_from_pspace()

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
| ) |  |
| static

Definition at line 3704 of file linespec.c.

References add_matching_symbols_to_info(), FULL, and VEC_iterate.

Referenced by decode_objc(), find_function_symbols(), and find_method().

## ◆ add_matching_symbols_to_info()

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
| ) |  |
| static

Definition at line 4556 of file linespec.c.

References collect_info::add_symbol(), gdb_assert, iterate_over_all_matching_symtabs(), iterate_over_file_blocks(), symtab::language, language_asm, name, collect_info::result, search_minsyms_for_name(), set_current_program_space(), collect_info::state, SYMTAB_PSPACE, VAR_DOMAIN, VEC_iterate, and VEC_length.

Referenced by add_all_symbol_names_from_pspace(), and find_function_symbols().

## ◆ add_minsym()

static void add_minsym | ( | struct minimal_symbol * | minsym,
|  | void * | d
| ) |  |
| static

Definition at line 4438 of file linespec.c.

References find_pc_sect_line(), collect_minsyms::list_mode, msymbol_is_function(), collect_minsyms::objfile, symtab_and_line::symtab, collect_minsyms::symtab, and VEC_safe_push.

Referenced by search_minsyms_for_name().

## ◆ add_sal_to_sals()

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
| ) |  |
| static

Definition at line 1018 of file linespec.c.

References language_ada, symtab_and_line::line, symtab_and_line::symtab, symtab_to_fullname(), XRESIZEVEC, and xstrprintf().

Referenced by convert_address_location_to_sals(), convert_linespec_to_sals(), create_sals_line_offset(), decode_digits_list_mode(), and minsym_found().

## ◆ canonical_to_fullform()

static char* canonical_to_fullform | ( | const struct linespec_canonical_name * | canonical | ) |
| static

Definition at line 1391 of file linespec.c.

References linespec_canonical_name::suffix, linespec_canonical_name::symtab, symtab_to_fullname(), and xstrprintf().

Referenced by decode_line_2(), and filter_results().

## ◆ canonicalize_linespec()

static void canonicalize_linespec | ( | struct linespec_state * | state,
|  | const linespec_p | ls
| ) |  |
| static

Definition at line 2091 of file linespec.c.

References linespec_state::canonical, linespec::explicit_loc, explicit_location_to_linespec(), explicit_location::function_name, gdb_assert, get_explicit_location(), linespec_state::is_linespec, explicit_location::label_name, linespec::labels, linespec_result::location, new_explicit_location(), set_event_location_string(), linespec_result::special_display, SYMBOL_NATURAL_NAME, VEC_index, VEC_length, and xfree().

Referenced by convert_linespec_to_sals().

## ◆ classify_mtype()

static int classify_mtype | ( | enum minimal_symbol_type | t | ) |
| static

Definition at line 4401 of file linespec.c.

References mst_file_bss, mst_file_data, mst_file_text, and mst_solib_trampoline.

Referenced by compare_msyms(), and search_minsyms_for_name().

## ◆ compare_msymbols()

static int compare_msymbols | ( | const void * | a,
|  | const void * | b
| ) |  |
| static

Definition at line 3671 of file linespec.c.

References bound_minimal_symbol::minsym, bound_minimal_symbol::objfile, and objfile::pspace.

Referenced by convert_linespec_to_sals().

## ◆ compare_msyms()

static int compare_msyms | ( | const void * | a,
|  | const void * | b
| ) |  |
| static

Definition at line 4424 of file linespec.c.

References classify_mtype(), bound_minimal_symbol::minsym, and MSYMBOL_TYPE.

Referenced by search_minsyms_for_name().

## ◆ compare_symbols()

static int compare_symbols | ( | const void * | a,
|  | const void * | b
| ) |  |
| static

Definition at line 3643 of file linespec.c.

References symbol_symtab(), and SYMTAB_PSPACE.

Referenced by convert_linespec_to_sals(), and find_method().

## ◆ complete_label()

static void complete_label | ( | completion_tracker & | tracker,
|  | linespec_parser * | parser,
|  | const char * | label_name
| ) |  |
| static

Definition at line 2936 of file linespec.c.

References completion_tracker::add_completion(), PARSER_RESULT, PARSER_STATE, SYMBOL_SEARCH_NAME, VEC(), VEC_free, and VEC_iterate.

Referenced by linespec_complete(), and linespec_complete_label().

## ◆ complete_linespec_component()

static void complete_linespec_component | ( | linespec_parser * | parser,
|  | completion_tracker & | tracker,
|  | const char * | text,
|  | linespec_complete_what | component,
|  | const char * | source_filename
| ) |  |
| static

Definition at line 2872 of file linespec.c.

References completion_tracker::add_completions(), advance_to_expression_complete_word_point(), complete_expression(), complete_on_enum(), complete_source_filenames(), EXPRESSION, FUNCTION, completion_tracker::have_completions(), KEYWORD, linespec_complete_function(), linespec_keywords, PARSER_EXPLICIT, completion_tracker::quote_char(), completion_tracker::set_quote_char(), and completion_tracker::set_suppress_append_ws().

Referenced by linespec_complete().

## ◆ convert_address_location_to_sals()

static std::vector<symtab_and_line> convert_address_location_to_sals | ( | struct linespec_state * | self,
|  | CORE_ADDR | address
| ) |  |
| static

Definition at line 2273 of file linespec.c.

References add_sal_to_sals(), core_addr_to_string(), symtab_and_line::explicit_pc, find_pc_line(), find_pc_overlay(), symtab_and_line::pc, and symtab_and_line::section.

Referenced by event_location_to_sals().

## ◆ convert_explicit_location_to_linespec()

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

Definition at line 2392 of file linespec.c.

References CATCH, END_CATCH, linespec::explicit_loc, find_linespec_symbols(), explicit_location::func_name_match_type, explicit_location::function_name, explicit_location::label_name, linespec::labels, explicit_location::line_offset, LINE_OFFSET_UNKNOWN, RETURN_MASK_ERROR, line_offset::sign, source_file_not_found_error(), explicit_location::source_filename, symbol_not_found_error(), TRY, undefined_label_error(), VEC(), and VEC_safe_push.

Referenced by convert_explicit_location_to_sals(), and linespec_complete_label().

## ◆ convert_explicit_location_to_sals()

static std::vector<symtab_and_line> convert_explicit_location_to_sals | ( | struct linespec_state * | self,
|  | linespec_p | result,
|  | const struct explicit_location * | explicit_loc
| ) |  |
| static

Definition at line 2462 of file linespec.c.

References convert_explicit_location_to_linespec(), convert_linespec_to_sals(), explicit_location::func_name_match_type, explicit_location::function_name, explicit_location::label_name, explicit_location::line_offset, and explicit_location::source_filename.

Referenced by event_location_to_sals().

## ◆ convert_linespec_to_sals()

static std::vector<symtab_and_line> convert_linespec_to_sals | ( | struct linespec_state * | state,
|  | linespec_p | ls
| ) |  |
| static

Definition at line 2290 of file linespec.c.

References add_sal_to_sals(), linespec_state::addr_set, linespec_state::canonical, canonicalize_linespec(), compare_msymbols(), compare_symbols(), create_sals_line_offset(), linespec_state::default_symtab, linespec::explicit_loc, linespec_state::funfirstline, linespec::labels, explicit_location::line_offset, LINE_OFFSET_UNKNOWN, maybe_add_address(), bound_minimal_symbol::minsym, minsym_found(), bound_minimal_symbol::objfile, symtab_and_line::pc, linespec_result::pre_expanded, objfile::pspace, qsort, set_current_program_space(), line_offset::sign, explicit_location::source_filename, SYMBOL_NATURAL_NAME, symbol_symtab(), symbol_to_sal(), SYMTAB_PSPACE, symtab_to_fullname(), VEC_address, VEC_iterate, and VEC_length.

Referenced by convert_explicit_location_to_sals(), decode_objc(), and parse_linespec().

## ◆ convert_results_to_lsals()

static void convert_results_to_lsals | ( | struct linespec_state * | self,
|  | std::vector< symtab_and_line > * | result
| ) |  |
| static

Definition at line 1444 of file linespec.c.

References linespec_sals::canonical, and linespec_sals::sals.

Referenced by decode_line_2(), and decode_line_full().

## ◆ copy_token_string()

static char* copy_token_string | ( | linespec_token | token | ) |
| static

Definition at line 539 of file linespec.c.

References LS_TOKEN_KEYWORD, LS_TOKEN_STOKEN, LSTOKEN_KEYWORD, remove_trailing_whitespace(), and savestring().

Referenced by linespec_parse_basic(), parse_linespec(), and unexpected_linespec_error().

## ◆ create_sals_line_offset()

static std::vector<symtab_and_line> create_sals_line_offset | ( | struct linespec_state * | self,
|  | linespec_p | ls
| ) |  |
| static

Definition at line 2137 of file linespec.c.

References _, add_sal_to_sals(), block_containing_function(), block_for_pc_sect(), decode_digits_list_mode(), decode_digits_ordinary(), linespec::explicit_loc, initialize_defaults(), linetable_entry::line, symtab_and_line::line, explicit_location::line_offset, LINE_OFFSET_MINUS, LINE_OFFSET_NONE, LINE_OFFSET_PLUS, NOT_FOUND_ERROR, line_offset::offset, linetable_entry::pc, set_current_program_space(), set_default_source_symtab_and_line(), line_offset::sign, skip_prologue_sal(), explicit_location::source_filename, SYMBOL_NATURAL_NAME, symtab_to_fullname(), throw_error(), VEC_free, VEC_index, VEC_length, and VEC_pop.

Referenced by convert_linespec_to_sals().

## ◆ decode_digits_list_mode()

static std::vector<symtab_and_line> decode_digits_list_mode | ( | struct linespec_state * | self,
|  | linespec_p | ls,
|  | struct symtab_and_line | val
| ) |  |
| static

Definition at line 4201 of file linespec.c.

References add_sal_to_sals(), symtab_and_line::explicit_line, find_line_symtab(), gdb_assert, symtab_and_line::line, symtab_and_line::pc, symtab_and_line::pspace, set_current_program_space(), symtab_and_line::symtab, SYMTAB_PSPACE, and VEC_iterate.

Referenced by create_sals_line_offset().

## ◆ decode_digits_ordinary()

static std::vector<symtab_and_line> decode_digits_ordinary | ( | struct linespec_state * | self,
|  | linespec_p | ls,
|  | int | line,
|  | struct linetable_entry ** | best_entry
| ) |  |
| static

Definition at line 4238 of file linespec.c.

References find_pcs_for_symtab_line(), gdb_assert, symtab_and_line::line, symtab_and_line::pc, symtab_and_line::pspace, set_current_program_space(), symtab_and_line::symtab, SYMTAB_PSPACE, and VEC_iterate.

Referenced by create_sals_line_offset().

## ◆ decode_line_1()

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
| ) |  |

Definition at line 3346 of file linespec.c.

References current_language, do_cleanups(), event_location_to_sals(), flags, linespec_parser_delete(), linespec_parser_new(), and make_cleanup().

Referenced by decode_line_with_current_source(), decode_line_with_last_displayed(), edit_command(), gdbpy_decode_line(), info_scope_command(), list_command(), and until_break_command().

## ◆ decode_line_2()

static void decode_line_2 | ( | struct linespec_state * | self,
|  | std::vector< symtab_and_line > * | result,
|  | const char * | select_mode
| ) |  |
| static

Definition at line 1498 of file linespec.c.

References _, canonical_to_fullform(), command_line_input(), convert_results_to_lsals(), decode_line_2_compare_items(), decode_line_2_item::displayform, do_cleanups(), error(), error_no_arg(), filter_results(), number_or_range_parser::finished(), decode_line_2_item::fullform, gdb_assert, number_or_range_parser::get_number(), make_cleanup(), multiple_symbols_all, multiple_symbols_cancel, printf_unfiltered(), qsort, decode_line_2_item::selected, linespec_canonical_name::suffix, linespec_canonical_name::symtab, symtab_to_filename_for_display(), VEC(), VEC_cleanup, VEC_safe_push, xfree(), XNEWVEC, and xstrprintf().

Referenced by decode_line_full().

## ◆ decode_line_2_compare_items()

static int decode_line_2_compare_items | ( | const void * | ap,
|  | const void * | bp
| ) |  |
| static

Definition at line 1479 of file linespec.c.

References bp, decode_line_2_item::displayform, and decode_line_2_item::fullform.

Referenced by decode_line_2().

## ◆ decode_line_full()

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
| ) |  |

Definition at line 3270 of file linespec.c.

References linespec_state::canonical, linespec_state::canonical_names, convert_results_to_lsals(), current_language, decode_line_2(), DECODE_LINE_LIST_MODE, linespec_state::default_line, linespec_state::default_symtab, do_cleanups(), event_location_to_sals(), filter_results(), flags, gdb_assert, interp_ui_out(), linespec_parser_delete(), linespec_parser_new(), make_cleanup(), multiple_symbols_all, multiple_symbols_ask, multiple_symbols_cancel, multiple_symbols_select_mode(), PARSER_STATE, linespec_result::pre_expanded, linespec_state::search_pspace, linespec_canonical_name::suffix, top_level_interpreter(), VEC(), VEC_cleanup, VEC_safe_push, and xfree().

Referenced by agent_command_1(), break_range_command(), decode_location_default(), and parse_breakpoint_sals().

## ◆ decode_line_with_current_source()

std::vector<symtab_and_line> decode_line_with_current_source | ( | const char * | string,
|  | int | flags
| ) |  |

Definition at line 3371 of file linespec.c.

References _, current_language, decode_line_1(), error(), flags, get_current_source_symtab_and_line(), symtab_and_line::line, string_to_event_location(), and symtab_and_line::symtab.

Referenced by clear_command(), func_command(), info_macros_command(), mi_cmd_trace_find(), select_source_symtab(), and tfind_line_command().

## ◆ decode_line_with_last_displayed()

std::vector<symtab_and_line> decode_line_with_last_displayed | ( | const char * | string,
|  | int | flags
| ) |  |

Definition at line 3394 of file linespec.c.

References _, current_language, decode_line_1(), error(), flags, get_last_displayed_line(), get_last_displayed_symtab(), last_displayed_sal_is_valid(), and string_to_event_location().

Referenced by info_line_command(), and jump_command().

## ◆ decode_objc()

static std::vector< symtab_and_line > decode_objc | ( | struct linespec_state * | self,
|  | linespec_p | ls,
|  | const char * | arg
| ) |  |
| static

Definition at line 3464 of file linespec.c.

References add_all_symbol_names_from_pspace(), cleanup::arg, convert_linespec_to_sals(), do_cleanups(), linespec::explicit_loc, find_imps(), FULL, explicit_location::function_name, FUNCTIONS_DOMAIN, make_cleanup(), new_linespec_location(), collect_info::result, explicit_location::source_filename, collect_info::state, string, string_printf(), VEC(), VEC_cleanup, VEC_empty, and VEC_safe_push.

Referenced by parse_linespec().

## ◆ DEF_VEC_O()

DEF_VEC_O | ( | bound_minimal_symbol_d |  | ) |

## ◆ DEF_VEC_P() [1/2]

DEF_VEC_P | ( | symbolp |  | ) |

## ◆ DEF_VEC_P() [2/2]

DEF_VEC_P | ( | typep |  | ) |

## ◆ eq_address_entry()

static int eq_address_entry | ( | const void * | a,
|  | const void * | b
| ) |  |
| static

Definition at line 1075 of file linespec.c.

References address_entry::addr, and address_entry::pspace.

Referenced by linespec_state_constructor().

## ◆ event_location_to_sals()

static std::vector<symtab_and_line> event_location_to_sals | ( | linespec_parser * | parser,
|  | const struct event_location * | location
| ) |  |
| static

Definition at line 3196 of file linespec.c.

References ADDRESS_LOCATION, CATCH, const_expr(), convert_address_location_to_sals(), convert_explicit_location_to_sals(), copy_event_location(), do_cleanups(), END_CATCH, EXPLICIT_LOCATION, gdb_assert_not_reached, get_address_location(), get_address_string_location(), get_explicit_location_const(), get_linespec_location(), linespec_expression_to_pc(), LINESPEC_LOCATION, make_cleanup(), linespec_location::match_type, parse_linespec(), PARSER_RESULT, PARSER_STATE, PROBE_LOCATION, RETURN_MASK_ERROR, linespec_location::spec_string, throw_exception(), TRY, and xfree().

Referenced by decode_line_1(), and decode_line_full().

## ◆ filter_results()

static void filter_results | ( | struct linespec_state * | self,
|  | std::vector< symtab_and_line > * | result,
|  | VEC(const_char_ptr) * | filters
| ) |  |
| static

Definition at line 1404 of file linespec.c.

References linespec_sals::canonical, canonical_to_fullform(), do_cleanups(), make_cleanup(), name, linespec_sals::sals, VEC_iterate, and xfree().

Referenced by decode_line_2(), and decode_line_full().

## ◆ find_function_symbols()

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
| ) |  |
| static

Definition at line 3964 of file linespec.c.

References add_all_symbol_names_from_pspace(), add_matching_symbols_to_info(), do_cleanups(), find_imps(), FUNCTIONS_DOMAIN, make_cleanup(), name, collect_info::result, linespec_state::search_pspace, collect_info::state, VEC(), VEC_cleanup, VEC_empty, and VEC_free.

Referenced by find_linespec_symbols().

## ◆ find_label_symbols_in_block()

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
| ) |  |
| static

Definition at line 4109 of file linespec.c.

References ALL_BLOCK_SYMBOLS, case_sensitive_on, LABEL_DOMAIN, lookup_symbol(), name, block_symbol::symbol, SYMBOL_DOMAIN, SYMBOL_LANGUAGE, symbol_matches_domain(), SYMBOL_SEARCH_NAME, and VEC_safe_push.

## ◆ find_linespec_symbols()

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
| ) |  |
| static

Definition at line 4012 of file linespec.c.

References CATCH, cp_canonicalize_string_no_typedefs(), do_cleanups(), END_CATCH, find_function_symbols(), find_method(), find_toplevel_string(), make_cleanup(), NOT_FOUND_ERROR, RETURN_MASK_ERROR, string, throw_exception(), TRY, VEC(), VEC_cleanup, and VEC_empty.

Referenced by convert_explicit_location_to_linespec(), linespec_complete(), and linespec_parse_basic().

## ◆ find_method()

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
| ) |  |
| static

Definition at line 3753 of file linespec.c.

References _, add_all_symbol_names_from_pspace(), check_typedef(), compare_symbols(), do_cleanups(), program_space::executing_startup, find_methods(), find_superclass_methods(), FUNCTIONS_DOMAIN, gdb_assert, make_cleanup(), NOT_FOUND_ERROR, null_cleanup(), qsort, collect_info::result, set_current_program_space(), collect_info::state, SYMBOL_LANGUAGE, symbol_symtab(), SYMBOL_TYPE, SYMTAB_PSPACE, throw_error(), VEC(), VEC_address, VEC_cleanup, VEC_empty, VEC_index, VEC_iterate, VEC_length, and VEC_truncate.

Referenced by find_linespec_symbols().

## ◆ find_methods()

static void find_methods | ( | struct type * | t,
|  | enum language | t_lang,
|  | const char * | name,
|  | VEC(const_char_ptr) ** | result_names,
|  | VEC(typep) ** | superclasses
| ) |  |
| static

Definition at line 1214 of file linespec.c.

References check_typedef(), FULL, get_symbol_name_matcher(), language_def(), name, startswith(), TYPE_BASECLASS, TYPE_FN_FIELD_PHYSNAME, TYPE_FN_FIELD_STUB, TYPE_FN_FIELDLIST1, TYPE_FN_FIELDLIST_LENGTH, TYPE_FN_FIELDLIST_NAME, TYPE_N_BASECLASSES, type_name_no_tag(), TYPE_NFN_FIELDS, and VEC_safe_push.

Referenced by find_method(), and find_superclass_methods().

## ◆ find_parameter_list_end()

static const char* find_parameter_list_end | ( | const char * | input | ) |
| static

Definition at line 570 of file linespec.c.

Referenced by linespec_lexer_lex_string().

## ◆ find_superclass_methods()

static void find_superclass_methods | ( | VEC(typep) * | superclasses,
|  | const char * | name,
|  | enum language | name_lang,
|  | VEC(const_char_ptr) ** | result_names
| ) |  |
| static

Definition at line 3719 of file linespec.c.

References do_cleanups(), find_methods(), make_cleanup(), name, null_cleanup(), VEC(), VEC_cleanup, VEC_empty, VEC_iterate, and VEC_length.

Referenced by find_method().

## ◆ find_toplevel_char()

const char* find_toplevel_char | ( | const char * | s,
|  | char | c
| ) |  |

Definition at line 1286 of file linespec.c.

References CP_OPERATOR_LEN, CP_OPERATOR_STR, and scan().

Referenced by explicit_location_lex_one_function(), find_toplevel_string(), skip_op_false_positives(), and skip_quote_char().

## ◆ find_toplevel_string()

static const char* find_toplevel_string | ( | const char * | haystack,
|  | const char * | needle
| ) |  |
| static

Definition at line 1362 of file linespec.c.

References find_toplevel_char(), and startswith().

Referenced by find_linespec_symbols().

## ◆ get_current_search_block()

static const struct block* get_current_search_block | ( | void |  | ) |
| static

Definition at line 1180 of file linespec.c.

References current_language, get_selected_block(), language_defn::la_language, and set_language().

## ◆ get_gdb_linespec_parser_quote_characters()

const char* get_gdb_linespec_parser_quote_characters | ( | void |  | ) |

Definition at line 4656 of file linespec.c.

Referenced by explicit_location_lex_one(), and explicit_location_lex_one_function().

## ◆ hash_address_entry()

static hashval_t hash_address_entry | ( | const void * | p | ) |
| static

Definition at line 1063 of file linespec.c.

References address_entry::addr, hash(), and address_entry::pspace.

Referenced by linespec_state_constructor().

## ◆ initialize_defaults()

static void initialize_defaults | ( | struct symtab ** | default_symtab,
|  | int * | default_line
| ) |  |
| static

Definition at line 3421 of file linespec.c.

References get_current_source_symtab_and_line(), symtab_and_line::line, and symtab_and_line::symtab.

Referenced by create_sals_line_offset(), and parse_linespec().

## ◆ is_ada_operator()

int is_ada_operator | ( | const char * | string | ) |

Definition at line 504 of file linespec.c.

References ada_opname_table, ada_opname_map::decoded, ada_opname_map::encoded, and startswith().

Referenced by explicit_location_lex_one_function(), linespec_lexer_lex_string(), and parse_linespec().

## ◆ is_closing_quote_enclosed()

static int is_closing_quote_enclosed | ( | const char * | p | ) |
| static

Definition at line 557 of file linespec.c.

References linespec_lexer_lex_keyword(), and skip_spaces().

Referenced by linespec_lexer_lex_one(), linespec_lexer_lex_string(), and parse_linespec().

## ◆ iterate_over_all_matching_symtabs()

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
| ) |  |
| static

Definition at line 1114 of file linespec.c.

References ALL_OBJFILE_COMPUNITS, ALL_OBJFILES, ALL_PSPACES, BLOCKVECTOR_BLOCK, BLOCKVECTOR_NBLOCKS, COMPUNIT_FILETABS, program_space::executing_startup, quick_symbol_functions::expand_symtabs_matching, FIRST_LOCAL_BLOCK, iterate_over_file_blocks(), language_defn::la_iterate_over_symbols, linespec_state::language, objfile::objfile(), sym_fns::qf, set_current_program_space(), objfile::sf, SYMBOL_INLINED, and SYMTAB_BLOCKVECTOR.

Referenced by add_matching_symbols_to_info(), and VEC().

## ◆ iterate_over_file_blocks()

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
| ) |  |
| static

Definition at line 1198 of file linespec.c.

References BLOCK_SUPERBLOCK, BLOCKVECTOR_BLOCK, LA_ITERATE_OVER_SYMBOLS, name, STATIC_BLOCK, and SYMTAB_BLOCKVECTOR.

Referenced by add_matching_symbols_to_info(), iterate_over_all_matching_symtabs(), and VEC().

## ◆ linespec_complete()

void linespec_complete | ( | completion_tracker & | tracker,
|  | const char * | text,
|  | symbol_name_match_type | match_type
| ) |  |

Definition at line 2999 of file linespec.c.

References completion_tracker::add_completion(), completion_tracker::advance_custom_word_point_by(), CATCH, complete_label(), complete_linespec_component(), ls_parser::complete_what, completion_tracker::completes_to_completion_word(), ls_parser::completion_quote_char, ls_parser::completion_quote_end, ls_parser::completion_tracker, ls_parser::completion_word, current_language, completion_tracker::discard_completions(), do_cleanups(), END_CATCH, find_linespec_symbols(), FUNCTION, completion_tracker::have_completions(), KEYWORD, LABEL, ls_parser::lexer, linespec_keywords, linespec_parser_delete(), linespec_parser_new(), make_cleanup(), NOTHING, parse_linespec(), PARSER_EXPLICIT, PARSER_RESULT, PARSER_STATE, PARSER_STREAM, completion_tracker::quote_char(), RETURN_MASK_ERROR, ls_parser::saved_arg, completion_tracker::set_quote_char(), string_find_incomplete_keyword_at_end(), TRY, and VEC().

Referenced by complete_address_and_linespec_locations().

## ◆ linespec_complete_function()

void linespec_complete_function | ( | completion_tracker & | tracker,
|  | const char * | function,
|  | symbol_name_match_type | func_match_type,
|  | const char * | source_filename
| ) |  |

Definition at line 2848 of file linespec.c.

References collect_file_symbol_completion_matches(), collect_symbol_completion_matches(), and LINESPEC.

Referenced by collect_explicit_location_matches(), complete_linespec_component(), and linespec_parse_basic().

## ◆ linespec_complete_label()

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
| ) |  |

Definition at line 2960 of file linespec.c.

References CATCH, complete_label(), convert_explicit_location_to_linespec(), do_cleanups(), END_CATCH, LINE_OFFSET_UNKNOWN, linespec_parser_delete(), linespec_parser_new(), make_cleanup(), PARSER_RESULT, PARSER_STATE, RETURN_MASK_ERROR, and TRY.

Referenced by collect_explicit_location_matches().

## ◆ linespec_expression_to_pc()

CORE_ADDR linespec_expression_to_pc | ( | const char ** | exp_ptr | ) |

Definition at line 3442 of file linespec.c.

References _, current_program_space, program_space::executing_startup, NOT_FOUND_ERROR, parse_to_comma_and_eval(), throw_error(), and value_as_address().

Referenced by event_location_to_sals(), and string_to_event_location_basic().

## ◆ linespec_lex_to_end()

void linespec_lex_to_end | ( | const char ** | stringp | ) |

Definition at line 2815 of file linespec.c.

References current_language, do_cleanups(), ls_parser::lexer, linespec_lexer_consume_token(), linespec_lexer_peek_token(), linespec_parser_delete(), linespec_parser_new(), LSTOKEN_COMMA, LSTOKEN_EOI, LSTOKEN_KEYWORD, make_cleanup(), PARSER_STREAM, ls_parser::saved_arg, and token.

Referenced by new_linespec_location().

## ◆ linespec_lexer_consume_token()

static linespec_token linespec_lexer_consume_token | ( | linespec_parser * | parser | ) |
| static

Definition at line 947 of file linespec.c.

References ls_parser::completion_quote_char, ls_parser::completion_quote_end, ls_parser::completion_word, ls_parser::current, gdb_assert, ls_parser::lexer, linespec_lexer_lex_one(), LS_TOKEN_STOKEN, LSTOKEN_CONSUMED, LSTOKEN_EOI, LSTOKEN_STRING, PARSER_STREAM, and ls_token::type.

Referenced by linespec_lex_to_end(), linespec_lexer_peek_token(), linespec_parse_basic(), parse_linespec(), and save_stream_and_consume_token().

## ◆ linespec_lexer_lex_keyword()

const char* linespec_lexer_lex_keyword | ( | const char * | p | ) |

Definition at line 456 of file linespec.c.

References IF_KEYWORD_INDEX, linespec_keywords, and skip_spaces().

Referenced by explicit_location_lex_one(), explicit_location_lex_one_function(), is_closing_quote_enclosed(), linespec_lexer_lex_one(), linespec_lexer_lex_string(), and string_to_explicit_location().

## ◆ linespec_lexer_lex_one()

static linespec_token linespec_lexer_lex_one | ( | linespec_parser * | parser | ) |
| static

Definition at line 862 of file linespec.c.

References ls_parser::current, is_closing_quote_enclosed(), ls_parser::is_quote_enclosed, ls_parser::lexer, linespec_lexer_lex_keyword(), linespec_lexer_lex_string(), LS_TOKEN_KEYWORD, LS_TOKEN_STOKEN, LSTOKEN_COLON, LSTOKEN_COMMA, LSTOKEN_CONSUMED, LSTOKEN_EOI, LSTOKEN_KEYWORD, PARSER_STREAM, skip_spaces(), and ls_token::type.

Referenced by linespec_lexer_consume_token(), linespec_parse_basic(), parse_linespec(), and unexpected_linespec_error().

## ◆ linespec_lexer_lex_string()

static linespec_token linespec_lexer_lex_string | ( | linespec_parser * | parser | ) |
| static

Definition at line 632 of file linespec.c.

References _, ls_parser::completion_quote_char, ls_parser::completion_quote_end, ls_parser::completion_tracker, CP_OPERATOR_LEN, CP_OPERATOR_STR, error(), find_parameter_list_end(), is_ada_operator(), is_closing_quote_enclosed(), is_operator_name(), ls_parser::is_quote_enclosed, language_ada, language_cplus, linespec_lexer_lex_keyword(), LS_TOKEN_STOKEN, LSTOKEN_STRING, PARSER_STATE, PARSER_STREAM, skip_quote_char(), skip_spaces(), startswith(), and token.

Referenced by linespec_lexer_lex_one().

## ◆ linespec_lexer_peek_token()

static linespec_token linespec_lexer_peek_token | ( | linespec_parser * | parser | ) |
| static

Definition at line 990 of file linespec.c.

References ls_parser::completion_quote_char, ls_parser::completion_quote_end, ls_parser::completion_word, ls_parser::current, ls_parser::lexer, linespec_lexer_consume_token(), and PARSER_STREAM.

Referenced by linespec_lex_to_end(), parse_linespec(), and save_stream_and_consume_token().

## ◆ linespec_parse_basic()

static void linespec_parse_basic | ( | linespec_parser * | parser | ) |
| static

Definition at line 1792 of file linespec.c.

References ls_parser::complete_what, ls_parser::completion_quote_char, ls_parser::completion_tracker, ls_parser::completion_word, copy_token_string(), discard_cleanups(), do_cleanups(), find_linespec_symbols(), free_current_contents(), completion_tracker::have_completions(), KEYWORD, LABEL, LINE_OFFSET_UNKNOWN, linespec_complete_function(), linespec_lexer_consume_token(), linespec_lexer_lex_one(), linespec_parse_line_offset(), linespec_parse_variable(), LS_TOKEN_STOKEN, LSTOKEN_COLON, LSTOKEN_COMMA, LSTOKEN_EOI, LSTOKEN_KEYWORD, LSTOKEN_NUMBER, LSTOKEN_STRING, make_cleanup(), name, NOTHING, PARSER_EXPLICIT, PARSER_RESULT, PARSER_STATE, PARSER_STREAM, save_stream_and_consume_token(), savestring(), set_completion_after_number(), line_offset::sign, skip_spaces(), token, undefined_label_error(), unexpected_linespec_error(), VEC(), and xfree().

Referenced by parse_linespec().

## ◆ linespec_parse_line_offset()

struct line_offset linespec_parse_line_offset | ( | const char * | string | ) |

Definition at line 1745 of file linespec.c.

References _, error(), LINE_OFFSET_MINUS, LINE_OFFSET_NONE, LINE_OFFSET_PLUS, line_offset::offset, line_offset::sign, and string.

Referenced by bppy_init(), linespec_parse_basic(), mi_cmd_break_insert_1(), and string_to_explicit_location().

## ◆ linespec_parse_variable()

static struct line_offset linespec_parse_variable | ( | struct linespec_state * | self,
|  | const char * | variable
| ) |  |
| static

Definition at line 4276 of file linespec.c.

References _, access_value_history(), error(), get_internalvar_integer(), LINE_OFFSET_NONE, LINE_OFFSET_UNKNOWN, lookup_only_internalvar(), offset, TYPE_CODE, TYPE_CODE_INT, value_as_long(), and value_type().

Referenced by linespec_parse_basic(), and parse_linespec().

## ◆ linespec_parser_delete()

static void linespec_parser_delete | ( | void * | arg | ) |
| static

Definition at line 2786 of file linespec.c.

References cleanup::arg, linespec_state_destructor(), PARSER_EXPLICIT, PARSER_RESULT, PARSER_STATE, VEC_free, and xfree().

Referenced by decode_line_1(), decode_line_full(), linespec_complete(), linespec_complete_label(), and linespec_lex_to_end().

## ◆ linespec_parser_new()

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
| ) |  |
| static

Definition at line 2757 of file linespec.c.

References ls_parser::current, flags, ls_parser::lexer, LINE_OFFSET_UNKNOWN, linespec_state_constructor(), LSTOKEN_CONSUMED, memset(), PARSER_EXPLICIT, PARSER_RESULT, PARSER_STATE, ls_token::type, and WILD.

Referenced by decode_line_1(), decode_line_full(), linespec_complete(), linespec_complete_label(), and linespec_lex_to_end().

## ◆ linespec_state_constructor()

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
| ) |  |
| static

Definition at line 2733 of file linespec.c.

References current_program_space, DECODE_LINE_FUNFIRSTLINE, DECODE_LINE_LIST_MODE, eq_address_entry(), flags, hash_address_entry(), memset(), xcalloc(), and xfree().

Referenced by linespec_parser_new().

## ◆ linespec_state_destructor()

static void linespec_state_destructor | ( | struct linespec_state * | self | ) |
| static

Definition at line 2778 of file linespec.c.

Referenced by linespec_parser_delete().

## ◆ maybe_add_address()

static int maybe_add_address | ( | htab_t | set,
|  | struct program_space * | pspace,
|  | CORE_ADDR | addr
| ) |  |
| static

Definition at line 1088 of file linespec.c.

References address_entry::addr, address_entry::pspace, and XNEW.

Referenced by convert_linespec_to_sals(), and minsym_found().

## ◆ minsym_found()

static void minsym_found | ( | struct linespec_state * | self,
|  | struct objfile * | objfile,
|  | struct minimal_symbol * | msymbol,
|  | std::vector< symtab_and_line > * | result
| ) |  |
| static

Definition at line 4336 of file linespec.c.

References add_sal_to_sals(), COMPUNIT_LOCATIONS_VALID, current_program_space, find_pc_sect_line(), gdbarch_skip_entrypoint(), gdbarch_skip_entrypoint_p(), get_objfile_arch(), language_asm, maybe_add_address(), msymbol_is_function(), MSYMBOL_NATURAL_NAME, MSYMBOL_OBJ_SECTION, MSYMBOL_VALUE_ADDRESS, symtab_and_line::objfile, symtab_and_line::pc, objfile::pspace, symtab_and_line::pspace, symtab_and_line::section, skip_prologue_sal(), symtab_and_line::symtab, SYMTAB_COMPUNIT, and SYMTAB_LANGUAGE.

Referenced by convert_linespec_to_sals().

## ◆ parse_linespec()

static std::vector<symtab_and_line> parse_linespec | ( | linespec_parser * | parser,
|  | const char * | arg,
|  | symbol_name_match_type | match_type
| ) |  |
| static

Definition at line 2527 of file linespec.c.

References cleanup::arg, CATCH, ls_parser::complete_what, ls_parser::completion_tracker, ls_parser::completion_word, convert_linespec_to_sals(), copy_token_string(), decode_objc(), do_cleanups(), END_CATCH, exception_none, EXPRESSION, FUNCTION, initialize_defaults(), is_ada_operator(), is_closing_quote_enclosed(), ls_parser::is_quote_enclosed, ls_parser::lexer, LINE_OFFSET_UNKNOWN, linespec_lexer_consume_token(), linespec_lexer_lex_one(), linespec_lexer_peek_token(), linespec_parse_basic(), linespec_parse_variable(), LS_TOKEN_STOKEN, LSTOKEN_COLON, LSTOKEN_COMMA, LSTOKEN_EOI, LSTOKEN_KEYWORD, LSTOKEN_NUMBER, LSTOKEN_STRING, make_cleanup(), NOTHING, PARSER_EXPLICIT, PARSER_RESULT, PARSER_STATE, PARSER_STREAM, gdb_exception::reason, RETURN_MASK_ERROR, ls_parser::saved_arg, line_offset::sign, skip_quote_char(), skip_spaces(), skip_to_space(), ls_parser::stream, symbol_not_found_error(), throw_exception(), token, TRY, unexpected_linespec_error(), VEC_safe_push, and xfree().

Referenced by event_location_to_sals(), and linespec_complete().

## ◆ save_stream_and_consume_token()

static linespec_token save_stream_and_consume_token | ( | linespec_parser * | parser | ) |
| static

Definition at line 1735 of file linespec.c.

References ls_parser::completion_word, linespec_lexer_consume_token(), linespec_lexer_peek_token(), LSTOKEN_EOI, and PARSER_STREAM.

Referenced by linespec_parse_basic().

## ◆ search_minsyms_for_name()

static void search_minsyms_for_name | ( | struct collect_info * | info,
|  | const lookup_name_info & | name,
|  | struct program_space * | search_pspace,
|  | struct symtab * | symtab
| ) |  |
| static

Definition at line 4472 of file linespec.c.

References add_minsym(), ALL_OBJFILES, ALL_PSPACES, classify_mtype(), compare_msyms(), do_cleanups(), program_space::executing_startup, linespec_state::funfirstline, collect_minsyms::funfirstline, iterate_over_minimal_symbols(), linespec_state::list_mode, collect_minsyms::list_mode, make_cleanup(), memset(), bound_minimal_symbol::minsym, MSYMBOL_TYPE, name, objfile::objfile(), collect_minsyms::objfile, objfile::pspace, qsort, collect_info::result, set_current_program_space(), collect_info::state, collect_minsyms::symtab, SYMTAB_OBJFILE, SYMTAB_PSPACE, VEC_address, VEC_cleanup, VEC_empty, VEC_index, VEC_iterate, VEC_length, and VEC_safe_push.

Referenced by add_matching_symbols_to_info().

## ◆ set_completion_after_number()

static void set_completion_after_number | ( | linespec_parser * | parser,
|  | linespec_complete_what | next
| ) |  |
| static

Definition at line 1774 of file linespec.c.

References ls_parser::complete_what, ls_parser::completion_word, NOTHING, PARSER_STREAM, and skip_spaces().

Referenced by linespec_parse_basic().

## ◆ skip_quote_char()

static const char* skip_quote_char | ( | const char * | string,
|  | char | quote_char
| ) |  |
| static

Definition at line 520 of file linespec.c.

References find_toplevel_char().

Referenced by linespec_lexer_lex_string(), and parse_linespec().

## ◆ source_file_not_found_error()

static void ATTRIBUTE_NORETURN source_file_not_found_error | ( | const char * | name | ) |
| static

Definition at line 1726 of file linespec.c.

References _, name, NOT_FOUND_ERROR, and throw_error().

Referenced by convert_explicit_location_to_linespec().

## ◆ string_find_incomplete_keyword_at_end()

static size_t string_find_incomplete_keyword_at_end | ( | const char *const * | keywords,
|  | const char * | string,
|  | size_t | string_len
| ) |  |
| static

Definition at line 609 of file linespec.c.

References string.

Referenced by linespec_complete().

## ◆ symbol_not_found_error()

static void ATTRIBUTE_NORETURN symbol_not_found_error | ( | const char * | symbol,
|  | const char * | filename
| ) |  |
| static

Definition at line 1639 of file linespec.c.

References _, have_full_symbols(), have_minimal_symbols(), have_partial_symbols(), NOT_FOUND_ERROR, and throw_error().

Referenced by convert_explicit_location_to_linespec(), and parse_linespec().

## ◆ symbol_to_sal()

static int symbol_to_sal | ( | struct symtab_and_line * | result,
|  | int | funfirstline,
|  | struct symbol * | sym
| ) |  |
| static

Definition at line 4606 of file linespec.c.

References symtab_and_line::explicit_pc, find_function_start_sal(), symtab_and_line::line, LOC_BLOCK, LOC_LABEL, symtab_and_line::pc, symtab_and_line::pspace, symtab_and_line::symbol, SYMBOL_CLASS, SYMBOL_LINE, symbol_symtab(), SYMBOL_VALUE_ADDRESS, symtab_and_line::symtab, and SYMTAB_PSPACE.

Referenced by convert_linespec_to_sals().

## ◆ undefined_label_error()

static void ATTRIBUTE_NORETURN undefined_label_error | ( | const char * | function,
|  | const char * | label
| ) |  |
| static

Definition at line 1711 of file linespec.c.

References _, NOT_FOUND_ERROR, and throw_error().

Referenced by convert_explicit_location_to_linespec(), and linespec_parse_basic().

## ◆ unexpected_linespec_error()

static void ATTRIBUTE_NORETURN unexpected_linespec_error | ( | linespec_parser * | parser | ) |
| static

Definition at line 1681 of file linespec.c.

References _, copy_token_string(), GENERIC_ERROR, linespec_lexer_lex_one(), LSTOKEN_KEYWORD, LSTOKEN_NUMBER, LSTOKEN_STRING, make_cleanup(), string, throw_error(), token, and xfree().

Referenced by linespec_parse_basic(), and parse_linespec().

## ◆ VEC() [1/2]

static VEC | ( | symtab_ptr |  | ) |
| static

Definition at line 350 of file linespec.c.

Referenced by complete_label(), convert_explicit_location_to_linespec(), decode_line_2(), decode_line_full(), decode_objc(), find_function_symbols(), find_linespec_symbols(), find_method(), find_superclass_methods(), linespec_complete(), and linespec_parse_basic().

## ◆ VEC() [2/2]

static VEC | ( | symbolp |  | ) |
| static

Definition at line 3603 of file linespec.c.

References ALL_DOMAIN, FULL, gdb_assert, iterate_over_all_matching_symtabs(), iterate_over_file_blocks(), set_current_program_space(), STRUCT_DOMAIN, SYMTAB_PSPACE, VAR_DOMAIN, and VEC_iterate.

## Variable Documentation

## ◆ linespec_keywords

const char* const linespec_keywords[] = { "if", "thread", "task", NULL }

Definition at line 251 of file linespec.c.

Referenced by collect_explicit_location_matches(), complete_explicit_location(), complete_linespec_component(), linespec_complete(), linespec_lexer_lex_keyword(), and location_completer().