24#include "gdbsupport/gdb_assert.h"
50 gcc_type sym_type = 0;
68 gcc_cp_symbol_kind_flags kind = GCC_CP_FLAG_BASE;
71 gdb::unique_xmalloc_ptr<char> symbol_name;
77 kind = GCC_CP_SYMBOL_TYPEDEF;
83 kind = GCC_CP_SYMBOL_LABEL;
89 kind = GCC_CP_SYMBOL_FUNCTION;
102 instance->
plugin ().build_constant
108 error (_(
"Unsupported LOC_CONST_BYTES for symbol \"%s\"."),
112 internal_error (_(
"LOC_UNDEF found for \"%s\"."),
116 error (_(
"Fortran common block is unsupported for compilation "
117 "evaluaton of symbol \"%s\"."),
121 error (_(
"Symbol \"%s\" cannot be used for compilation evaluation "
122 "as it is optimized out."),
129 warning (_(
"Symbol \"%s\" is thread-local and currently can only "
130 "be referenced from the current thread in "
146 if (frame ==
nullptr)
147 error (_(
"Symbol \"%s\" cannot be used because "
148 "there is no selected frame"),
154 error (_(
"Symbol \"%s\" cannot be used for compilation "
155 "evaluation as its address has not been found."),
158 kind = GCC_CP_SYMBOL_VARIABLE;
170 kind = GCC_CP_SYMBOL_VARIABLE;
175 kind = GCC_CP_SYMBOL_VARIABLE;
181 gdb_assert_not_reached (
"Unreachable case in convert_one_symbol.");
211 (
"variable",
name.c_str (), kind.raw (), sym_type,
212 symbol_name.get (), addr, filename, line);
244 bool is_local_symbol = (sym.
block != static_block && static_block !=
nullptr);
249 global_sym =
lookup_symbol (identifier,
nullptr, domain,
nullptr);
252 if (global_sym.
symbol !=
nullptr
257 "gcc_convert_symbol \"%s\": global symbol\n",
265 "gcc_convert_symbol \"%s\": local symbol\n",
280 gcc_cp_symbol_kind_flags kind;
287 switch (msym->
type ())
293 kind = GCC_CP_SYMBOL_FUNCTION;
300 kind = GCC_CP_SYMBOL_FUNCTION;
309 kind = GCC_CP_SYMBOL_VARIABLE;
314 kind = GCC_CP_SYMBOL_FUNCTION;
319 kind = GCC_CP_SYMBOL_VARIABLE;
324 instance->
plugin ().push_namespace (
"");
326 (
"minsym", msym->
natural_name (), kind.raw (), sym_type,
nullptr, addr,
335 struct gcc_cp_context *gcc_context,
336 enum gcc_cp_oracle_request request,
337 const char *identifier)
341 "got oracle request for \"%s\"\n", identifier);
356 if (sym.
symbol !=
nullptr)
373 if (it.symbol != sym.
symbol)
377 it.symbol->domain ());
391 catch (
const gdb_exception &e)
395 instance->
plugin ().error (e.what ());
400 "gcc_convert_symbol \"%s\": lookup_symbol failed\n",
421 const char *identifier)
424 gcc_address result = 0;
429 "got oracle request for address of %s\n", identifier);
442 "gcc_symbol_address \"%s\": full symbol\n",
454 if (msym.
minsym !=
nullptr)
458 "gcc_symbol_address \"%s\": minimal "
469 catch (
const gdb_exception_error &e)
471 instance->
plugin ().error (e.what ());
476 "gcc_symbol_address \"%s\": failed\n",
485 "did not find address for %s\n", identifier);
struct gdbarch * target_gdbarch(void)
const struct block * block_static_block(const struct block *block)
compile_scope new_scope(const char *type_name, struct type *type)
gcc_type convert_type(struct type *type, enum gcc_cp_symbol_kind nested_access=GCC_CP_ACCESS_NONE)
static gdb::unique_xmalloc_ptr< char > decl_name(const char *natural)
void enter_scope(compile_scope &&scope)
void error_symbol_once(const struct symbol *sym)
enum compile_i_scope_types scope() const
const struct block * block() const
int pop_binding_level(const char *debug_name)
gcc_expr build_decl(const char *debug_decltype, const char *name, enum gcc_cp_symbol_kind sym_kind, gcc_type sym_type, const char *substitution_name, gcc_address address, const char *filename, unsigned int line_number)
const std::vector< block_symbol > & matching_symbols() const
void find_all_symbols(const std::string &name, const struct language_defn *language, enum search_domain search_domain, std::vector< symtab * > *search_symtabs, struct program_space *search_pspace)
const std::vector< bound_minimal_symbol > & matching_msymbols() const
gdb::unique_xmalloc_ptr< char > c_symbol_substitution_name(struct symbol *sym)
static void convert_symbol_bmsym(compile_cplus_instance *instance, struct bound_minimal_symbol bmsym)
static void convert_one_symbol(compile_cplus_instance *instance, struct block_symbol sym, bool is_global, bool is_local)
static void convert_symbol_sym(compile_cplus_instance *instance, const char *identifier, struct block_symbol sym, domain_enum domain)
gcc_cp_oracle_function gcc_cplus_convert_symbol
gcc_cp_symbol_address_function gcc_cplus_symbol_address
const gcc_type GCC_TYPE_NONE
int symbol_read_needs_frame(struct symbol *sym)
struct value * read_var_value(struct symbol *var, const struct block *var_block, frame_info_ptr frame)
frame_info_ptr get_selected_frame(const char *message)
const struct language_defn * current_language
struct bound_minimal_symbol lookup_bound_minimal_symbol(const char *name)
const struct block * block
CORE_ADDR value_address() const
struct minimal_symbol * minsym
const char * natural_name() const
const char * print_name() const
minimal_symbol_type type() const
CORE_ADDR value_address(objfile *objfile) const
struct type * nodebug_unknown_symbol
struct type * nodebug_got_plt_symbol
struct type * nodebug_text_symbol
struct type * nodebug_data_symbol
const block * value_block() const
address_class aclass() const
struct type * type() const
domain_enum domain() const
LONGEST value_longest() const
CORE_ADDR value_address() const
unsigned short line() const
bool is_gnu_ifunc() const
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)
#define gnu_ifunc_resolve_addr
void gdb_printf(struct ui_file *stream, const char *format,...)
CORE_ADDR value_address(const struct value *value)