34 const char *mode = NULL;
51 internal_error (__FILE__, __LINE__,
_(
"Invalid GCC mode size %d."), size);
68 #define STRINGIFY(x) STR(x)
74 static gcc_c_fe_context_function *
78 gcc_c_fe_context_function *
func;
83 func = (gcc_c_fe_context_function *)
gdb_dlsym (handle,
87 error (
_(
"could not find symbol %s in library %s"),
100 static gcc_c_fe_context_function *
func;
102 struct gcc_c_context *context;
110 context = (*func) (GCC_FE_VERSION_0, GCC_C_FE_VERSION_0);
112 error (
_(
"The loaded version of GCC does not support the required version "
127 struct ui_file *file = user_data;
143 for (i = 0; i < macro->
argc; i++)
146 if (i + 1 < macro->
argc)
170 if (scope != NULL && scope->
file != NULL && scope->
file->
table != NULL)
185 GCC_FE_WRAPPER_FUNCTION
198 GCC_FE_WRAPPER_FUNCTION
202 COMPILE_I_SIMPLE_REGISTER_ARG_NAME
244 const unsigned char *registers_used)
252 if (registers_used != NULL)
255 if (registers_used[i])
291 " __attribute__ ((__mode__(__%s__)))",
302 " unsigned char %s[%d]"
303 " __attribute__((__aligned__("
304 "__BIGGEST_ALIGNMENT__)))",
333 const struct block *expr_block,
336 struct ui_file *buf, *var_stream = NULL;
351 unsigned char *registers_used;
362 expr_block, expr_pc);
366 " __attribute__ ((__mode__(__pointer__)))"
370 " __attribute__ ((__mode__(__pointer__)))"
375 for (i = 0; i < 4; ++i)
382 " __attribute__ ((__mode__(__%s__)))"
431 if (strchr (input,
'\n') == NULL)
#define COMPILE_I_EXPR_PTR_TYPE
struct macro_source_file * file
static void generate_register_struct(struct ui_file *stream, struct gdbarch *gdbarch, const unsigned char *registers_used)
__extension__ enum macro_kind kind
void fputs_unfiltered(const char *buf, struct ui_file *file)
struct macro_table * table
void * gdb_dlopen(const char *filename)
char * ui_file_xstrdup(struct ui_file *file, long *length)
void ui_file_put(struct ui_file *file, ui_file_put_method_ftype *write, void *dest)
void internal_error(const char *file, int line, const char *fmt,...)
#define COMPILE_I_SIMPLE_REGISTER_STRUCT_TAG
void macro_for_each_in_scope(struct macro_source_file *file, int line, macro_callback_fn fn, void *user_data)
#define COMPILE_I_PRINT_OUT_ARG
static gcc_c_fe_context_function * load_libcc(void)
int gdbarch_num_regs(struct gdbarch *gdbarch)
struct macro_scope * sal_macro_scope(struct symtab_and_line sal)
char * compile_register_name_mangled(struct gdbarch *gdbarch, int regnum)
struct macro_scope * default_macro_scope(void)
static void add_code_footer(enum compile_i_scope_types type, struct ui_file *buf)
struct type * check_typedef(struct type *type)
void * gdb_dlsym(void *handle, const char *symbol)
struct symtab_and_line find_pc_line(CORE_ADDR pc, int notcurrent)
void fprintf_filtered(struct ui_file *stream, const char *format,...)
struct type * register_type(struct gdbarch *gdbarch, int regnum)
void fprintf_unfiltered(struct ui_file *stream, const char *format,...)
#define COMPILE_I_SIMPLE_REGISTER_DUMMY
void fputs_filtered(const char *linebuffer, struct ui_file *stream)
#define COMPILE_I_SIMPLE_REGISTER_ARG_NAME
#define gdb_assert_not_reached(message)
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
#define COMPILE_I_EXPR_VAL
char * xstrprintf(const char *format,...)
const char * c_get_mode_for_size(int size)
char * c_compute_program(struct compile_instance *inst, const char *input, struct gdbarch *gdbarch, const struct block *expr_block, CORE_ADDR expr_pc)
struct ui_file * mem_fileopen(void)
void ui_file_write_for_put(void *data, const char *buffer, long length_buffer)
struct compile_instance * c_get_compile_context(void)
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)
static void print_one_macro(const char *name, const struct macro_definition *macro, struct macro_source_file *source, int line, void *user_data)
struct cleanup * make_cleanup_ui_file_delete(struct ui_file *arg)
#define TYPE_CODE(thistype)
enum compile_i_scope_types scope
const char * host_address_to_string(const void *addr)
static void add_code_header(enum compile_i_scope_types type, struct ui_file *buf)
static void write_macro_definitions(const struct block *block, CORE_ADDR pc, struct ui_file *file)
#define COMPILE_I_PRINT_OUT_ARG_TYPE
struct compile_instance * new_compile_instance(struct gcc_c_context *fe)
#define TYPE_LENGTH(thistype)
void error(const char *fmt,...)
char * c_get_range_decl_name(const struct dynamic_prop *prop)
void do_cleanups(struct cleanup *old_chain)
struct macro_scope * user_macro_scope(void)