56 return htab_hash_pointer (se->
sym);
67 return sea->
sym == seb->
sym;
90 slot = htab_find_slot (
hash, &e, INSERT);
116 if (
err == NULL ||
err->message == NULL)
163 C_CTX (context)->c_ops->tagbind (
C_CTX (context),
165 sym_type, filename, line);
170 enum gcc_c_symbol_kind kind;
177 kind = GCC_C_SYMBOL_TYPEDEF;
181 kind = GCC_C_SYMBOL_LABEL;
186 kind = GCC_C_SYMBOL_FUNCTION;
198 C_CTX (context)->c_ops->build_constant
206 error (
_(
"Unsupported LOC_CONST_BYTES for symbol \"%s\"."),
214 error (
_(
"Fortran common block is unsupported for compilation " 215 "evaluaton of symbol \"%s\"."),
219 error (
_(
"Symbol \"%s\" cannot be used for compilation evaluation " 220 "as it is optimized out."),
227 warning (
_(
"Symbol \"%s\" is thread-local and currently can only " 228 "be referenced from the current thread in " 245 error (
_(
"Symbol \"%s\" cannot be used because " 246 "there is no selected frame"),
252 error (
_(
"Symbol \"%s\" cannot be used for compilation " 253 "evaluation as its address has not been found."),
256 kind = GCC_C_SYMBOL_VARIABLE;
268 kind = GCC_C_SYMBOL_VARIABLE;
273 kind = GCC_C_SYMBOL_VARIABLE;
285 || symbol_name == NULL)
287 decl =
C_CTX (context)->c_ops->build_decl
292 symbol_name.get (),
addr,
295 C_CTX (context)->c_ops->bind (
C_CTX (context), decl, is_global);
308 const struct block *static_block;
325 is_local_symbol = (sym.
block != static_block && static_block != NULL);
333 if (global_sym.symbol != NULL
338 "gcc_convert_symbol \"%s\": global symbol\n",
346 "gcc_convert_symbol \"%s\": local symbol\n",
361 enum gcc_c_symbol_kind kind;
375 kind = GCC_C_SYMBOL_FUNCTION;
380 kind = GCC_C_SYMBOL_FUNCTION;
389 kind = GCC_C_SYMBOL_VARIABLE;
394 kind = GCC_C_SYMBOL_FUNCTION;
399 kind = GCC_C_SYMBOL_VARIABLE;
404 decl =
C_CTX (context)->c_ops->build_decl (
C_CTX (context),
406 kind, sym_type, NULL, addr,
408 C_CTX (context)->c_ops->bind (
C_CTX (context), decl, 1 );
415 struct gcc_c_context *gcc_context,
416 enum gcc_c_oracle_request request,
417 const char *identifier)
425 case GCC_C_ORACLE_SYMBOL:
428 case GCC_C_ORACLE_TAG:
431 case GCC_C_ORACLE_LABEL:
445 if (sym.symbol != NULL)
455 if (bmsym.minsym != NULL)
465 C_CTX (context)->c_ops->error (
C_CTX (context), e.message);
471 "gcc_convert_symbol \"%s\": lookup_symbol failed\n",
480 const char *identifier)
483 gcc_address result = 0;
498 "gcc_symbol_address \"%s\": full symbol\n",
510 if (msym.minsym != NULL)
514 "gcc_symbol_address \"%s\": minimal " 527 C_CTX (context)->c_ops->error (
C_CTX (context), e.message);
533 "gcc_symbol_address \"%s\": failed\n",
570 slot = htab_find_slot (hashtab, sym, INSERT);
584 unsigned char *registers_used,
638 unsigned char *registers_used,
669 generated_name.get ());
681 error (
_(
"Local symbol unhandled when generating C code."));
685 "missing a method."));
720 unsigned char *registers_used;
724 if (static_block == NULL ||
block == static_block)
748 registers_used, pc, sym);
759 return registers_used;
std::string c_get_range_decl_name(const struct dynamic_prop *prop)
struct gdbarch * target_gdbarch(void)
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t err
#define TYPE_HIGH_BOUND_KIND(range_type)
struct symbol * block_iterator_next(struct block_iterator *iterator)
#define TYPE_RANGE_DATA(thistype)
unsigned char * generate_c_for_variable_locations(struct compile_c_instance *compiler, string_file &stream, struct gdbarch *gdbarch, const struct block *block, CORE_ADDR pc)
static void convert_symbol_sym(struct compile_c_instance *context, const char *identifier, struct block_symbol sym, domain_enum domain)
struct frame_info * get_selected_frame(const char *message)
#define SYMBOL_PRINT_NAME(symbol)
void dwarf2_compile_property_to_c(string_file &stream, const char *result_name, struct gdbarch *gdbarch, unsigned char *registers_used, const struct dynamic_prop *prop, CORE_ADDR pc, struct symbol *sym)
struct compile_instance base
#define BMSYMBOL_VALUE_ADDRESS(symbol)
void warning(const char *fmt,...)
static hashval_t hash_symname(const void *a)
static void insert_symbol_error(htab_t hash, const struct symbol *sym, const char *text)
enum domain_enum_tag domain_enum
const struct objfile_type * objfile_type(struct objfile *objfile)
#define SYMBOL_CLASS(symbol)
void internal_error(const char *file, int line, const char *fmt,...)
static int symbol_seen(htab_t hashtab, struct symbol *sym)
const struct symbol * sym
void write(const char *buf, long length_buf) override
struct type * nodebug_data_symbol
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)
int gdbarch_num_regs(struct gdbarch *gdbarch)
#define TYPE_FIELD(thistype, n)
#define TYPE_FIELD_TYPE(thistype, n)
#define TYPE_IS_REFERENCE(t)
#define BLOCK_FUNCTION(bl)
static int eq_symname(const void *a, const void *b)
void gcc_convert_symbol(void *datum, struct gcc_c_context *gcc_context, enum gcc_c_oracle_request request, const char *identifier)
struct type * nodebug_text_gnu_ifunc_symbol
static void generate_c_for_for_one_variable(struct compile_c_instance *compiler, string_file &stream, struct gdbarch *gdbarch, unsigned char *registers_used, CORE_ADDR pc, struct symbol *sym)
struct type * check_typedef(struct type *type)
#define TYPE_GNU_IFUNC(t)
#define SYMBOL_VALUE_ADDRESS(symbol)
#define CATCH(EXCEPTION, MASK)
std::unique_ptr< T, xfree_deleter< T > > unique_xmalloc_ptr
#define SYMBOL_DOMAIN(symbol)
int field_is_static(struct field *f)
struct value * read_var_value(struct symbol *var, const struct block *var_block, struct frame_info *frame)
const struct block * block
std::unique_ptr< htab, htab_deleter > htab_up
void fprintf_unfiltered(struct ui_file *stream, const char *format,...)
int symbol_read_needs_frame(struct symbol *sym)
#define gdb_assert_not_reached(message)
#define SYMBOL_COMPUTED_OPS(symbol)
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
static hashval_t hash_symbol_error(const void *a)
#define BLOCK_SUPERBLOCK(bl)
#define MSYMBOL_NATURAL_NAME(symbol)
#define SYMBOL_LINE(symbol)
struct type * nodebug_got_plt_symbol
static void convert_symbol_bmsym(struct compile_c_instance *context, struct bound_minimal_symbol bmsym)
static void error_symbol_once(struct compile_c_instance *context, const struct symbol *sym)
#define SYMBOL_VALUE(symbol)
unsigned long hash(const void *addr, int length)
gcc_address gcc_symbol_address(void *datum, struct gcc_c_context *gcc_context, const char *identifier)
struct type * nodebug_unknown_symbol
#define MSYMBOL_TYPE(msymbol)
void discard_cleanups(struct cleanup *old_chain)
#define TYPE_TARGET_TYPE(thistype)
#define SYMBOL_BLOCK_VALUE(symbol)
const struct block * block_static_block(const struct block *block)
#define TYPE_CODE(thistype)
#define TYPE_INDEX_TYPE(type)
enum compile_i_scope_types scope
const char * c_str() const
struct minimal_symbol * minsym
struct bound_minimal_symbol lookup_bound_minimal_symbol(const char *name)
#define TYPE_NFIELDS(thistype)
struct type * nodebug_text_symbol
static int eq_symbol_error(const void *a, const void *b)
#define SYMBOL_NATURAL_NAME(symbol)
int is_dynamic_type(struct type *type)
const struct block * block
#define SYMBOL_TYPE(symbol)
static void convert_one_symbol(struct compile_c_instance *context, struct block_symbol sym, int is_global, int is_local)
struct symbol * block_iterator_first(const struct block *block, struct block_iterator *iterator)
gcc_type convert_type(struct compile_c_instance *context, struct type *type)
CORE_ADDR value_address(const struct value *value)
struct bound_minimal_symbol lookup_minimal_symbol(const char *name, const char *sfile, struct objfile *objf)
PTR xcalloc(size_t number, size_t size)
static gdb::unique_xmalloc_ptr< char > symbol_substitution_name(struct symbol *sym)
struct symtab * symbol_symtab(const struct symbol *symbol)
static void del_symbol_error(void *a)
void error(const char *fmt,...)
static void generate_vla_size(struct compile_c_instance *compiler, string_file &stream, struct gdbarch *gdbarch, unsigned char *registers_used, CORE_ADDR pc, struct type *type, struct symbol *sym)
#define gnu_ifunc_resolve_addr
#define MSYMBOL_VALUE_ADDRESS(objfile, symbol)