GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions | Variables
compile.c File Reference
#include "defs.h"
#include "ui.h"
#include "ui-out.h"
#include "command.h"
#include "cli/cli-script.h"
#include "cli/cli-utils.h"
#include "cli/cli-option.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 "gdbsupport/filestuff.h"
#include "target.h"
#include "osabi.h"
#include "gdbsupport/gdb_wait.h"
#include "valprint.h"
#include "gdbsupport/gdb_optional.h"
#include "gdbsupport/gdb_unlinker.h"
#include "gdbsupport/pathstuff.h"
#include "gdbsupport/scoped_ignore_signal.h"
#include "gdbsupport/buildargv.h"

Go to the source code of this file.

Classes

struct  symbol_error
 
struct  type_map_instance
 
struct  compile_options
 

Macros

#define TMP_PREFIX   "/tmp/gdbobj-"
 
#define TEMPLATE   TMP_PREFIX "XXXXXX"
 
#define FORWARD(OP, ...)   (m_gcc_fe->ops->OP (m_gcc_fe, ##__VA_ARGS__))
 

Typedefs

using compile_flag_option_def = gdb::option::flag_option_def<compile_options>
 

Functions

static hashval_t hash_type_map_instance (const void *p)
 
static int eq_type_map_instance (const void *a, const void *b)
 
static hashval_t hash_symbol_error (const void *a)
 
static int eq_symbol_error (const void *a, const void *b)
 
static void del_symbol_error (void *a)
 
static void show_compile_debug (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
 
static gdb::option::option_def_group make_compile_options_def_group (compile_options *opts)
 
static void compile_file_command (const char *args, int from_tty)
 
static void compile_file_command_completer (struct cmd_list_element *ignore, completion_tracker &tracker, const char *text, const char *word)
 
static void compile_code_command (const char *args, int from_tty)
 
static void compile_code_command_completer (struct cmd_list_element *ignore, completion_tracker &tracker, const char *text, const char *word)
 
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 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 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 (char **argv)
 
static gdb_argv get_args (const compile_instance *compiler, struct gdbarch *gdbarch)
 
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 ()
 

Variables

static struct cmd_list_elementcompile_command_list
 
bool compile_debug
 
static const gdb::option::option_def compile_command_option_defs []
 
static std::string compile_args
 
static gdb_argv compile_args_argv
 
static std::string compile_gcc
 
cmd_list_elementcompile_cmd_element = nullptr
 

Macro Definition Documentation

◆ FORWARD

#define FORWARD ( OP,
... )   (m_gcc_fe->ops->OP (m_gcc_fe, ##__VA_ARGS__))

Definition at line 875 of file compile.c.

◆ TEMPLATE

#define TEMPLATE   TMP_PREFIX "XXXXXX"

◆ TMP_PREFIX

#define TMP_PREFIX   "/tmp/gdbobj-"

Definition at line 53 of file compile.c.

Referenced by do_rmdir().

Typedef Documentation

◆ compile_flag_option_def

Definition at line 262 of file compile.c.

Function Documentation

◆ _initialize_compile()

void _initialize_compile ( )

Definition at line 959 of file compile.c.

Referenced by initialize_all_files().

◆ compile_code_command()

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

◆ compile_code_command_completer()

static void compile_code_command_completer ( struct cmd_list_element * ignore,
completion_tracker & tracker,
const char * text,
const char * word )
static

◆ compile_command()

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

Definition at line 809 of file compile.c.

References compile_code_command().

◆ compile_file_command()

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

◆ compile_file_command_completer()

static void compile_file_command_completer ( struct cmd_list_element * ignore,
completion_tracker & tracker,
const char * text,
const char * word )
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 385 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 857 of file compile.c.

References 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 )

Definition at line 847 of file compile.c.

References gdbarch_register_name(), and regnum.

Referenced by generate_register_struct(), pushf_register(), and pushf_register_address().

◆ 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

◆ del_symbol_error()

static void del_symbol_error ( void * a)
static

Definition at line 135 of file compile.c.

References symbol_error::message, and xfree().

◆ do_rmdir()

static void do_rmdir ( void * arg)
static

Definition at line 432 of file compile.c.

References TMP_PREFIX.

Referenced by get_compile_file_tempdir().

◆ eq_symbol_error()

static int eq_symbol_error ( const void * a,
const void * b )
static

Definition at line 124 of file compile.c.

References symbol_error::sym.

◆ eq_type_map_instance()

static int eq_type_map_instance ( const void * a,
const void * b )
static

Definition at line 103 of file compile.c.

References type_map_instance::type.

◆ 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 ( char ** argv)
static

Definition at line 591 of file compile.c.

References xfree().

Referenced by get_args().

◆ get_args()

static gdb_argv get_args ( const compile_instance * compiler,
struct gdbarch * gdbarch )
static

◆ get_compile_file_tempdir()

static const char * get_compile_file_tempdir ( void )
static

Definition at line 450 of file compile.c.

References do_rmdir(), 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 474 of file compile.c.

References get_compile_file_tempdir().

Referenced by compile_to_object().

◆ get_selected_pc_producer_options()

static const char * get_selected_pc_producer_options ( void )
static

Definition at line 570 of file compile.c.

References find_pc_compunit_symtab(), get_frame_pc(), get_selected_frame(), and symtab_and_line::pc.

Referenced by get_args().

◆ hash_symbol_error()

static hashval_t hash_symbol_error ( const void * a)
static

Definition at line 114 of file compile.c.

References symbol_error::sym.

◆ hash_type_map_instance()

static hashval_t hash_type_map_instance ( const void * p)
static

Definition at line 93 of file compile.c.

References type_map_instance::type.

◆ make_compile_options_def_group()

static gdb::option::option_def_group make_compile_options_def_group ( compile_options * opts)
static

◆ print_callback()

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

Definition at line 660 of file compile.c.

References gdb_puts(), 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 534 of file compile.c.

References compile_args, and compile_args_argv.

◆ 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 542 of file compile.c.

References gdb_printf().

◆ 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 246 of file compile.c.

References gdb_printf().

◆ 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 556 of file compile.c.

References gdb_printf().

Variable Documentation

◆ compile_args

std::string compile_args
static
Initial value:
=
"-O0 -gdwarf-4"
" -fPIE"
" -Wall "
" -Wno-unused-but-set-variable"
" -Wno-unused-variable"
" -fno-stack-protector"

Definition at line 511 of file compile.c.

Referenced by set_compile_args().

◆ compile_args_argv

gdb_argv compile_args_argv
static

Definition at line 529 of file compile.c.

Referenced by get_args(), and set_compile_args().

◆ compile_cmd_element

cmd_list_element* compile_cmd_element = nullptr

Definition at line 955 of file compile.c.

Referenced by process_next_line().

◆ compile_command_list

struct cmd_list_element* compile_command_list
static

Definition at line 57 of file compile.c.

◆ compile_command_option_defs

const gdb::option::option_def compile_command_option_defs[]
static
Initial value:
= {
"raw",
[] (compile_options *opts) { return &opts->raw; },
N_("Suppress automatic 'void _gdb_expr () { CODE }' wrapping."),
},
}

Definition at line 264 of file compile.c.

Referenced by make_compile_options_def_group().

◆ compile_debug

bool compile_debug

◆ compile_gcc

std::string compile_gcc
static

Definition at line 551 of file compile.c.

Referenced by compile_to_object().