GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Macros | Functions
compile-loc2c.c File Reference
#include "defs.h"
#include "dwarf2.h"
#include "objfiles.h"
#include "dwarf2/expr.h"
#include "dwarf2/loc.h"
#include "dwarf2/read.h"
#include "ui-file.h"
#include "utils.h"
#include "compile-internal.h"
#include "compile-c.h"
#include "compile.h"
#include "block.h"
#include "dwarf2/frame.h"
#include "gdbsupport/gdb_vecs.h"
#include "value.h"
#include "gdbarch.h"

Go to the source code of this file.

Classes

struct  insn_info
 

Macros

#define SET_CHECK_DEPTH(WHERE)
 
#define GCC_UINTPTR   "__gdb_uintptr"
 
#define GCC_INTPTR   "__gdb_intptr"
 
#define BINARY(OP)
 
#define COMPARE(OP)
 

Functions

static void compute_stack_depth_worker (int start, int *need_tempvar, std::vector< struct insn_info > *info, std::vector< int > *to_do, enum bfd_endian byte_order, unsigned int addr_size, const gdb_byte *op_ptr, const gdb_byte *op_end)
 
static int compute_stack_depth (enum bfd_endian byte_order, unsigned int addr_size, int *need_tempvar, int *is_tls, const gdb_byte *op_ptr, const gdb_byte *op_end, int initial_depth, std::vector< struct insn_info > *info)
 
static void push (int indent, string_file *stream, ULONGEST l)
 
static void pushf (int indent, string_file *stream, const char *format,...) ATTRIBUTE_PRINTF(3
 
static void unary (int indent, string_file *stream, const char *format,...) ATTRIBUTE_PRINTF(3
 
static void binary (int indent, string_file *stream, const char *format,...) ATTRIBUTE_PRINTF(3
 
static void print_label (string_file *stream, unsigned int scope, int target)
 
static void note_register (int regnum, std::vector< bool > &registers_used)
 
static void pushf_register_address (int indent, string_file *stream, std::vector< bool > &registers_used, struct gdbarch *gdbarch, int regnum)
 
static void pushf_register (int indent, string_file *stream, std::vector< bool > &registers_used, struct gdbarch *gdbarch, int regnum, uint64_t offset)
 
static void do_compile_dwarf_expr_to_c (int indent, string_file *stream, const char *type_name, const char *result_name, struct symbol *sym, CORE_ADDR pc, struct gdbarch *arch, std::vector< bool > &registers_used, unsigned int addr_size, const gdb_byte *op_ptr, const gdb_byte *op_end, CORE_ADDR *initial, dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile)
 
void compile_dwarf_expr_to_c (string_file *stream, const char *result_name, struct symbol *sym, CORE_ADDR pc, struct gdbarch *arch, std::vector< bool > &registers_used, unsigned int addr_size, const gdb_byte *op_ptr, const gdb_byte *op_end, dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile)
 
void compile_dwarf_bounds_to_c (string_file *stream, const char *result_name, const struct dynamic_prop *prop, struct symbol *sym, CORE_ADDR pc, struct gdbarch *arch, std::vector< bool > &registers_used, unsigned int addr_size, const gdb_byte *op_ptr, const gdb_byte *op_end, dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile)
 

Macro Definition Documentation

◆ BINARY

#define BINARY ( OP)
Value:
binary (indent, stream, "%s", "__gdb_stack[__gdb_tos-1] " #OP \
" __gdb_stack[__gdb_tos]"); \
break
#define OP(name)
@ binary

◆ COMPARE

#define COMPARE ( OP)
Value:
binary (indent, stream, \
"(((" GCC_INTPTR ") __gdb_stack[__gdb_tos-1]) " #OP \
" ((" GCC_INTPTR \
") __gdb_stack[__gdb_tos]))"); \
break
#define GCC_INTPTR

◆ GCC_INTPTR

#define GCC_INTPTR   "__gdb_intptr"

Definition at line 431 of file compile-loc2c.c.

Referenced by do_compile_dwarf_expr_to_c().

◆ GCC_UINTPTR

#define GCC_UINTPTR   "__gdb_uintptr"

◆ SET_CHECK_DEPTH

#define SET_CHECK_DEPTH ( WHERE)
Value:
if ((*info)[WHERE].visited) \
{ \
if ((*info)[WHERE].depth != stack_depth) \
error (_("inconsistent stack depths")); \
} \
else \
{ \
/* Stack depth not set, so set it. */ \
(*info)[WHERE].visited = 1; \
(*info)[WHERE].depth = stack_depth; \
}

Function Documentation

◆ binary()

static void static void binary ( int indent,
string_file * stream,
const char * format,
... )
static

Definition at line 487 of file compile-loc2c.c.

References gdb_printf(), ui_file::puts(), and ui_file::vprintf().

◆ compile_dwarf_bounds_to_c()

void compile_dwarf_bounds_to_c ( string_file * stream,
const char * result_name,
const struct dynamic_prop * prop,
struct symbol * sym,
CORE_ADDR pc,
struct gdbarch * arch,
std::vector< bool > & registers_used,
unsigned int addr_size,
const gdb_byte * op_ptr,
const gdb_byte * op_end,
dwarf2_per_cu_data * per_cu,
dwarf2_per_objfile * per_objfile )

Definition at line 1162 of file compile-loc2c.c.

References symbol::arch, and do_compile_dwarf_expr_to_c().

Referenced by dwarf2_compile_property_to_c().

◆ compile_dwarf_expr_to_c()

void compile_dwarf_expr_to_c ( string_file * stream,
const char * result_name,
struct symbol * sym,
CORE_ADDR pc,
struct gdbarch * arch,
std::vector< bool > & registers_used,
unsigned int addr_size,
const gdb_byte * op_ptr,
const gdb_byte * op_end,
dwarf2_per_cu_data * per_cu,
dwarf2_per_objfile * per_objfile )

◆ compute_stack_depth()

static int compute_stack_depth ( enum bfd_endian byte_order,
unsigned int addr_size,
int * need_tempvar,
int * is_tls,
const gdb_byte * op_ptr,
const gdb_byte * op_end,
int initial_depth,
std::vector< struct insn_info > * info )
static

Definition at line 390 of file compile-loc2c.c.

References compute_stack_depth_worker().

Referenced by do_compile_dwarf_expr_to_c().

◆ compute_stack_depth_worker()

static void compute_stack_depth_worker ( int start,
int * need_tempvar,
std::vector< struct insn_info > * info,
std::vector< int > * to_do,
enum bfd_endian byte_order,
unsigned int addr_size,
const gdb_byte * op_ptr,
const gdb_byte * op_end )
static

◆ do_compile_dwarf_expr_to_c()

static void do_compile_dwarf_expr_to_c ( int indent,
string_file * stream,
const char * type_name,
const char * result_name,
struct symbol * sym,
CORE_ADDR pc,
struct gdbarch * arch,
std::vector< bool > & registers_used,
unsigned int addr_size,
const gdb_byte * op_ptr,
const gdb_byte * op_end,
CORE_ADDR * initial,
dwarf2_per_cu_data * per_cu,
dwarf2_per_objfile * per_objfile )
static

◆ note_register()

static void note_register ( int regnum,
std::vector< bool > & registers_used )
static

Definition at line 512 of file compile-loc2c.c.

References regnum.

Referenced by pushf_register(), and pushf_register_address().

◆ print_label()

static void print_label ( string_file * stream,
unsigned int scope,
int target )
static

Definition at line 504 of file compile-loc2c.c.

References ui_file::printf().

Referenced by do_compile_dwarf_expr_to_c().

◆ push()

static void push ( int indent,
string_file * stream,
ULONGEST l )
static

Definition at line 436 of file compile-loc2c.c.

References GCC_UINTPTR, and gdb_printf().

Referenced by do_compile_dwarf_expr_to_c().

◆ pushf()

static void static void pushf ( int indent,
string_file * stream,
const char * format,
... )
static

◆ pushf_register()

static void pushf_register ( int indent,
string_file * stream,
std::vector< bool > & registers_used,
struct gdbarch * gdbarch,
int regnum,
uint64_t offset )
static

◆ pushf_register_address()

static void pushf_register_address ( int indent,
string_file * stream,
std::vector< bool > & registers_used,
struct gdbarch * gdbarch,
int regnum )
static

◆ unary()

static void static void unary ( int indent,
string_file * stream,
const char * format,
... )
static

Definition at line 470 of file compile-loc2c.c.

References gdb_printf(), ui_file::puts(), and ui_file::vprintf().

Referenced by do_compile_dwarf_expr_to_c().