36 const char *mode = NULL;
73 static gcc_c_fe_context_function *
76 gcc_c_fe_context_function *
func;
85 error (
_(
"could not find symbol %s in library %s"),
101 static gcc_c_fe_context_function *
func;
103 struct gcc_c_context *context;
111 context = (*func) (GCC_FE_VERSION_0, GCC_C_FE_VERSION_0);
113 error (
_(
"The loaded version of GCC does not support the required version " 142 for (i = 0; i < macro->
argc; i++)
145 if (i + 1 < macro->
argc)
169 if (scope != NULL && scope->
file != NULL && scope->
file->
table != NULL)
172 [&] (
const char *
name,
177 print_one_macro (name, macro, source, line, file);
193 GCC_FE_WRAPPER_FUNCTION
206 GCC_FE_WRAPPER_FUNCTION
252 const unsigned char *registers_used)
260 if (registers_used != NULL)
263 if (registers_used[i])
299 " __attribute__ ((__mode__(__%s__)))",
310 " unsigned char %s[%d]" 311 " __attribute__((__aligned__(" 312 "__BIGGEST_ALIGNMENT__)))",
339 const struct block *expr_block,
354 unsigned char *registers_used;
363 expr_block, expr_pc);
366 buf.
puts (
"typedef unsigned int" 367 " __attribute__ ((__mode__(__pointer__)))" 368 " __gdb_uintptr;\n");
369 buf.
puts (
"typedef int" 370 " __attribute__ ((__mode__(__pointer__)))" 374 for (i = 0; i < 4; ++i)
380 " __attribute__ ((__mode__(__%s__)))" 395 buf.
puts (
"#pragma GCC user_expression\n");
405 buf.
puts (
"#line 1 \"gdb command line\"\n");
429 if (strchr (input,
'\n') == NULL)
436 return std::move (buf.
string ());
std::string c_get_range_decl_name(const struct dynamic_prop *prop)
#define COMPILE_I_EXPR_PTR_TYPE
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)
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
std::string c_compute_program(struct compile_instance *inst, const char *input, struct gdbarch *gdbarch, const struct block *expr_block, CORE_ADDR expr_pc)
void internal_error(const char *file, int line, const char *fmt,...)
#define COMPILE_I_SIMPLE_REGISTER_STRUCT_TAG
void write(const char *buf, long length_buf) override
#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)
static void print_one_macro(const char *name, const struct macro_definition *macro, struct macro_source_file *source, int line, ui_file *file)
struct macro_scope * default_macro_scope(void)
#define host_address_to_string(ADDR)
static void add_code_footer(enum compile_i_scope_types type, struct ui_file *buf)
struct type * check_typedef(struct type *type)
gdb_dlhandle_up gdb_dlopen(const char *filename)
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
const char * c_get_mode_for_size(int size)
virtual void puts(const char *str)
struct compile_instance * c_get_compile_context(void)
void printf(const char *,...) ATTRIBUTE_PRINTF(2
std::string compile_register_name_mangled(struct gdbarch *gdbarch, int regnum)
#define TYPE_CODE(thistype)
enum compile_i_scope_types scope
const char * c_str() const
std::string string_printf(const char *fmt,...)
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
std::unique_ptr< void, dlclose_deleter > gdb_dlhandle_up
void macro_for_each_in_scope(struct macro_source_file *file, int line, gdb::function_view< macro_callback_fn > fn)
void * gdb_dlsym(const gdb_dlhandle_up &handle, const char *symbol)
struct compile_instance * new_compile_instance(struct gcc_c_context *fe)
#define TYPE_LENGTH(thistype)
void error(const char *fmt,...)
struct macro_scope * user_macro_scope(void)