100 gdb_assert (htab !=
nullptr);
118 return htab_hash_pointer (b_smob->
block);
130 && a->
block != NULL);
158 if (b_smob->
block != NULL)
166 b_smob->
block = NULL;
191 hex_string (b->
start ()), hex_string (b->
end ()));
193 scm_puts (
">", port);
195 scm_remember_upto_here_1 (self);
210 b_smob->
block = NULL;
251 return (*slot)->containing_scm;
254 b_smob = (
block_smob *) SCM_SMOB_DATA (b_scm);
291 return b_smob->
block != NULL;
299 const char *func_name)
353 return b_smob->
block;
421 const struct block *super_block;
512 result = scm_cons (s_scm, result);
515 return scm_reverse_x (result, SCM_EOL);
543 ?
"global" :
"static");
562 scm_puts (
">", port);
564 scm_remember_upto_here_1 (self);
580 memset (&i_smob->
iter, 0, sizeof (i_smob->
iter));
628 SCM progress, iter_scm, block_scm;
682 if (cust != NULL && cust->
objfile () != NULL)
685 catch (
const gdb_exception &except)
691 if (cust == NULL || cust->
objfile () == NULL)
694 _(
"cannot locate object file for block"));
708Return #t if the object is a <gdb:block> object." },
712Return #t if the block is valid.\n\
713A block becomes invalid when its objfile is freed." },
717Return the start address of the block." },
721Return the end address of the block." },
725Return the gdb:symbol object of the function containing the block\n\
726or #f if the block does not live in any function." },
730Return the superblock (parent block) of the block." },
734Return the global block of the block." },
738Return the static block of the block." },
742Return #t if block is a global block." },
746Return #t if block is a static block." },
750Return a list of all symbols (as <gdb:symbol> objects) in the block." },
752 {
"make-block-symbols-iterator", 1, 0, 0,
755Return a <gdb:iterator> object for iterating over all symbols in the block." },
757 {
"block-symbols-progress?", 1, 0, 0,
760Return #t if the object is a <gdb:block-symbols-progress> object." },
764Return the innermost GDB block containing the address or #f if none found.\n\
767 address: the address to lookup" },
790 = scm_c_define_gsubr (
"%block-next-symbol!", 1, 0, 0,
795Internal function to assist the block symbols iterator."));
static struct parser_state * pstate
struct symbol * block_iterator_first(const struct block *block, struct block_iterator *iterator, const lookup_name_info *name)
const struct block * block_for_pc(CORE_ADDR pc)
struct symbol * block_iterator_next(struct block_iterator *iterator)
iterator_range< block_iterator_wrapper > block_iterator_range
void set(unsigned key, void *datum)
SCM gdbscm_make_invalid_object_error(const char *subr, int arg_pos, SCM bad_value, const char *error)
void gdbscm_init_eqable_gsmob(eqable_gdb_smob *base, SCM containing_scm)
SCM gdbscm_make_type_error(const char *subr, int arg_pos, SCM bad_value, const char *expected_type)
SCM itscm_iterator_smob_object(iterator_smob *i_smob)
SCM itscm_iterator_smob_progress(iterator_smob *i_smob)
void gdbscm_parse_function_args(const char *function_name, int beginning_arg_pos, const SCM *keywords, const char *format,...)
SCM gdbscm_documentation_symbol
gdbscm_gdb_exception unpack(const gdb_exception &exc)
htab_t gdbscm_create_eqable_gsmob_ptr_map(htab_hash hash_fn, htab_eq eq_fn)
void gdbscm_init_gsmob(gdb_smob *base)
void gdbscm_invalid_object_error(const char *subr, int arg_pos, SCM bad_value, const char *error) ATTRIBUTE_NORETURN
SCM gdbscm_make_iterator(SCM object, SCM progress, SCM next)
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)
SCM gdbscm_scm_from_ulongest(ULONGEST l)
void gdbscm_printf(SCM port, const char *format,...) ATTRIBUTE_PRINTF(2
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)
#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 itscm_get_iterator_arg_unsafe(SCM self, int arg_pos, const char *func_name)
SCM syscm_scm_from_symbol(struct symbol *symbol)
static scm_t_subr as_a_scm_t_subr(SCM(*func)(void))
SCM gdbscm_end_of_iteration(void)
SCM gdbscm_scm_from_c_string(const char *string)
static SCM bkscm_make_block_syms_progress_smob(void)
static block_smob * bkscm_get_block_smob_arg_unsafe(SCM self, int arg_pos, const char *func_name)
static int bkscm_is_block(SCM scm)
static SCM gdbscm_block_end(SCM self)
static SCM gdbscm_block_next_symbol_x(SCM self)
static SCM gdbscm_block_static_p(SCM self)
static SCM gdbscm_block_valid_p(SCM self)
static SCM gdbscm_block_function(SCM self)
static SCM gdbscm_block_superblock(SCM self)
static SCM gdbscm_make_block_syms_iter(SCM self)
static int bkscm_eq_block_smob(const void *ap, const void *bp)
static int bkscm_print_block_smob(SCM self, SCM port, scm_print_state *pstate)
static scm_t_bits block_smob_tag
static SCM gdbscm_block_global_p(SCM self)
static const registry< objfile >::key< htab, bkscm_deleter > bkscm_objfile_data_key
static const char block_smob_name[]
static const scheme_function block_functions[]
static scm_t_bits block_syms_progress_smob_tag
SCM bkscm_scm_from_block(const struct block *block, struct objfile *objfile)
static htab_t bkscm_objfile_block_map(struct objfile *objfile)
static SCM gdbscm_lookup_block(SCM pc_scm)
static SCM bkscm_make_block_smob(void)
static int bkscm_is_valid(block_smob *b_smob)
static block_smob * bkscm_get_valid_block_smob_arg_unsafe(SCM self, int arg_pos, const char *func_name)
void gdbscm_initialize_blocks(void)
const struct block * bkscm_scm_to_block(SCM block_scm, int arg_pos, const char *func_name, SCM *excp)
static SCM gdbscm_block_static_block(SCM self)
static SCM gdbscm_block_global_block(SCM self)
static SCM bkscm_next_symbol_x_proc
static SCM bkscm_get_block_arg_unsafe(SCM self, int arg_pos, const char *func_name)
static SCM gdbscm_block_p(SCM scm)
static int bkscm_is_block_syms_progress(SCM scm)
static SCM gdbscm_block_start(SCM self)
static const char block_syms_progress_smob_name[]
static hashval_t bkscm_hash_block_smob(const void *p)
static block_smob * bkscm_get_valid_block(SCM scm, int arg_pos, const char *func_name, SCM *excp)
static SCM gdbscm_block_symbols(SCM self)
static SCM bkscm_block_syms_progress_p(SCM scm)
static int bkscm_print_block_syms_progress_smob(SCM self, SCM port, scm_print_state *pstate)
static size_t bkscm_free_block_smob(SCM self)
const char * symtab_to_filename_for_display(struct symtab *symtab)
static int bkscm_mark_block_invalid(void **slot, void *info)
void operator()(htab_t htab)
struct compunit_symtab * compunit_symtab
union block_iterator::@21 d
const struct block * block
struct block_iterator iter
const block * superblock() const
const struct block * global_block() const
const struct block * static_block() const
symbol * function() const
struct objfile * objfile() const
symtab * primary_filetab() const
struct compunit_symtab ** includes
struct objfile * objfile() const
const char * print_name() const
struct compunit_symtab * find_pc_compunit_symtab(CORE_ADDR pc)