56 return htab_hash_pointer (se->
sym);
67 return sea->
sym == seb->
sym;
90 slot = htab_find_slot (hash, &e, INSERT);
117 if (err == NULL || err->
message == NULL)
164 C_CTX (context)->c_ops->tagbind (
C_CTX (context),
166 sym_type, filename, line);
171 enum gcc_c_symbol_kind kind;
173 char *symbol_name = NULL;
178 kind = GCC_C_SYMBOL_TYPEDEF;
182 kind = GCC_C_SYMBOL_LABEL;
187 kind = GCC_C_SYMBOL_FUNCTION;
199 C_CTX (context)->c_ops->build_constant (
C_CTX (context), sym_type,
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 (
C_CTX (context),
294 C_CTX (context)->c_ops->bind (
C_CTX (context), decl, is_global);
309 const struct block *static_block, *found_block;
328 is_local_symbol = (found_block != static_block && static_block != NULL);
331 struct symbol *global_sym;
336 if (global_sym != NULL
341 "gcc_convert_symbol \"%s\": global symbol\n",
349 "gcc_convert_symbol \"%s\": local symbol\n",
364 enum gcc_c_symbol_kind kind;
378 kind = GCC_C_SYMBOL_FUNCTION;
385 kind = GCC_C_SYMBOL_FUNCTION;
394 kind = GCC_C_SYMBOL_VARIABLE;
399 kind = GCC_C_SYMBOL_FUNCTION;
404 kind = GCC_C_SYMBOL_VARIABLE;
409 decl =
C_CTX (context)->c_ops->build_decl (
C_CTX (context),
411 kind, sym_type, NULL, addr,
413 C_CTX (context)->c_ops->bind (
C_CTX (context), decl, 1 );
420 struct gcc_c_context *gcc_context,
421 enum gcc_c_oracle_request request,
422 const char *identifier)
430 case GCC_C_ORACLE_SYMBOL:
433 case GCC_C_ORACLE_TAG:
436 case GCC_C_ORACLE_LABEL:
460 if (bmsym.minsym != NULL)
470 C_CTX (context)->c_ops->error (
C_CTX (context), e.message);
476 "gcc_convert_symbol \"%s\": lookup_symbol failed\n",
485 const char *identifier)
488 gcc_address result = 0;
503 "gcc_symbol_address \"%s\": full symbol\n",
515 if (msym.minsym != NULL)
519 "gcc_symbol_address \"%s\": minimal "
532 C_CTX (context)->c_ops->error (
C_CTX (context), e.message);
538 "gcc_symbol_address \"%s\": failed\n",
550 const struct symbol *sym = a;
561 const struct symbol *syma = a;
562 const struct symbol *symb = b;
575 slot = htab_find_slot (hashtab, sym, INSERT);
589 unsigned char *registers_used,
611 gdbarch, registers_used,
645 unsigned char *registers_used,
690 error (
_(
"Local symbol unhandled when generating C code."));
694 "missing a method."));
730 unsigned char *registers_used;
734 if (static_block == NULL || block == static_block)
759 registers_used, pc, sym);
771 return registers_used;
struct gdbarch * target_gdbarch(void)
#define TYPE_HIGH_BOUND_KIND(range_type)
struct symbol * block_iterator_next(struct block_iterator *iterator)
#define TYPE_RANGE_DATA(thistype)
static void convert_symbol_sym(struct compile_c_instance *context, const char *identifier, struct symbol *sym, domain_enum domain)
struct frame_info * get_selected_frame(const char *message)
#define SYMBOL_PRINT_NAME(symbol)
struct compile_instance base
#define BMSYMBOL_VALUE_ADDRESS(symbol)
void warning(const char *fmt,...)
static hashval_t hash_symname(const void *a)
static void convert_one_symbol(struct compile_c_instance *context, struct symbol *sym, int is_global, int is_local)
static void insert_symbol_error(htab_t hash, const struct symbol *sym, const char *text)
void ui_file_put(struct ui_file *file, ui_file_put_method_ftype *write, void *dest)
enum domain_enum_tag domain_enum
const struct objfile_type * objfile_type(struct objfile *objfile)
static void generate_c_for_for_one_variable(struct compile_c_instance *compiler, struct ui_file *stream, struct gdbarch *gdbarch, unsigned char *registers_used, CORE_ADDR pc, struct symbol *sym)
#define SYMBOL_CLASS(symbol)
void internal_error(const char *file, int line, const char *fmt,...)
struct value * read_var_value(struct symbol *var, struct frame_info *frame)
static int symbol_seen(htab_t hashtab, struct symbol *sym)
const struct symbol * sym
struct type * nodebug_data_symbol
int gdbarch_num_regs(struct gdbarch *gdbarch)
#define TYPE_FIELD(thistype, n)
#define TYPE_FIELD_TYPE(thistype, n)
#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 * check_typedef(struct type *type)
#define TYPE_GNU_IFUNC(t)
#define SYMBOL_VALUE_ADDRESS(symbol)
#define CATCH(EXCEPTION, MASK)
#define SYMBOL_DOMAIN(symbol)
int field_is_static(struct field *f)
mach_port_t mach_port_t name mach_port_t mach_port_t name error_t err
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)
const struct block * block_found
#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)
struct ui_file * gdb_stdlog
struct ui_file * mem_fileopen(void)
void ui_file_write_for_put(void *data, const char *buffer, long length_buffer)
#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)
unsigned char * generate_c_for_variable_locations(struct compile_c_instance *compiler, struct ui_file *stream, struct gdbarch *gdbarch, const struct block *block, CORE_ADDR pc)
struct type * nodebug_unknown_symbol
#define MSYMBOL_TYPE(msymbol)
void discard_cleanups(struct cleanup *old_chain)
#define TYPE_TARGET_TYPE(thistype)
void dwarf2_compile_property_to_c(struct ui_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 cleanup * make_cleanup_ui_file_delete(struct ui_file *arg)
#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
static char * symbol_substitution_name(struct symbol *sym)
struct minimal_symbol * minsym
static void generate_vla_size(struct compile_c_instance *compiler, struct ui_file *stream, struct gdbarch *gdbarch, unsigned char *registers_used, CORE_ADDR pc, struct type *type, struct symbol *sym)
struct symbol * lookup_symbol(const char *name, const struct block *block, domain_enum domain, struct field_of_this_result *is_a_field_of_this)
struct bound_minimal_symbol lookup_bound_minimal_symbol(const char *name)
#define TYPE_NFIELDS(thistype)
struct cleanup * make_cleanup_htab_delete(htab_t htab)
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)
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)
struct symtab * symbol_symtab(const struct symbol *symbol)
static void del_symbol_error(void *a)
void error(const char *fmt,...)
char * c_get_range_decl_name(const struct dynamic_prop *prop)
#define gnu_ifunc_resolve_addr
void do_cleanups(struct cleanup *old_chain)
#define MSYMBOL_VALUE_ADDRESS(objfile, symbol)