98 gdb_assert (htab !=
nullptr);
116 hashval_t hash = htab_hash_pointer (f_smob->
inferior);
190 scm_remember_upto_here_1 (self);
243 int frame_id_is_next = 0;
252 return (*slot)->containing_scm;
266 frame_id_is_next = 1;
271 frame_id_is_next = 0;
275 catch (
const gdb_exception &except)
281 f_smob = (
frame_smob *) SCM_SMOB_DATA (f_scm);
353 scm_misc_error (func_name, _(
"inferior has changed"), SCM_EOL);
371 if (f_smob->frame_id_is_next)
396 result = frame !=
nullptr;
398 catch (
const gdb_exception &except)
404 return scm_from_bool (result);
415 gdb::unique_xmalloc_ptr<char>
name;
432 catch (
const gdb_exception &except)
474 catch (
const gdb_exception &except)
486 return scm_from_int (
type);
504 found = frame !=
nullptr;
506 catch (
const gdb_exception &except)
537 if (frame !=
nullptr)
543 catch (
const gdb_exception &except)
555 return scm_from_int (stop_reason);
580 catch (
const gdb_exception &except)
617 catch (
const gdb_exception &except)
629 for (fn_block =
block;
630 fn_block != NULL && fn_block->
function () == NULL;
631 fn_block = fn_block->superblock ())
634 if (
block == NULL || fn_block == NULL || fn_block->
function () == NULL)
636 scm_misc_error (
FUNC_NAME, _(
"cannot find block for frame"),
657 struct symbol *sym = NULL;
672 catch (
const gdb_exception &except)
713 catch (
const gdb_exception &except)
754 catch (
const gdb_exception &except)
794 catch (
const gdb_exception &except)
822 register_scm, ®ister_str);
836 strlen (register_str));
841 catch (
const gdb_exception &ex)
846 xfree (register_str);
858 _(
"unknown register"));
877 int block_arg_pos = -1;
878 SCM block_scm = SCM_UNDEFINED;
880 struct symbol *var = NULL;
891 catch (
const gdb_exception &except)
904 rest, &block_arg_pos, &block_scm);
910 SCM_ASSERT (SCM_UNBNDP (block_scm), block_scm, SCM_ARG3,
FUNC_NAME);
912 else if (scm_is_string (symbol_scm))
916 if (! SCM_UNBNDP (block_scm))
920 gdb_assert (block_arg_pos > 0);
928 gdb::unique_xmalloc_ptr<char> var_name
944 catch (
const gdb_exception &ex)
954 _(
"variable not found"));
959 SCM_ASSERT_TYPE (0, symbol_scm, SCM_ARG1,
FUNC_NAME,
960 _(
"gdb:symbol or string"));
967 catch (
const gdb_exception &except)
997 catch (
const gdb_exception &except)
1009 return SCM_UNSPECIFIED;
1025 catch (
const gdb_exception &except)
1047 catch (
const gdb_exception &except)
1066 reason_scm, &reason);
1068 if (reason < UNWIND_FIRST || reason > UNWIND_LAST)
1069 scm_out_of_range (
FUNC_NAME, reason_scm);
1079#define ENTRY(X) { #X, X }
1091#define SET(name, description) \
1092 { "FRAME_" #name, name },
1093#include "unwind_stop_reasons.def"
1103Return #t if the object is a <gdb:frame> object." },
1107Return #t if the object is a valid <gdb:frame> object.\n\
1108Frames become invalid when the inferior returns to its caller." },
1112Return the name of the function corresponding to this frame,\n\
1113or #f if there is no function." },
1117Return the frame's architecture as a <gdb:arch> object." },
1121Return the frame type, namely one of the gdb:*_FRAME constants." },
1123 {
"frame-unwind-stop-reason", 1, 0, 0,
1126Return one of the gdb:FRAME_UNWIND_* constants explaining why\n\
1127it's not possible to find frames older than this." },
1131Return the frame's resume address." },
1135Return the frame's code block, or #f if one cannot be found." },
1139Return the <gdb:symbol> for the function corresponding to this frame,\n\
1140or #f if there isn't one." },
1144Return the frame immediately older (outer) to this frame,\n\
1145or #f if there isn't one." },
1149Return the frame immediately newer (inner) to this frame,\n\
1150or #f if there isn't one." },
1154Return the frame's symtab-and-line <gdb:sal> object." },
1158Return the value of the symbol in the frame.\n\
1160 Arguments: <gdb:frame> <gdb:symbol>\n\
1161 Or: <gdb:frame> string [#:block <gdb:block>]" },
1163 {
"frame-read-register", 2, 0, 0,
1166Return the value of the register in the frame.\n\
1168 Arguments: <gdb:frame> string" },
1172Select this frame." },
1176Return the newest frame." },
1180Return the selected frame." },
1182 {
"unwind-stop-reason-string", 1, 0, 0,
1185Return a string explaining the unwind stop reason.\n\
1187 Arguments: integer (the result of frame-unwind-stop-reason)" },
static struct parser_state * pstate
struct symbol * find_pc_function(CORE_ADDR pc)
const struct block * get_frame_block(frame_info_ptr frame, CORE_ADDR *addr_in_block)
void set(unsigned key, void *datum)
struct value * value_of_register(int regnum, frame_info_ptr frame)
struct value * read_var_value(struct symbol *var, const struct block *var_block, frame_info_ptr frame)
const struct frame_id null_frame_id
frame_info_ptr get_next_frame(frame_info_ptr this_frame)
enum unwind_stop_reason get_frame_unwind_stop_reason(frame_info_ptr frame)
void select_frame(frame_info_ptr fi)
CORE_ADDR get_frame_pc(frame_info_ptr frame)
const char * unwind_stop_reason_to_string(enum unwind_stop_reason reason)
struct gdbarch * get_frame_arch(frame_info_ptr this_frame)
enum frame_type get_frame_type(frame_info_ptr frame)
frame_info_ptr get_selected_frame(const char *message)
frame_info_ptr frame_find_by_id(struct frame_id id)
frame_info_ptr get_current_frame(void)
CORE_ADDR get_frame_address_in_block(frame_info_ptr this_frame)
struct frame_id get_frame_id(frame_info_ptr fi)
frame_info_ptr get_prev_frame(frame_info_ptr this_frame)
symtab_and_line find_frame_sal(frame_info_ptr frame)
void gdbscm_init_eqable_gsmob(eqable_gdb_smob *base, SCM containing_scm)
int syscm_is_symbol(SCM 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)
SCM stscm_scm_from_sal(struct symtab_and_line sal)
SCM gdbscm_scm_from_gdb_exception(const gdbscm_gdb_exception &exception)
void gdbscm_invalid_object_error(const char *subr, int arg_pos, SCM bad_value, const char *error) ATTRIBUTE_NORETURN
void gdbscm_out_of_range_error(const char *subr, int arg_pos, SCM bad_value, const char *error) ATTRIBUTE_NORETURN
SCM bkscm_scm_from_block(const struct block *block, struct objfile *objfile)
void gdbscm_clear_eqable_gsmob_ptr_slot(htab_t htab, eqable_gdb_smob *base)
SCM arscm_scm_from_arch(struct gdbarch *gdbarch)
SCM gdbscm_scm_from_ulongest(ULONGEST l)
void gdbscm_printf(SCM port, const char *format,...) ATTRIBUTE_PRINTF(2
gdb::unique_xmalloc_ptr< char > gdbscm_scm_to_c_string(SCM string)
struct symbol * syscm_get_valid_symbol_arg_unsafe(SCM self, int arg_pos, const char *func_name)
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)
int gdbscm_is_exception(SCM scm)
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)
void gdbscm_throw(SCM exception) ATTRIBUTE_NORETURN
SCM syscm_scm_from_symbol(struct symbol *symbol)
static scm_t_subr as_a_scm_t_subr(SCM(*func)(void))
SCM gdbscm_scm_from_c_string(const char *string)
struct inferior * current_inferior(void)
static const scheme_function frame_functions[]
static SCM gdbscm_unwind_stop_reason_string(SCM reason_scm)
static SCM frscm_scm_from_frame_unsafe(struct frame_info *frame, struct inferior *inferior)
static SCM gdbscm_frame_p(SCM scm)
static SCM gdbscm_frame_sal(SCM self)
struct frame_info_ptr frscm_frame_smob_to_frame(frame_smob *f_smob)
static SCM frscm_scm_from_frame(struct frame_info *frame, struct inferior *inferior)
static size_t frscm_free_frame_smob(SCM self)
static SCM gdbscm_frame_read_var(SCM self, SCM symbol_scm, SCM rest)
static hashval_t frscm_hash_frame_smob(const void *p)
static SCM gdbscm_frame_newer(SCM self)
static scm_t_bits frame_smob_tag
static int frscm_print_frame_smob(SCM self, SCM port, scm_print_state *pstate)
static const registry< inferior >::key< htab, frscm_deleter > frscm_inferior_data_key
static int frscm_eq_frame_smob(const void *ap, const void *bp)
static SCM gdbscm_frame_select(SCM self)
static SCM gdbscm_frame_unwind_stop_reason(SCM self)
static const scheme_integer_constant frame_integer_constants[]
static SCM frscm_make_frame_smob(void)
static SCM gdbscm_frame_pc(SCM self)
static SCM gdbscm_frame_function(SCM self)
static const char frame_smob_name[]
static SCM gdbscm_selected_frame(void)
void gdbscm_initialize_frames(void)
static SCM gdbscm_frame_block(SCM self)
frame_smob * frscm_get_frame_smob_arg_unsafe(SCM self, int arg_pos, const char *func_name)
int frscm_is_frame(SCM scm)
static SCM gdbscm_frame_type(SCM self)
static htab_t frscm_inferior_frame_map(struct inferior *inferior)
static SCM gdbscm_frame_read_register(SCM self, SCM register_scm)
static SCM frscm_get_frame_arg_unsafe(SCM self, int arg_pos, const char *func_name)
static SCM gdbscm_frame_older(SCM self)
static SCM gdbscm_frame_name(SCM self)
static SCM gdbscm_frame_valid_p(SCM self)
static SCM gdbscm_frame_arch(SCM self)
static SCM gdbscm_newest_frame(void)
gdb::unique_xmalloc_ptr< char > find_frame_funname(frame_info_ptr frame, enum language *funlang, struct symbol **funcp)
const struct block * block
symbol * function() const
std::string to_string() const
unsigned int special_addr_p
__extension__ enum frame_id_stack_status stack_status
struct inferior * inferior
void operator()(htab_t htab)
static int frscm_mark_frame_invalid(void **slot, void *info)
struct objfile * objfile() const
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)
int user_reg_map_name_to_regnum(struct gdbarch *gdbarch, const char *name, int len)