GDB (xrefs)
Macros | Functions | Variables
compile.c File Reference
#include "defs.h"
#include "interps.h"
#include "ui-out.h"
#include "command.h"
#include "cli/cli-script.h"
#include "cli/cli-utils.h"
#include "completer.h"
#include "gdbcmd.h"
#include "compile.h"
#include "compile-internal.h"
#include "compile-object-load.h"
#include "compile-object-run.h"
#include "language.h"
#include "frame.h"
#include "source.h"
#include "block.h"
#include "arch-utils.h"
#include "filestuff.h"
#include "target.h"
#include "osabi.h"
#include "gdb_wait.h"
#include "valprint.h"

Go to the source code of this file.

Macros

#define TMP_PREFIX   "/tmp/gdbobj-"
 
#define TEMPLATE   TMP_PREFIX "XXXXXX"
 

Functions

static void show_compile_debug (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
 
static int check_raw_argument (char **arg)
 
static void compile_file_command (char *arg, int from_tty)
 
static void compile_code_command (char *arg, int from_tty)
 
void compile_print_value (struct value *val, void *data_voidp)
 
static void compile_print_command (char *arg_param, int from_tty)
 
static void do_rmdir (void *arg)
 
static const char * get_compile_file_tempdir (void)
 
static void get_new_file_names (char **source_file, char **object_file)
 
static const struct blockget_expr_block_and_pc (CORE_ADDR *pc)
 
static void build_argc_argv (const char *s, int *argcp, char ***argvp)
 
static void set_compile_args (char *args, int from_tty, struct cmd_list_element *c)
 
static void show_compile_args (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
 
static void append_args (int *argcp, char ***argvp, int argc, char **argv)
 
static const char * get_selected_pc_producer_options (void)
 
static void filter_args (int *argcp, char **argv)
 
static void get_args (const struct compile_instance *compiler, struct gdbarch *gdbarch, int *argcp, char ***argvp)
 
static void cleanup_compile_instance (void *arg)
 
static void cleanup_unlink_file (void *arg)
 
static void print_callback (void *ignore, const char *message)
 
static char * compile_to_object (struct command_line *cmd, const char *cmd_string, enum compile_i_scope_types scope, char **source_filep)
 
static void compile_command (char *args, int from_tty)
 
void eval_compile_command (struct command_line *cmd, const char *cmd_string, enum compile_i_scope_types scope, void *scope_data)
 
char * compile_register_name_mangled (struct gdbarch *gdbarch, int regnum)
 
int compile_register_name_demangle (struct gdbarch *gdbarch, const char *regname)
 
void _initialize_compile (void)
 

Variables

static struct cmd_list_elementcompile_command_list
 
int compile_debug
 
static char * compile_args
 
static int compile_args_argc
 
static char ** compile_args_argv
 
initialize_file_ftype _initialize_compile
 

Macro Definition Documentation

#define TEMPLATE   TMP_PREFIX "XXXXXX"
#define TMP_PREFIX   "/tmp/gdbobj-"

Definition at line 47 of file compile.c.

Referenced by do_rmdir().

Function Documentation

void _initialize_compile ( void  )
static void append_args ( int argcp,
char ***  argvp,
int  argc,
char **  argv 
)
static

Definition at line 337 of file compile.c.

References xrealloc().

Referenced by get_args().

static void build_argc_argv ( const char *  s,
int argcp,
char ***  argvp 
)
static

Definition at line 300 of file compile.c.

References gdb_buildargv().

Referenced by get_args(), and set_compile_args().

static int check_raw_argument ( char **  arg)
static

Definition at line 72 of file compile.c.

References check_for_argument(), and skip_spaces().

Referenced by compile_code_command(), and compile_file_command().

static void cleanup_compile_instance ( void *  arg)
static

Definition at line 432 of file compile.c.

References compile_instance::destroy.

Referenced by compile_to_object().

static void cleanup_unlink_file ( void *  arg)
static

Definition at line 442 of file compile.c.

Referenced by compile_to_object(), and eval_compile_command().

static void compile_code_command ( char *  arg,
int  from_tty 
)
static
static void compile_command ( char *  args,
int  from_tty 
)
static

Definition at line 598 of file compile.c.

References compile_code_command().

Referenced by _initialize_compile().

static void compile_file_command ( char *  arg,
int  from_tty 
)
static
static void compile_print_command ( char *  arg_param,
int  from_tty 
)
static
void compile_print_value ( struct value val,
void *  data_voidp 
)

Definition at line 170 of file compile.c.

References print_value().

Referenced by do_module_cleanup().

int compile_register_name_demangle ( struct gdbarch gdbarch,
const char *  regname 
)

Definition at line 652 of file compile.c.

References _, error(), gdbarch_num_regs(), gdbarch_register_name(), and regnum.

Referenced by store_regs().

char* compile_register_name_mangled ( struct gdbarch gdbarch,
int  regnum 
)
static char* compile_to_object ( struct command_line cmd,
const char *  cmd_string,
enum compile_i_scope_types  scope,
char **  source_filep 
)
static
static void do_rmdir ( void *  arg)
static

Definition at line 215 of file compile.c.

References _, gdb_assert, startswith(), TMP_PREFIX, warning(), WEXITSTATUS, and WIFEXITED.

Referenced by get_compile_file_tempdir().

void eval_compile_command ( struct command_line cmd,
const char *  cmd_string,
enum compile_i_scope_types  scope,
void *  scope_data 
)
static void filter_args ( int argcp,
char **  argv 
)
static

Definition at line 376 of file compile.c.

References xfree().

Referenced by get_args().

static void get_args ( const struct compile_instance compiler,
struct gdbarch gdbarch,
int argcp,
char ***  argvp 
)
static
static const char* get_compile_file_tempdir ( void  )
static

Definition at line 233 of file compile.c.

References _, do_rmdir(), error(), make_final_cleanup(), perror_with_name(), and TEMPLATE.

Referenced by get_new_file_names().

static const struct block* get_expr_block_and_pc ( CORE_ADDR pc)
static
static void get_new_file_names ( char **  source_file,
char **  object_file 
)
static

Definition at line 262 of file compile.c.

References get_compile_file_tempdir(), SLASH_STRING, and xstrprintf().

Referenced by compile_to_object().

static const char* get_selected_pc_producer_options ( void  )
static
static void print_callback ( void *  ignore,
const char *  message 
)
static

Definition at line 453 of file compile.c.

References fputs_filtered(), and gdb_stderr.

Referenced by compile_to_object().

static void set_compile_args ( char *  args,
int  from_tty,
struct cmd_list_element c 
)
static

Definition at line 316 of file compile.c.

References build_argc_argv(), compile_args, compile_args_argc, and compile_args_argv.

Referenced by _initialize_compile().

static void show_compile_args ( struct ui_file file,
int  from_tty,
struct cmd_list_element c,
const char *  value 
)
static

Definition at line 325 of file compile.c.

References _, and fprintf_filtered().

Referenced by _initialize_compile().

static void show_compile_debug ( struct ui_file file,
int  from_tty,
struct cmd_list_element c,
const char *  value 
)
static

Definition at line 60 of file compile.c.

References _, and fprintf_filtered().

Referenced by _initialize_compile().

Variable Documentation

initialize_file_ftype _initialize_compile
char* compile_args
static

Definition at line 307 of file compile.c.

Referenced by _initialize_compile(), and set_compile_args().

int compile_args_argc
static

Definition at line 310 of file compile.c.

Referenced by get_args(), and set_compile_args().

char** compile_args_argv
static

Definition at line 311 of file compile.c.

Referenced by get_args(), and set_compile_args().

struct cmd_list_element* compile_command_list
static

Definition at line 51 of file compile.c.

int compile_debug