GDB (xrefs)
Macros | Functions | Variables
compile.c File Reference
#include "defs.h"
#include "top.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"
#include "common/gdb_optional.h"
#include "common/gdb_unlinker.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 (const char **arg)
 
static void compile_file_command (const char *arg, int from_tty)
 
static void compile_code_command (const char *arg, int from_tty)
 
void compile_print_value (struct value *val, void *data_voidp)
 
static void compile_print_command (const char *arg, int from_tty)
 
static void do_rmdir (void *arg)
 
static const char * get_compile_file_tempdir (void)
 
static compile_file_names get_new_file_names ()
 
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 (const 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 void show_compile_gcc (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
 
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 print_callback (void *ignore, const char *message)
 
static compile_file_names compile_to_object (struct command_line *cmd, const char *cmd_string, enum compile_i_scope_types scope)
 
static void compile_command (const 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)
 
std::string 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
 
static char * compile_gcc
 

Macro Definition Documentation

◆ TEMPLATE

#define TEMPLATE   TMP_PREFIX "XXXXXX"

◆ TMP_PREFIX

#define TMP_PREFIX   "/tmp/gdbobj-"

Definition at line 49 of file compile.c.

Referenced by do_rmdir().

Function Documentation

◆ _initialize_compile()

void _initialize_compile ( void  )

◆ append_args()

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

Definition at line 326 of file compile.c.

References gdb::argv, and XRESIZEVEC.

Referenced by get_args().

◆ build_argc_argv()

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

Definition at line 287 of file compile.c.

References gdb_argv::count(), and gdb_argv::release().

Referenced by get_args(), and set_compile_args().

◆ check_raw_argument()

static int check_raw_argument ( const char **  arg)
static

Definition at line 74 of file compile.c.

References check_for_argument(), and skip_spaces().

Referenced by compile_code_command(), and compile_file_command().

◆ cleanup_compile_instance()

static void cleanup_compile_instance ( void *  arg)
static

Definition at line 434 of file compile.c.

References compile_instance::destroy.

Referenced by compile_to_object().

◆ compile_code_command()

static void compile_code_command ( const char *  arg,
int  from_tty 
)
static

◆ compile_command()

static void compile_command ( const char *  args,
int  from_tty 
)
static

Definition at line 612 of file compile.c.

References compile_code_command().

Referenced by _initialize_compile().

◆ compile_file_command()

static void compile_file_command ( const char *  arg,
int  from_tty 
)
static

◆ compile_print_command()

static void compile_print_command ( const char *  arg,
int  from_tty 
)
static

◆ compile_print_value()

void compile_print_value ( struct value val,
void *  data_voidp 
)

Definition at line 161 of file compile.c.

References print_value().

Referenced by do_module_cleanup().

◆ compile_register_name_demangle()

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

Definition at line 661 of file compile.c.

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

Referenced by store_regs().

◆ compile_register_name_mangled()

std::string compile_register_name_mangled ( struct gdbarch gdbarch,
int  regnum 
)

◆ compile_to_object()

static compile_file_names compile_to_object ( struct command_line cmd,
const char *  cmd_string,
enum compile_i_scope_types  scope 
)
static

◆ do_rmdir()

static void do_rmdir ( void *  arg)
static

Definition at line 200 of file compile.c.

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

Referenced by get_compile_file_tempdir().

◆ eval_compile_command()

void eval_compile_command ( struct command_line cmd,
const char *  cmd_string,
enum compile_i_scope_types  scope,
void *  scope_data 
)

◆ filter_args()

static void filter_args ( int *  argcp,
char **  argv 
)
static

Definition at line 378 of file compile.c.

References gdb::argv, and xfree().

Referenced by get_args().

◆ get_args()

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

◆ get_compile_file_tempdir()

static const char* get_compile_file_tempdir ( void  )
static

Definition at line 218 of file compile.c.

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

Referenced by get_new_file_names().

◆ get_expr_block_and_pc()

static const struct block* get_expr_block_and_pc ( CORE_ADDR pc)
static

◆ get_new_file_names()

static compile_file_names get_new_file_names ( )
static

Definition at line 246 of file compile.c.

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

Referenced by compile_to_object().

◆ get_selected_pc_producer_options()

static const char* get_selected_pc_producer_options ( void  )
static

◆ print_callback()

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

Definition at line 445 of file compile.c.

References fputs_filtered(), and gdb_stderr.

Referenced by compile_to_object().

◆ set_compile_args()

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

Definition at line 305 of file compile.c.

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

Referenced by _initialize_compile().

◆ show_compile_args()

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

Definition at line 314 of file compile.c.

References _, and fprintf_filtered().

Referenced by _initialize_compile().

◆ show_compile_debug()

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

Definition at line 62 of file compile.c.

References _, and fprintf_filtered().

Referenced by _initialize_compile().

◆ show_compile_gcc()

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

Definition at line 343 of file compile.c.

References _, and fprintf_filtered().

Referenced by _initialize_compile().

Variable Documentation

◆ compile_args

char* compile_args
static

Definition at line 296 of file compile.c.

Referenced by _initialize_compile(), and set_compile_args().

◆ compile_args_argc

int compile_args_argc
static

Definition at line 299 of file compile.c.

Referenced by get_args(), and set_compile_args().

◆ compile_args_argv

char** compile_args_argv
static

Definition at line 300 of file compile.c.

Referenced by get_args(), and set_compile_args().

◆ compile_command_list

struct cmd_list_element* compile_command_list
static

Definition at line 53 of file compile.c.

Referenced by _initialize_compile().

◆ compile_debug

int compile_debug

◆ compile_gcc

char* compile_gcc
static

Definition at line 338 of file compile.c.

Referenced by _initialize_compile(), and compile_to_object().