73 gdb_assert (htab !=
nullptr);
99 return htab_hash_pointer (s_smob->
symbol);
159 if (s_smob->
symbol != NULL)
186 scm_puts (
">", port);
188 scm_remember_upto_here_1 (self);
243 return (*slot)->containing_scm;
282 return s_smob->
symbol != NULL;
290 const char *func_name)
309 const char *func_name)
451 return scm_from_bool (theclass ==
LOC_BLOCK);
488 catch (
const gdb_exception &except)
494 return scm_from_bool (result);
521 SCM frame_scm = SCM_BOOL_F;
526 rest, &frame_pos, &frame_scm);
533 _(
"cannot get the value of a typedef"));
545 error (_(
"Invalid frame"));
549 error (_(
"Symbol requires a frame to compute its value"));
557 catch (
const gdb_exception &except)
577 SCM block_scm = SCM_BOOL_F;
579 int block_arg_pos = -1, domain_arg_pos = -1;
584 name_scm, &
name, rest,
585 &block_arg_pos, &block_scm,
586 &domain_arg_pos, &
domain);
588 if (block_arg_pos >= 0)
609 catch (
const gdb_exception &ex)
621 &is_a_field_of_this).
symbol;
623 catch (
const gdb_exception &ex)
635 scm_from_bool (is_a_field_of_this.
type != NULL));
646 int domain_arg_pos = -1;
652 name_scm, &
name, rest,
653 &domain_arg_pos, &
domain);
659 catch (
const gdb_exception &ex)
680#define X(SYM) { "SYMBOL_" #SYM, SYM }
713Return #t if the object is a <gdb:symbol> object." },
717Return #t if object is a valid <gdb:symbol> object.\n\
718A valid symbol is a symbol that has not been freed.\n\
719Symbols are freed when the objfile they come from is freed." },
723Return the type of symbol." },
727Return the symbol table (<gdb:symtab>) containing symbol." },
731Return the line number at which the symbol was defined." },
735Return the name of the symbol as a string." },
737 {
"symbol-linkage-name", 1, 0, 0,
740Return the linkage name of the symbol as a string." },
744Return the print name of the symbol as a string.\n\
745This is either name or linkage-name, depending on whether the user\n\
746asked GDB to display demangled or mangled names." },
750Return the address class of the symbol." },
752 {
"symbol-needs-frame?", 1, 0, 0,
755Return #t if the symbol needs a frame to compute its value." },
759Return #t if the symbol is a function argument." },
763Return #t if the symbol is a constant." },
767Return #t if the symbol is a function." },
771Return #t if the symbol is a variable." },
775Return the value of the symbol.\n\
777 Arguments: <gdb:symbol> [#:frame frame]" },
781Return (<gdb:symbol> field-of-this?) if found, otherwise #f.\n\
783 Arguments: name [#:block block] [#:domain domain]\n\
784 name: a string containing the name of the symbol to lookup\n\
785 block: a <gdb:block> object\n\
786 domain: a SYMBOL_*_DOMAIN value" },
788 {
"lookup-global-symbol", 1, 0, 1,
791Return <gdb:symbol> if found, otherwise #f.\n\
793 Arguments: name [#:domain domain]\n\
794 name: a string containing the name of the symbol to lookup\n\
795 domain: a SYMBOL_*_DOMAIN value" },
static struct parser_state * pstate
const struct block * get_frame_block(frame_info_ptr frame, CORE_ADDR *addr_in_block)
void set(unsigned key, void *datum)
int symbol_read_needs_frame(struct symbol *sym)
struct value * read_var_value(struct symbol *var, const struct block *var_block, frame_info_ptr frame)
static frame_info_ptr selected_frame
frame_info_ptr get_selected_frame(const char *message)
void gdbscm_init_eqable_gsmob(eqable_gdb_smob *base, SCM containing_scm)
void gdbscm_parse_function_args(const char *function_name, int beginning_arg_pos, const SCM *keywords, const char *format,...)
#define END_INTEGER_CONSTANTS
gdbscm_gdb_exception unpack(const gdb_exception &exc)
htab_t gdbscm_create_eqable_gsmob_ptr_map(htab_hash hash_fn, htab_eq eq_fn)
SCM vlscm_scm_from_value(struct value *value)
void gdbscm_invalid_object_error(const char *subr, int arg_pos, SCM bad_value, const char *error) ATTRIBUTE_NORETURN
frame_smob * frscm_get_frame_smob_arg_unsafe(SCM frame_scm, int arg_pos, const char *func_name)
SCM tyscm_scm_from_type(struct type *type)
void gdbscm_out_of_range_error(const char *subr, int arg_pos, SCM bad_value, const char *error) ATTRIBUTE_NORETURN
void gdbscm_clear_eqable_gsmob_ptr_slot(htab_t htab, eqable_gdb_smob *base)
#define gdbscm_is_false(scm)
void gdbscm_printf(SCM port, const char *format,...) ATTRIBUTE_PRINTF(2
void gdbscm_define_integer_constants(const scheme_integer_constant *, int is_public)
const struct block * bkscm_scm_to_block(SCM block_scm, int arg_pos, const char *func_name, SCM *excp)
static SCM scm_new_smob(scm_t_bits tc, scm_t_bits data)
void gdbscm_define_functions(const scheme_function *, int is_public)
eqable_gdb_smob ** gdbscm_find_eqable_gsmob_ptr_slot(htab_t htab, eqable_gdb_smob *base)
struct frame_info_ptr frscm_frame_smob_to_frame(frame_smob *)
#define GDBSCM_HANDLE_GDB_EXCEPTION(exception)
void gdbscm_fill_eqable_gsmob_ptr_slot(eqable_gdb_smob **slot, eqable_gdb_smob *base)
scm_t_bits gdbscm_make_smob_type(const char *name, size_t size)
SCM stscm_scm_from_symtab(struct symtab *symtab)
void gdbscm_throw(SCM exception) ATTRIBUTE_NORETURN
static scm_t_subr as_a_scm_t_subr(SCM(*func)(void))
SCM gdbscm_scm_from_c_string(const char *string)
static scm_t_bits symbol_smob_tag
static SCM gdbscm_symbol_addr_class(SCM self)
static SCM gdbscm_symbol_function_p(SCM self)
static symbol_smob * syscm_get_valid_symbol_smob_arg_unsafe(SCM self, int arg_pos, const char *func_name)
static hashval_t syscm_hash_symbol_smob(const void *p)
static const char symbol_smob_name[]
static htab_t syscm_get_symbol_map(struct symbol *symbol)
static SCM gdbscm_symbol_type(SCM self)
static SCM gdbscm_symbol_name(SCM self)
static SCM syscm_get_symbol_arg_unsafe(SCM self, int arg_pos, const char *func_name)
int syscm_is_symbol(SCM scm)
static SCM gdbscm_symbol_symtab(SCM self)
static SCM gdbscm_symbol_constant_p(SCM self)
static size_t syscm_free_symbol_smob(SCM self)
static SCM gdbscm_symbol_line(SCM self)
static SCM gdbscm_lookup_symbol(SCM name_scm, SCM rest)
static SCM gdbscm_symbol_needs_frame_p(SCM self)
static const registry< objfile >::key< htab, syscm_deleter > syscm_objfile_data_key
void gdbscm_initialize_symbols(void)
static SCM domain_keyword
static SCM gdbscm_symbol_variable_p(SCM self)
static int syscm_eq_symbol_smob(const void *ap, const void *bp)
static SCM syscm_make_symbol_smob(void)
static SCM gdbscm_symbol_print_name(SCM self)
static SCM gdbscm_symbol_linkage_name(SCM self)
static SCM gdbscm_symbol_value(SCM self, SCM rest)
static symbol_smob * syscm_get_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_is_valid(symbol_smob *s_smob)
static const scheme_function symbol_functions[]
SCM syscm_scm_from_symbol(struct symbol *symbol)
static SCM gdbscm_symbol_argument_p(SCM self)
static int syscm_print_symbol_smob(SCM self, SCM port, scm_print_state *pstate)
static SCM gdbscm_symbol_valid_p(SCM self)
static const scheme_integer_constant symbol_integer_constants[]
static SCM gdbscm_lookup_global_symbol(SCM name_scm, SCM rest)
static SCM gdbscm_symbol_p(SCM scm)
static const registry< gdbarch >::key< syscm_gdbarch_data > syscm_gdbarch_data_key
const char * natural_name() const
const char * print_name() const
const char * linkage_name() const
address_class aclass() const
struct type * type() const
domain_enum domain() const
bool is_objfile_owned() const
unsigned int line() const
struct objfile * objfile() const
void operator()(htab_t htab)
static int syscm_mark_symbol_invalid(void **slot, void *info)
struct block_symbol lookup_symbol(const char *name, const struct block *block, domain_enum domain, struct field_of_this_result *is_a_field_of_this)
struct block_symbol lookup_global_symbol(const char *name, const struct block *block, const domain_enum domain)