39gdb::unique_xmalloc_ptr<char>
42 return gdb::unique_xmalloc_ptr<char>
43 (concat (
"__", sym->
natural_name (),
"_ptr", (
char *) NULL));
74 sym_type, filename, line);
79 enum gcc_c_symbol_kind kind;
81 gdb::unique_xmalloc_ptr<char> symbol_name;
86 kind = GCC_C_SYMBOL_TYPEDEF;
90 kind = GCC_C_SYMBOL_LABEL;
95 kind = GCC_C_SYMBOL_FUNCTION;
107 context->
plugin ().build_constant
114 error (_(
"Unsupported LOC_CONST_BYTES for symbol \"%s\"."),
118 internal_error (_(
"LOC_UNDEF found for \"%s\"."),
122 error (_(
"Fortran common block is unsupported for compilation "
123 "evaluaton of symbol \"%s\"."),
127 error (_(
"Symbol \"%s\" cannot be used for compilation evaluation "
128 "as it is optimized out."),
135 warning (_(
"Symbol \"%s\" is thread-local and currently can only "
136 "be referenced from the current thread in "
153 error (_(
"Symbol \"%s\" cannot be used because "
154 "there is no selected frame"),
160 error (_(
"Symbol \"%s\" cannot be used for compilation "
161 "evaluation as its address has not been found."),
164 kind = GCC_C_SYMBOL_VARIABLE;
176 kind = GCC_C_SYMBOL_VARIABLE;
181 kind = GCC_C_SYMBOL_VARIABLE;
187 gdb_assert_not_reached (
"Unreachable case in convert_one_symbol.");
193 || symbol_name == NULL)
195 decl = context->
plugin ().build_decl
199 symbol_name.get (), addr,
202 context->
plugin ().bind (decl, is_global);
230 if (sym.
block !=
nullptr)
241 if (global_sym.
symbol != NULL
246 "gcc_convert_symbol \"%s\": global symbol\n",
254 "gcc_convert_symbol \"%s\": local symbol\n",
269 enum gcc_c_symbol_kind kind;
277 switch (msym->
type ())
283 kind = GCC_C_SYMBOL_FUNCTION;
288 kind = GCC_C_SYMBOL_FUNCTION;
297 kind = GCC_C_SYMBOL_VARIABLE;
302 kind = GCC_C_SYMBOL_FUNCTION;
307 kind = GCC_C_SYMBOL_VARIABLE;
313 kind, sym_type, NULL, addr,
315 context->
plugin ().bind (decl, 1 );
322 struct gcc_c_context *gcc_context,
323 enum gcc_c_oracle_request request,
324 const char *identifier)
333 case GCC_C_ORACLE_SYMBOL:
336 case GCC_C_ORACLE_TAG:
339 case GCC_C_ORACLE_LABEL:
343 gdb_assert_not_reached (
"Unrecognized oracle request.");
371 catch (
const gdb_exception &e)
373 context->
plugin ().error (e.what ());
378 "gcc_convert_symbol \"%s\": lookup_symbol failed\n",
387 const char *identifier)
391 gcc_address result = 0;
406 "gcc_symbol_address \"%s\": full symbol\n",
422 "gcc_symbol_address \"%s\": minimal "
433 catch (
const gdb_exception_error &e)
435 context->
plugin ().error (e.what ());
440 "gcc_symbol_address \"%s\": failed\n",
477 slot = htab_find_slot (hashtab, sym, INSERT);
491 std::vector<bool> ®isters_used,
503 case TYPE_CODE_RANGE:
518 case TYPE_CODE_ARRAY:
525 case TYPE_CODE_UNION:
526 case TYPE_CODE_STRUCT:
545 std::vector<bool> ®isters_used,
566 gdb::unique_xmalloc_ptr<char> generated_name
576 generated_name.get ());
588 error (_(
"Local symbol unhandled when generating C code."));
591 gdb_assert_not_reached (
"LOC_COMPUTED variable "
592 "missing a method.");
602 catch (
const gdb_exception_error &e)
617 if (
block ==
nullptr)
642 registers_used, pc, sym);
652 return registers_used;
void * xcalloc(size_t number, size_t size)
struct gdbarch * target_gdbarch(void)
iterator_range< block_iterator_wrapper > block_iterator_range
gcc_type convert_type(struct type *type)
void error_symbol_once(const struct symbol *sym)
void insert_symbol_error(const struct symbol *sym, const char *text)
enum compile_i_scope_types scope() const
const struct block * block() const
void write(const char *buf, long length_buf) override
const char * c_str() const
std::string c_get_range_decl_name(const struct dynamic_prop *prop)
static void convert_symbol_bmsym(compile_c_instance *context, struct bound_minimal_symbol bmsym)
gdb::unique_xmalloc_ptr< char > c_symbol_substitution_name(struct symbol *sym)
static void generate_vla_size(compile_instance *compiler, string_file *stream, struct gdbarch *gdbarch, std::vector< bool > ®isters_used, CORE_ADDR pc, struct type *type, struct symbol *sym)
static int symbol_seen(htab_t hashtab, struct symbol *sym)
static void convert_one_symbol(compile_c_instance *context, struct block_symbol sym, int is_global, int is_local)
static void convert_symbol_sym(compile_c_instance *context, const char *identifier, struct block_symbol sym, domain_enum domain)
std::vector< bool > generate_c_for_variable_locations(compile_instance *compiler, string_file *stream, struct gdbarch *gdbarch, const struct block *block, CORE_ADDR pc)
static void generate_c_for_for_one_variable(compile_instance *compiler, string_file *stream, struct gdbarch *gdbarch, std::vector< bool > ®isters_used, CORE_ADDR pc, struct symbol *sym)
static hashval_t hash_symname(const void *a)
static int eq_symname(const void *a, const void *b)
gcc_c_oracle_function gcc_convert_symbol
gcc_c_symbol_address_function gcc_symbol_address
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)
int gdbarch_num_regs(struct gdbarch *gdbarch)
int is_dynamic_type(struct type *type)
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
struct type * check_typedef(struct type *type)
#define TYPE_IS_REFERENCE(t)
void dwarf2_compile_property_to_c(string_file *stream, const char *result_name, struct gdbarch *gdbarch, std::vector< bool > ®isters_used, const struct dynamic_prop *prop, CORE_ADDR pc, struct symbol *sym)
struct bound_minimal_symbol lookup_minimal_symbol(const char *name, const char *sfile, struct objfile *objf)
struct bound_minimal_symbol lookup_bound_minimal_symbol(const char *name)
const struct block * block
const block * superblock() const
CORE_ADDR entry_pc() const
const struct block * static_block() const
symbol * function() const
CORE_ADDR value_address() const
struct minimal_symbol * minsym
struct type * nodebug_text_gnu_ifunc_symbol
struct type * nodebug_got_plt_symbol
struct type * nodebug_data_symbol
struct type * nodebug_unknown_symbol
struct type * nodebug_text_symbol
dynamic_prop_kind kind() const
struct type * type() const
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
struct type * target_type() const
struct field & field(int idx) const
bool is_gnu_ifunc() const
unsigned int num_fields() const
range_bounds * bounds() const
type * index_type() 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 SYMBOL_COMPUTED_OPS(symbol)
#define gnu_ifunc_resolve_addr
void gdb_printf(struct ui_file *stream, const char *format,...)