GDB (xrefs)

Classes | Macros | Functions | Variables
scm-symbol.c File Reference
`#include "defs.h"`
`#include "block.h"`
`#include "frame.h"`
`#include "symtab.h"`
`#include "objfiles.h"`
`#include "value.h"`
`#include "guile-internal.h"`

Go to the source code of this file.

## Classes
struct | symbol_smob
struct | syscm_gdbarch_data

## Macros
#define | X(SYM) { "SYMBOL_" #SYM, SYM }

## Functions
static hashval_t | syscm_hash_symbol_smob (const void *p)
static int | syscm_eq_symbol_smob (const void *ap, const void *bp)
static void * | syscm_init_arch_symbols (struct gdbarch *gdbarch)
static htab_t | syscm_get_symbol_map (struct symbol *symbol)
static size_t | syscm_free_symbol_smob (SCM self)
static int | syscm_print_symbol_smob (SCM self, SCM port, scm_print_state *pstate)
static SCM | syscm_make_symbol_smob (void)
int | syscm_is_symbol (SCM scm)
static SCM | gdbscm_symbol_p (SCM scm)
SCM | syscm_scm_from_symbol (struct symbol *symbol)
static SCM | syscm_get_symbol_arg_unsafe (SCM self, int arg_pos, const char *func_name)
static symbol_smob * | syscm_get_symbol_smob_arg_unsafe (SCM self, int arg_pos, const char *func_name)
static int | syscm_is_valid (symbol_smob *s_smob)
static symbol_smob * | syscm_get_valid_symbol_smob_arg_unsafe (SCM self, int arg_pos, const char *func_name)
struct symbol * | syscm_get_valid_symbol_arg_unsafe (SCM self, int arg_pos, const char *func_name)
static int | syscm_mark_symbol_invalid (void **slot, void *info)
static void | syscm_del_objfile_symbols (struct objfile *objfile, void *datum)
static SCM | gdbscm_symbol_valid_p (SCM self)
static SCM | gdbscm_symbol_type (SCM self)
static SCM | gdbscm_symbol_symtab (SCM self)
static SCM | gdbscm_symbol_name (SCM self)
static SCM | gdbscm_symbol_linkage_name (SCM self)
static SCM | gdbscm_symbol_print_name (SCM self)
static SCM | gdbscm_symbol_addr_class (SCM self)
static SCM | gdbscm_symbol_argument_p (SCM self)
static SCM | gdbscm_symbol_constant_p (SCM self)
static SCM | gdbscm_symbol_function_p (SCM self)
static SCM | gdbscm_symbol_variable_p (SCM self)
static SCM | gdbscm_symbol_needs_frame_p (SCM self)
static SCM | gdbscm_symbol_line (SCM self)
static SCM | gdbscm_symbol_value (SCM self, SCM rest)
static SCM | gdbscm_lookup_symbol (SCM name_scm, SCM rest)
static SCM | gdbscm_lookup_global_symbol (SCM name_scm, SCM rest)
void | gdbscm_initialize_symbols (void)

## Variables
static const char | symbol_smob_name [] = "gdb:symbol"
static scm_t_bits | symbol_smob_tag
static SCM | block_keyword
static SCM | domain_keyword
static SCM | frame_keyword
static const struct objfile_data * | syscm_objfile_data_key
static struct gdbarch_data * | syscm_gdbarch_data_key
static const scheme_integer_constant | symbol_integer_constants []
static const scheme_function | symbol_functions []

## Macro Definition Documentation

## ◆ X

#define X | ( |  | SYM | ) | { "SYMBOL_" #SYM, SYM }

## Function Documentation

## ◆ gdbscm_initialize_symbols()

void gdbscm_initialize_symbols | ( | void |  | ) |

Definition at line 811 of file scm-symbol.c.

References block_keyword, domain_keyword, frame_keyword, gdbarch_data_register_post_init(), gdbscm_define_functions(), gdbscm_define_integer_constants(), gdbscm_make_smob_type(), symbol_functions, symbol_integer_constants, symbol_smob_name, symbol_smob_tag, syscm_del_objfile_symbols(), syscm_free_symbol_smob(), syscm_gdbarch_data_key, syscm_init_arch_symbols(), syscm_objfile_data_key, and syscm_print_symbol_smob().

## ◆ gdbscm_lookup_global_symbol()

static SCM gdbscm_lookup_global_symbol | ( | SCM | name_scm,
|  | SCM | rest
| ) |  |
| static

Definition at line 648 of file scm-symbol.c.

References CATCH, do_cleanups(), domain_keyword, END_CATCH, exception_none, FUNC_NAME, GDBSCM_HANDLE_GDB_EXCEPTION, gdbscm_parse_function_args(), lookup_global_symbol(), make_cleanup(), name, RETURN_MASK_ALL, block_symbol::symbol, syscm_scm_from_symbol(), TRY, VAR_DOMAIN, and xfree().

## ◆ gdbscm_lookup_symbol()

static SCM gdbscm_lookup_symbol | ( | SCM | name_scm,
|  | SCM | rest
| ) |  |
| static

Definition at line 575 of file scm-symbol.c.

References _, bkscm_scm_to_block(), block_keyword, CATCH, do_cleanups(), domain_keyword, END_CATCH, exception_none, FUNC_NAME, GDBSCM_HANDLE_GDB_EXCEPTION, GDBSCM_HANDLE_GDB_EXCEPTION_WITH_CLEANUPS, gdbscm_parse_function_args(), gdbscm_throw(), get_frame_block(), get_selected_frame(), lookup_symbol(), make_cleanup(), name, RETURN_MASK_ALL, selected_frame, block_symbol::symbol, syscm_scm_from_symbol(), TRY, field_of_this_result::type, VAR_DOMAIN, and xfree().

## ◆ gdbscm_symbol_addr_class()

static SCM gdbscm_symbol_addr_class | ( | SCM | self | ) |
| static

Definition at line 409 of file scm-symbol.c.

References FUNC_NAME, symbol_smob::symbol, SYMBOL_CLASS, and syscm_get_valid_symbol_smob_arg_unsafe().

## ◆ gdbscm_symbol_argument_p()

static SCM gdbscm_symbol_argument_p | ( | SCM | self | ) |
| static

Definition at line 421 of file scm-symbol.c.

References FUNC_NAME, symbol_smob::symbol, SYMBOL_IS_ARGUMENT, and syscm_get_valid_symbol_smob_arg_unsafe().

## ◆ gdbscm_symbol_constant_p()

static SCM gdbscm_symbol_constant_p | ( | SCM | self | ) |
| static

Definition at line 433 of file scm-symbol.c.

References FUNC_NAME, LOC_CONST, LOC_CONST_BYTES, symbol_smob::symbol, SYMBOL_CLASS, and syscm_get_valid_symbol_smob_arg_unsafe().

## ◆ gdbscm_symbol_function_p()

static SCM gdbscm_symbol_function_p | ( | SCM | self | ) |
| static

Definition at line 448 of file scm-symbol.c.

References FUNC_NAME, LOC_BLOCK, symbol_smob::symbol, SYMBOL_CLASS, and syscm_get_valid_symbol_smob_arg_unsafe().

## ◆ gdbscm_symbol_line()

static SCM gdbscm_symbol_line | ( | SCM | self | ) |
| static

Definition at line 506 of file scm-symbol.c.

References FUNC_NAME, symbol_smob::symbol, SYMBOL_LINE, and syscm_get_valid_symbol_smob_arg_unsafe().

## ◆ gdbscm_symbol_linkage_name()

static SCM gdbscm_symbol_linkage_name | ( | SCM | self | ) |
| static

Definition at line 385 of file scm-symbol.c.

References FUNC_NAME, gdbscm_scm_from_c_string(), symbol_smob::symbol, SYMBOL_LINKAGE_NAME, and syscm_get_valid_symbol_smob_arg_unsafe().

## ◆ gdbscm_symbol_name()

static SCM gdbscm_symbol_name | ( | SCM | self | ) |
| static

Definition at line 373 of file scm-symbol.c.

References FUNC_NAME, gdbscm_scm_from_c_string(), symbol_smob::symbol, SYMBOL_NATURAL_NAME, and syscm_get_valid_symbol_smob_arg_unsafe().

## ◆ gdbscm_symbol_needs_frame_p()

static SCM gdbscm_symbol_needs_frame_p | ( | SCM | self | ) |
| static

Definition at line 482 of file scm-symbol.c.

References CATCH, END_CATCH, FUNC_NAME, GDBSCM_HANDLE_GDB_EXCEPTION, RETURN_MASK_ALL, symbol_smob::symbol, symbol_read_needs_frame(), syscm_get_valid_symbol_smob_arg_unsafe(), and TRY.

## ◆ gdbscm_symbol_p()

static SCM gdbscm_symbol_p | ( | SCM | scm | ) |
| static

Definition at line 198 of file scm-symbol.c.

References syscm_is_symbol().

## ◆ gdbscm_symbol_print_name()

static SCM gdbscm_symbol_print_name | ( | SCM | self | ) |
| static

Definition at line 397 of file scm-symbol.c.

References FUNC_NAME, gdbscm_scm_from_c_string(), symbol_smob::symbol, SYMBOL_PRINT_NAME, and syscm_get_valid_symbol_smob_arg_unsafe().

## ◆ gdbscm_symbol_symtab()

static SCM gdbscm_symbol_symtab | ( | SCM | self | ) |
| static

Definition at line 359 of file scm-symbol.c.

References FUNC_NAME, stscm_scm_from_symtab(), symbol_smob::symbol, SYMBOL_OBJFILE_OWNED, symbol_symtab(), and syscm_get_valid_symbol_smob_arg_unsafe().

## ◆ gdbscm_symbol_type()

static SCM gdbscm_symbol_type | ( | SCM | self | ) |
| static

Definition at line 342 of file scm-symbol.c.

References FUNC_NAME, symbol_smob::symbol, SYMBOL_TYPE, syscm_get_valid_symbol_smob_arg_unsafe(), and tyscm_scm_from_type().

## ◆ gdbscm_symbol_valid_p()

static SCM gdbscm_symbol_valid_p | ( | SCM | self | ) |
| static

Definition at line 330 of file scm-symbol.c.

References FUNC_NAME, syscm_get_symbol_smob_arg_unsafe(), and syscm_is_valid().

## ◆ gdbscm_symbol_value()

static SCM gdbscm_symbol_value | ( | SCM | self,
|  | SCM | rest
| ) |  |
| static

Definition at line 519 of file scm-symbol.c.

References _, CATCH, END_CATCH, error(), frame_keyword, frscm_frame_smob_to_frame(), frscm_get_frame_smob_arg_unsafe(), FUNC_NAME, GDBSCM_HANDLE_GDB_EXCEPTION, gdbscm_is_false, gdbscm_out_of_range_error(), gdbscm_parse_function_args(), LOC_TYPEDEF, read_var_value(), RETURN_MASK_ALL, symbol_smob::symbol, SYMBOL_CLASS, symbol_read_needs_frame(), syscm_get_valid_symbol_smob_arg_unsafe(), TRY, and vlscm_scm_from_value().

## ◆ gdbscm_symbol_variable_p()

static SCM gdbscm_symbol_variable_p | ( | SCM | self | ) |
| static

Definition at line 463 of file scm-symbol.c.

References FUNC_NAME, LOC_COMPUTED, LOC_LOCAL, LOC_OPTIMIZED_OUT, LOC_REGISTER, LOC_STATIC, symbol_smob::symbol, SYMBOL_CLASS, SYMBOL_IS_ARGUMENT, and syscm_get_valid_symbol_smob_arg_unsafe().

## ◆ syscm_del_objfile_symbols()

static void syscm_del_objfile_symbols | ( | struct objfile * | objfile,
|  | void * | datum
| ) |  |
| static

Definition at line 313 of file scm-symbol.c.

References syscm_mark_symbol_invalid().

Referenced by gdbscm_initialize_symbols().

## ◆ syscm_eq_symbol_smob()

static int syscm_eq_symbol_smob | ( | const void * | ap,
|  | const void * | bp
| ) |  |
| static

Definition at line 76 of file scm-symbol.c.

References bp, and symbol_smob::symbol.

Referenced by syscm_get_symbol_map(), and syscm_init_arch_symbols().

## ◆ syscm_free_symbol_smob()

static size_t syscm_free_symbol_smob | ( | SCM | self | ) |
| static

Definition at line 132 of file scm-symbol.c.

References symbol_smob::base, gdbscm_clear_eqable_gsmob_ptr_slot(), syscm_gdbarch_data::htab, symbol_smob::symbol, and syscm_get_symbol_map().

Referenced by gdbscm_initialize_symbols().

## ◆ syscm_get_symbol_arg_unsafe()

static SCM syscm_get_symbol_arg_unsafe | ( | SCM | self,
|  | int | arg_pos,
|  | const char * | func_name
| ) |  |
| static

Definition at line 234 of file scm-symbol.c.

References symbol_smob_name, and syscm_is_symbol().

Referenced by syscm_get_symbol_smob_arg_unsafe().

## ◆ syscm_get_symbol_map()

static htab_t syscm_get_symbol_map | ( | struct symbol * | symbol | ) |
| static

Definition at line 100 of file scm-symbol.c.

References gdbscm_create_eqable_gsmob_ptr_map(), syscm_gdbarch_data::htab, symbol_arch(), symbol_objfile(), SYMBOL_OBJFILE_OWNED, syscm_eq_symbol_smob(), syscm_gdbarch_data_key, syscm_hash_symbol_smob(), and syscm_objfile_data_key.

Referenced by syscm_free_symbol_smob(), and syscm_scm_from_symbol().

## ◆ syscm_get_symbol_smob_arg_unsafe()

static symbol_smob* syscm_get_symbol_smob_arg_unsafe | ( | SCM | self,
|  | int | arg_pos,
|  | const char * | func_name
| ) |  |
| static

Definition at line 246 of file scm-symbol.c.

References syscm_get_symbol_arg_unsafe().

Referenced by gdbscm_symbol_valid_p(), and syscm_get_valid_symbol_smob_arg_unsafe().

## ◆ syscm_get_valid_symbol_arg_unsafe()

struct symbol* syscm_get_valid_symbol_arg_unsafe | ( | SCM | self,
|  | int | arg_pos,
|  | const char * | func_name
| ) |  |

Definition at line 285 of file scm-symbol.c.

References symbol_smob::symbol, and syscm_get_valid_symbol_smob_arg_unsafe().

Referenced by gdbscm_frame_read_var().

## ◆ syscm_get_valid_symbol_smob_arg_unsafe()

static symbol_smob* syscm_get_valid_symbol_smob_arg_unsafe | ( | SCM | self,
|  | int | arg_pos,
|  | const char * | func_name
| ) |  |
| static

Definition at line 266 of file scm-symbol.c.

References _, gdbscm_invalid_object_error(), syscm_get_symbol_smob_arg_unsafe(), and syscm_is_valid().

Referenced by gdbscm_symbol_addr_class(), gdbscm_symbol_argument_p(), gdbscm_symbol_constant_p(), gdbscm_symbol_function_p(), gdbscm_symbol_line(), gdbscm_symbol_linkage_name(), gdbscm_symbol_name(), gdbscm_symbol_needs_frame_p(), gdbscm_symbol_print_name(), gdbscm_symbol_symtab(), gdbscm_symbol_type(), gdbscm_symbol_value(), gdbscm_symbol_variable_p(), and syscm_get_valid_symbol_arg_unsafe().

## ◆ syscm_hash_symbol_smob()

static hashval_t syscm_hash_symbol_smob | ( | const void * | p | ) |
| static

Definition at line 66 of file scm-symbol.c.

References symbol_smob::symbol.

Referenced by syscm_get_symbol_map(), and syscm_init_arch_symbols().

## ◆ syscm_init_arch_symbols()

static void* syscm_init_arch_symbols | ( | struct gdbarch * | gdbarch | ) |
| static

Definition at line 86 of file scm-symbol.c.

References GDBARCH_OBSTACK_ZALLOC, gdbscm_create_eqable_gsmob_ptr_map(), syscm_gdbarch_data::htab, syscm_eq_symbol_smob(), and syscm_hash_symbol_smob().

Referenced by gdbscm_initialize_symbols().

## ◆ syscm_is_symbol()

int syscm_is_symbol | ( | SCM | scm | ) |

Definition at line 190 of file scm-symbol.c.

References symbol_smob_tag.

Referenced by gdbscm_frame_read_var(), gdbscm_symbol_p(), and syscm_get_symbol_arg_unsafe().

## ◆ syscm_is_valid()

static int syscm_is_valid | ( | symbol_smob * | s_smob | ) |
| static

Definition at line 257 of file scm-symbol.c.

References symbol_smob::symbol.

Referenced by gdbscm_symbol_valid_p(), and syscm_get_valid_symbol_smob_arg_unsafe().

## ◆ syscm_make_symbol_smob()

static SCM syscm_make_symbol_smob | ( | void |  | ) |
| static

Definition at line 174 of file scm-symbol.c.

References gdbscm_init_eqable_gsmob(), scm_new_smob(), symbol_smob::symbol, symbol_smob_name, and symbol_smob_tag.

Referenced by syscm_scm_from_symbol().

## ◆ syscm_mark_symbol_invalid()

static int syscm_mark_symbol_invalid | ( | void ** | slot,
|  | void * | info
| ) |  |
| static

Definition at line 298 of file scm-symbol.c.

References symbol_smob::symbol.

Referenced by syscm_del_objfile_symbols().

## ◆ syscm_print_symbol_smob()

static int syscm_print_symbol_smob | ( | SCM | self,
|  | SCM | port,
|  | scm_print_state * | pstate
| ) |  |
| static

Definition at line 152 of file scm-symbol.c.

References gdbscm_printf(), pstate, symbol_smob::symbol, SYMBOL_PRINT_NAME, and symbol_smob_name.

Referenced by gdbscm_initialize_symbols().

## ◆ syscm_scm_from_symbol()

SCM syscm_scm_from_symbol | ( | struct symbol * | symbol | ) |

Definition at line 207 of file scm-symbol.c.

References symbol_smob::base, gdbscm_fill_eqable_gsmob_ptr_slot(), gdbscm_find_eqable_gsmob_ptr_slot(), syscm_gdbarch_data::htab, symbol_smob::symbol, symbol, syscm_get_symbol_map(), and syscm_make_symbol_smob().

Referenced by gdbscm_block_function(), gdbscm_block_next_symbol_x(), gdbscm_block_symbols(), gdbscm_frame_function(), gdbscm_lookup_global_symbol(), and gdbscm_lookup_symbol().

## Variable Documentation

## ◆ block_keyword

SCM block_keyword
| static

Definition at line 48 of file scm-symbol.c.

Referenced by gdbscm_initialize_symbols(), and gdbscm_lookup_symbol().

## ◆ domain_keyword

SCM domain_keyword
| static

Definition at line 49 of file scm-symbol.c.

Referenced by gdbscm_initialize_symbols(), gdbscm_lookup_global_symbol(), and gdbscm_lookup_symbol().

## ◆ frame_keyword

SCM frame_keyword
| static

Definition at line 50 of file scm-symbol.c.

Referenced by gdbscm_initialize_symbols(), and gdbscm_symbol_value().

## ◆ symbol_functions

const scheme_function symbol_functions[]
| static

Definition at line 719 of file scm-symbol.c.

Referenced by gdbscm_initialize_symbols().

## ◆ symbol_integer_constants

const scheme_integer_constant symbol_integer_constants[]
| static

Initial value:
=
{
#define X(SYM)
X (LOC_UNDEF),
X (LOC_CONST),
X (LOC_STATIC),
X (LOC_REGISTER),
X (LOC_ARG),
X (LOC_REF_ARG),
X (LOC_LOCAL),
X (LOC_TYPEDEF),
X (LOC_LABEL),
X (LOC_BLOCK),
X (LOC_CONST_BYTES),
X (LOC_UNRESOLVED),
X (LOC_OPTIMIZED_OUT),
X (LOC_COMPUTED),
X (LOC_REGPARM_ADDR),
X (UNDEF_DOMAIN),
X (VAR_DOMAIN),
X (STRUCT_DOMAIN),
X (LABEL_DOMAIN),
X (VARIABLES_DOMAIN),
X (FUNCTIONS_DOMAIN),
X (TYPES_DOMAIN),
END_INTEGER_CONSTANTS
}
LOC_BLOCK
Definition: symtab.h:854
LOC_UNDEF
Definition: symtab.h:797
UNDEF_DOMAIN
Definition: symtab.h:734
LOC_TYPEDEF
Definition: symtab.h:844
STRUCT_DOMAIN
Definition: symtab.h:745
LOC_ARG
Definition: symtab.h:823
LABEL_DOMAIN
Definition: symtab.h:753
LOC_LOCAL
Definition: symtab.h:839
LOC_REGISTER
Definition: symtab.h:819
FUNCTIONS_DOMAIN
Definition: symtab.h:780
LOC_CONST_BYTES
Definition: symtab.h:859
LOC_COMPUTED
Definition: symtab.h:892
TYPES_DOMAIN
Definition: symtab.h:783
LOC_CONST
Definition: symtab.h:801
LOC_UNRESOLVED
Definition: symtab.h:883
LOC_STATIC
Definition: symtab.h:805
LOC_REGPARM_ADDR
Definition: symtab.h:835
LOC_REF_ARG
Definition: symtab.h:827
VARIABLES_DOMAIN
Definition: symtab.h:777
LOC_LABEL
Definition: symtab.h:848
VAR_DOMAIN
Definition: symtab.h:739
LOC_OPTIMIZED_OUT
Definition: symtab.h:888
X
#define X(SYM)
END_INTEGER_CONSTANTS
#define END_INTEGER_CONSTANTS
Definition: guile-internal.h:113

Definition at line 688 of file scm-symbol.c.

Referenced by gdbscm_initialize_symbols().

## ◆ symbol_smob_name

const char symbol_smob_name[] = "gdb:symbol"
| static

Definition at line 42 of file scm-symbol.c.

Referenced by gdbscm_initialize_symbols(), syscm_get_symbol_arg_unsafe(), syscm_make_symbol_smob(), and syscm_print_symbol_smob().

## ◆ symbol_smob_tag

scm_t_bits symbol_smob_tag
| static

Definition at line 45 of file scm-symbol.c.

Referenced by gdbscm_initialize_symbols(), syscm_is_symbol(), and syscm_make_symbol_smob().

## ◆ syscm_gdbarch_data_key

struct gdbarch_data* syscm_gdbarch_data_key
| static

Definition at line 53 of file scm-symbol.c.

Referenced by gdbscm_initialize_symbols(), and syscm_get_symbol_map().

## ◆ syscm_objfile_data_key

const struct objfile_data* syscm_objfile_data_key
| static

Definition at line 52 of file scm-symbol.c.

Referenced by gdbscm_initialize_symbols(), and syscm_get_symbol_map().