70 return htab_hash_pointer (s_smob->
symbol);
120 syscm_gdbarch_data_key);
135 if (s_smob->
symbol != NULL)
155 if (pstate->writingp)
161 if (pstate->writingp)
162 scm_puts (
">", port);
164 scm_remember_upto_here_1 (
self);
219 return (*slot)->containing_scm;
258 return s_smob->
symbol != NULL;
266 const char *func_name)
285 const char *func_name)
456 return scm_from_bool (theclass ==
LOC_BLOCK);
498 return scm_from_bool (result);
525 SCM frame_scm = SCM_BOOL_F;
531 rest, &frame_pos, &frame_scm);
538 _(
"cannot get the value of a typedef"));
546 if (frame_info == NULL)
547 error (
_(
"Invalid frame"));
551 error (
_(
"Symbol requires a frame to compute its value"));
575 SCM block_scm = SCM_BOOL_F;
577 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);
590 if (block_arg_pos >= 0)
620 symbol =
lookup_symbol (name, block, domain, &is_a_field_of_this);
635 scm_from_bool (is_a_field_of_this.
type != NULL));
646 int domain_arg_pos = -1;
653 name_scm, &name, rest,
654 &domain_arg_pos, &domain);
684 #define X(SYM) { "SYMBOL_" #SYM, SYM }
717 Return #t if the object is a <gdb:symbol> object." },
721 Return #t if object is a valid <gdb:symbol> object.\n\
722 A valid symbol is a symbol that has not been freed.\n\
723 Symbols are freed when the objfile they come from is freed." },
727 Return the type of symbol." },
731 Return the symbol table (<gdb:symtab>) containing symbol." },
735 Return the line number at which the symbol was defined." },
739 Return the name of the symbol as a string." },
743 Return the linkage name of the symbol as a string." },
747 Return the print name of the symbol as a string.\n\
748 This is either name or linkage-name, depending on whether the user\n\
749 asked GDB to display demangled or mangled names." },
753 Return the address class of the symbol." },
757 Return #t if the symbol needs a frame to compute its value." },
761 Return #t if the symbol is a function argument." },
765 Return #t if the symbol is a constant." },
769 Return #t if the symbol is a function." },
773 Return #t if the symbol is a variable." },
777 Return the value of the symbol.\n\
779 Arguments: <gdb:symbol> [#:frame frame]" },
783 Return (<gdb:symbol> field-of-this?) if found, otherwise #f.\n\
785 Arguments: name [#:block block] [#:domain domain]\n\
786 name: a string containing the name of the symbol to lookup\n\
787 block: a <gdb:block> object\n\
788 domain: a SYMBOL_*_DOMAIN value" },
792 Return <gdb:symbol> if found, otherwise #f.\n\
794 Arguments: name [#:domain domain]\n\
795 name: a string containing the name of the symbol to lookup\n\
796 domain: a SYMBOL_*_DOMAIN value" },
822 syscm_gdbarch_data_key
static SCM gdbscm_symbol_print_name(SCM self)
struct frame_info * frscm_frame_smob_to_frame(frame_smob *)
static SCM scm_new_smob(scm_t_bits tc, scm_t_bits data)
struct frame_info * get_selected_frame(const char *message)
#define SYMBOL_PRINT_NAME(symbol)
void gdbscm_define_functions(const scheme_function *, int is_public)
struct symbol * syscm_get_valid_symbol_arg_unsafe(SCM self, int arg_pos, const char *func_name)
static struct frame_info * selected_frame
static SCM gdbscm_symbol_addr_class(SCM self)
SCM tyscm_scm_from_type(struct type *type)
static SCM gdbscm_lookup_global_symbol(SCM name_scm, SCM rest)
void * gdbarch_data(struct gdbarch *gdbarch, struct gdbarch_data *data)
static SCM gdbscm_symbol_symtab(SCM self)
#define SYMBOL_CLASS(symbol)
SCM stscm_scm_from_symtab(struct symtab *symtab)
const struct gdb_exception exception_none
struct value * read_var_value(struct symbol *var, struct frame_info *frame)
struct gdbarch * symbol_arch(const struct symbol *symbol)
scm_t_bits gdbscm_make_smob_type(const char *name, size_t size)
static SCM gdbscm_symbol_function_p(SCM self)
void gdbscm_initialize_symbols(void)
static int syscm_eq_symbol_smob(const void *ap, const void *bp)
SCM vlscm_scm_from_value(struct value *value)
SCM syscm_scm_from_symbol(struct symbol *symbol)
struct objfile * symbol_objfile(const struct symbol *symbol)
static int syscm_mark_symbol_invalid(void **slot, void *info)
#define GDBARCH_OBSTACK_ZALLOC(GDBARCH, TYPE)
static hashval_t syscm_hash_symbol_smob(const void *p)
static void syscm_del_objfile_symbols(struct objfile *objfile, void *datum)
#define CATCH(EXCEPTION, MASK)
static SCM gdbscm_symbol_constant_p(SCM self)
static scm_t_bits symbol_smob_tag
static void * syscm_init_arch_symbols(struct gdbarch *gdbarch)
static struct parser_state * pstate
SCM gdbscm_scm_from_c_string(const char *string)
#define gdbscm_is_false(scm)
const struct block * get_frame_block(struct frame_info *frame, CORE_ADDR *addr_in_block)
static SCM syscm_make_symbol_smob(void)
int symbol_read_needs_frame(struct symbol *sym)
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
static struct gdbarch_data * syscm_gdbarch_data_key
void gdbscm_throw(SCM exception) ATTRIBUTE_NORETURN
#define SYMBOL_LINE(symbol)
#define SYMBOL_LINKAGE_NAME(symbol)
static SCM gdbscm_symbol_type(SCM self)
void gdbscm_clear_eqable_gsmob_ptr_slot(htab_t htab, eqable_gdb_smob *base)
static size_t syscm_free_symbol_smob(SCM self)
void gdbscm_printf(SCM port, const char *format,...) ATTRIBUTE_PRINTF(2
static SCM gdbscm_symbol_variable_p(SCM self)
#define SYMBOL_OBJFILE_OWNED(symbol)
htab_t gdbscm_create_eqable_gsmob_ptr_map(htab_hash hash_fn, htab_eq eq_fn)
int syscm_is_symbol(SCM scm)
static SCM gdbscm_symbol_p(SCM scm)
void gdbscm_init_eqable_gsmob(eqable_gdb_smob *base, SCM containing_scm)
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)
void gdbscm_invalid_object_error(const char *subr, int arg_pos, SCM bad_value, const char *error) ATTRIBUTE_NORETURN
static int syscm_print_symbol_smob(SCM self, SCM port, scm_print_state *pstate)
struct symbol * lookup_global_symbol(const char *name, const struct block *block, const domain_enum domain)
eqable_gdb_smob ** gdbscm_find_eqable_gsmob_ptr_slot(htab_t htab, eqable_gdb_smob *base)
static htab_t syscm_get_symbol_map(struct symbol *symbol)
void gdbscm_out_of_range_error(const char *subr, int arg_pos, SCM bad_value, const char *error) ATTRIBUTE_NORETURN
struct symbol * lookup_symbol(const char *name, const struct block *block, domain_enum domain, struct field_of_this_result *is_a_field_of_this)
frame_smob * frscm_get_frame_smob_arg_unsafe(SCM frame_scm, int arg_pos, const char *func_name)
static const struct objfile_data * syscm_objfile_data_key
static SCM gdbscm_symbol_needs_frame_p(SCM self)
static SCM domain_keyword
static int syscm_is_valid(symbol_smob *s_smob)
#define GDBSCM_HANDLE_GDB_EXCEPTION_WITH_CLEANUPS(exception, cleanups)
void gdbscm_parse_function_args(const char *function_name, int beginning_arg_pos, const SCM *keywords, const char *format,...)
void gdbscm_fill_eqable_gsmob_ptr_slot(eqable_gdb_smob **slot, eqable_gdb_smob *base)
static SCM gdbscm_symbol_value(SCM self, SCM rest)
#define SYMBOL_NATURAL_NAME(symbol)
static SCM gdbscm_symbol_line(SCM self)
#define GDBSCM_HANDLE_GDB_EXCEPTION(exception)
static SCM gdbscm_symbol_valid_p(SCM self)
static SCM gdbscm_symbol_linkage_name(SCM self)
#define SYMBOL_TYPE(symbol)
static const char symbol_smob_name[]
static SCM syscm_get_symbol_arg_unsafe(SCM self, int arg_pos, const char *func_name)
static symbol_smob * syscm_get_valid_symbol_smob_arg_unsafe(SCM self, int arg_pos, const char *func_name)
static SCM gdbscm_lookup_symbol(SCM name_scm, SCM rest)
struct symtab * symbol_symtab(const struct symbol *symbol)
void error(const char *fmt,...)
struct gdbarch_data * gdbarch_data_register_post_init(gdbarch_data_post_init_ftype *post_init)
static SCM gdbscm_symbol_name(SCM self)
static symbol_smob * syscm_get_symbol_smob_arg_unsafe(SCM self, int arg_pos, const char *func_name)
void do_cleanups(struct cleanup *old_chain)
#define SYMBOL_IS_ARGUMENT(symbol)
static SCM gdbscm_symbol_argument_p(SCM self)
#define END_INTEGER_CONSTANTS