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);
243 if (sym.
block !=
nullptr)
251 global_sym =
lookup_symbol (identifier,
nullptr, domain,
nullptr);
254 if (global_sym.
symbol !=
nullptr
259 "gcc_convert_symbol \"%s\": global symbol\n",
267 "gcc_convert_symbol \"%s\": local symbol\n",
282 gcc_cp_symbol_kind_flags kind;
289 switch (msym->
type ())
295 kind = GCC_CP_SYMBOL_FUNCTION;
302 kind = GCC_CP_SYMBOL_FUNCTION;
311 kind = GCC_CP_SYMBOL_VARIABLE;
316 kind = GCC_CP_SYMBOL_FUNCTION;
321 kind = GCC_CP_SYMBOL_VARIABLE;
326 instance->
plugin ().push_namespace (
"");
328 (
"minsym", msym->
natural_name (), kind.raw (), sym_type,
nullptr, addr,
337 struct gcc_cp_context *gcc_context,
338 enum gcc_cp_oracle_request request,
339 const char *identifier)
343 "got oracle request for \"%s\"\n", identifier);
358 if (sym.
symbol !=
nullptr)
375 if (it.symbol != sym.
symbol)
379 it.symbol->domain ());
393 catch (
const gdb_exception &e)
397 instance->
plugin ().error (e.what ());
402 "gcc_convert_symbol \"%s\": lookup_symbol failed\n",
423 const char *identifier)
426 gcc_address result = 0;
431 "got oracle request for address of %s\n", identifier);
444 "gcc_symbol_address \"%s\": full symbol\n",
456 if (msym.
minsym !=
nullptr)
460 "gcc_symbol_address \"%s\": minimal "
471 catch (
const gdb_exception_error &e)
473 instance->
plugin ().error (e.what ());
478 "gcc_symbol_address \"%s\": failed\n",
487 "did not find address for %s\n", identifier);
struct gdbarch * target_gdbarch(void)
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 builtin_type * builtin_type(struct gdbarch *gdbarch)
const struct language_defn * current_language
struct bound_minimal_symbol lookup_bound_minimal_symbol(const char *name)
const struct block * block
const struct block * static_block() const
CORE_ADDR value_address() const
struct minimal_symbol * minsym
struct type * nodebug_got_plt_symbol
struct type * nodebug_data_symbol
struct type * nodebug_unknown_symbol
struct type * nodebug_text_symbol
const char * natural_name() const
const char * print_name() const
minimal_symbol_type type() const
CORE_ADDR value_address(objfile *objfile) const
const block * value_block() const
address_class aclass() const
struct type * type() const
domain_enum domain() const
LONGEST value_longest() const
unsigned int line() const
CORE_ADDR value_address() const
bool is_gnu_ifunc() const
enum lval_type lval() 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,...)