121 bp_smob->
stop = SCM_UNDEFINED;
134 case bp_none:
return "BP_NONE";
140 default:
return "internal/other";
149 switch (enable_state)
154 default:
return "unknown";
179 b->
silent ?
"silent" :
"noisy");
188 scm_puts (
">", port);
190 scm_remember_upto_here_1 (
self);
205 memset (bp_smob, 0,
sizeof (*bp_smob));
207 bp_smob->
stop = SCM_BOOL_F;
208 bp_scm =
scm_new_smob (breakpoint_smob_tag, (scm_t_bits) bp_smob);
209 bp_smob->containing_scm = bp_scm;
223 if (bp->
number < 0 && !from_scheme)
253 scm_gc_protect_object (containing_scm);
261 return SCM_SMOB_PREDICATE (breakpoint_smob_tag, scm);
279 breakpoint_smob_name);
289 const char *func_name)
302 return bp_smob->
bp != NULL;
311 const char *func_name)
319 _(
"<gdb:breakpoint>"));
337 const SCM keywords[] = {
342 int type_arg_pos = -1, access_type_arg_pos = -1, internal_arg_pos = -1;
350 location_scm, &location, rest,
351 &type_arg_pos, &type,
352 &access_type_arg_pos, &access_type,
353 &internal_arg_pos, &
internal);
365 if (access_type_arg_pos > 0)
368 scm_from_int (access_type),
369 _(
"access type with breakpoint is not allowed"));
381 scm_from_int (access_type),
382 _(
"invalid watchpoint class"));
388 _(
"invalid breakpoint type"));
414 scm_misc_error (
FUNC_NAME,
_(
"not a Scheme breakpoint"), SCM_EOL);
417 scm_misc_error (
FUNC_NAME,
_(
"breakpoint is already registered"), SCM_EOL);
419 pending_breakpoint_scm =
self;
431 location, NULL, -1, NULL,
448 else if (access_type ==
hw_read)
465 pending_breakpoint_scm = SCM_BOOL_F;
468 return SCM_UNSPECIFIED;
493 return SCM_UNSPECIFIED;
544 return scm_reverse_x (list, SCM_EOL);
594 return SCM_UNSPECIFIED;
605 return scm_from_bool (bp_smob->
bp->
silent);
629 return SCM_UNSPECIFIED;
653 SCM_ASSERT_TYPE (scm_is_signed_integer (newvalue, LONG_MIN,
LONG_MAX),
656 value = scm_to_long (newvalue);
670 return SCM_UNSPECIFIED;
693 SCM_ASSERT_TYPE (scm_is_signed_integer (newvalue, LONG_MIN,
LONG_MAX),
696 value = scm_to_long (newvalue);
703 _(
"hit-count must be zero"));
708 return SCM_UNSPECIFIED;
722 return scm_from_long (bp_smob->
bp->
thread);
734 if (scm_is_signed_integer (newvalue, LONG_MIN,
LONG_MAX))
736 id = scm_to_long (newvalue);
740 _(
"invalid thread id"));
746 SCM_ASSERT_TYPE (0, newvalue, SCM_ARG2,
FUNC_NAME,
_(
"integer or #f"));
750 return SCM_UNSPECIFIED;
761 if (bp_smob->
bp->
task == 0)
764 return scm_from_long (bp_smob->
bp->
task);
777 if (scm_is_signed_integer (newvalue, LONG_MIN,
LONG_MAX))
779 id = scm_to_long (newvalue);
794 _(
"invalid task id"));
800 SCM_ASSERT_TYPE (0, newvalue, SCM_ARG2,
FUNC_NAME,
_(
"integer or #f"));
812 return SCM_UNSPECIFIED;
885 SCM_ASSERT_TYPE (scm_is_string (newvalue) ||
gdbscm_is_false (newvalue),
907 return SCM_UNSPECIFIED;
918 return bp_smob->
stop;
934 _(
"procedure or #f"));
943 =
xstrprintf (
_(
"Only one stop condition allowed. There is"
944 " currently a %s stop condition defined for"
945 " this breakpoint."),
948 scm_dynwind_begin (0);
956 bp_smob->
stop = newvalue;
958 return SCM_UNSPECIFIED;
1012 return scm_from_long (bp_smob->
bp->
type);
1023 return scm_from_bool (bp_smob->
bp->
number >= 0);
1034 return scm_from_long (bp_smob->
number);
1047 if (bp_smob == NULL)
1066 SCM predicate_result;
1069 if (bp_smob == NULL)
1110 pending_breakpoint_scm = SCM_BOOL_F;
1135 bp_smob->
stop = SCM_BOOL_F;
1163 Create a GDB breakpoint object.\n\
1166 location [#:type <type>] [#:wp-class <wp-class>] [#:internal <bool>]\n\
1168 <gdb:breakpoint object" },
1172 Register a <gdb:breakpoint> object with GDB." },
1176 Delete the breakpoint from GDB." },
1180 Return a list of all GDB breakpoints.\n\
1186 Return #t if the object is a <gdb:breakpoint> object." },
1190 Return #t if the breakpoint has not been deleted from GDB." },
1194 Return the breakpoint's number." },
1198 Return the type of the breakpoint." },
1202 Return #t if the breakpoint is visible to the user." },
1206 Return the location of the breakpoint as specified by the user." },
1210 Return the expression of the breakpoint as specified by the user.\n\
1211 Valid for watchpoints only, returns #f for non-watchpoints." },
1215 Return #t if the breakpoint is enabled." },
1219 Set the breakpoint's enabled state.\n\
1221 Arguments: <gdb:breakpoint> boolean" },
1225 Return #t if the breakpoint is silent." },
1229 Set the breakpoint's silent state.\n\
1231 Arguments: <gdb:breakpoint> boolean" },
1235 Return the breakpoint's \"ignore\" count." },
1237 {
"set-breakpoint-ignore-count!", 2, 0, 0,
1240 Set the breakpoint's \"ignore\" count.\n\
1242 Arguments: <gdb:breakpoint> count" },
1246 Return the breakpoint's \"hit\" count." },
1250 Set the breakpoint's \"hit\" count. The value must be zero.\n\
1252 Arguments: <gdb:breakpoint> 0" },
1256 Return the breakpoint's thread id or #f if there isn't one." },
1260 Set the thread id for this breakpoint.\n\
1262 Arguments: <gdb:breakpoint> thread-id" },
1266 Return the breakpoint's Ada task-id or #f if there isn't one." },
1270 Set the breakpoint's Ada task-id.\n\
1272 Arguments: <gdb:breakpoint> task-id" },
1276 Return the breakpoint's condition as specified by the user.\n\
1277 Return #f if there isn't one." },
1281 Set the breakpoint's condition.\n\
1283 Arguments: <gdb:breakpoint> condition\n\
1284 condition: a string" },
1288 Return the breakpoint's stop predicate.\n\
1289 Return #f if there isn't one." },
1293 Set the breakpoint's stop predicate.\n\
1295 Arguments: <gdb:breakpoint> procedure\n\
1296 procedure: A procedure of one argument, the breakpoint.\n\
1297 Its result is true if program execution should stop." },
1301 Return the breakpoint's commands." },
1320 type_keyword = scm_from_latin1_keyword (
"type");
1321 wp_class_keyword = scm_from_latin1_keyword (
"wp-class");
1322 internal_keyword = scm_from_latin1_keyword (
"internal");
int gdbscm_breakpoint_has_cond(const struct extension_language_defn *extlang, struct breakpoint *b)
struct command_line * breakpoint_commands(struct breakpoint *b)
struct observer * observer_attach_breakpoint_deleted(observer_breakpoint_deleted_ftype *f)
static SCM scm_new_smob(scm_t_bits tc, scm_t_bits data)
void awatch_command_wrapper(char *arg, int from_tty, int internal)
void set_ignore_count(int bptnum, int count, int from_tty)
static SCM bpscm_make_breakpoint_smob(void)
void gdbscm_define_functions(const scheme_function *, int is_public)
static SCM gdbscm_breakpoint_expression(SCM self)
struct counted_command_line * commands
static SCM gdbscm_breakpoint_location(SCM self)
char * ui_file_xstrdup(struct ui_file *file, long *length)
char * gdbscm_scm_to_c_string(SCM string)
static const char breakpoint_smob_name[]
static SCM gdbscm_breakpoint_ignore_count(SCM self)
static SCM gdbscm_breakpoint_commands(SCM self)
static SCM gdbscm_breakpoint_stop(SCM self)
const struct gdb_exception exception_none
scm_t_bits gdbscm_make_smob_type(const char *name, size_t size)
#define gdbscm_is_bool(scm)
void rwatch_command_wrapper(char *arg, int from_tty, int internal)
static SCM gdbscm_set_breakpoint_ignore_count_x(SCM self, SCM newvalue)
static int bpscm_build_bp_list(struct breakpoint *bp, void *arg)
static SCM gdbscm_register_breakpoint_x(SCM self)
static const char * bpscm_type_to_string(enum bptype type)
struct gdbscm_breakpoint_object::@84 spec
static SCM gdbscm_set_breakpoint_stop_x(SCM self, SCM newvalue)
static SCM gdbscm_breakpoint_condition(SCM self)
int gdbscm_is_exception(SCM scm)
void enable_breakpoint(struct breakpoint *bpt)
static int bpscm_print_breakpoint_smob(SCM self, SCM port, scm_print_state *pstate)
#define gdbscm_is_true(scm)
void breakpoint_set_task(struct breakpoint *b, int task)
enum target_hw_bp_type access_type
static SCM gdbscm_breakpoints(void)
static SCM internal_keyword
int valid_thread_id(int thread)
void gdbscm_dynwind_xfree(void *ptr)
static SCM gdbscm_set_breakpoint_thread_x(SCM self, SCM newvalue)
static SCM gdbscm_breakpoint_visible(SCM self)
void gdbscm_init_gsmob(gdb_smob *base)
#define CATCH(EXCEPTION, MASK)
static void bpscm_attach_scm_to_breakpoint(struct breakpoint *bp, SCM containing_scm)
static struct parser_state * pstate
static SCM gdbscm_set_breakpoint_condition_x(SCM self, SCM newvalue)
SCM gdbscm_scm_from_c_string(const char *string)
struct breakpoint * iterate_over_breakpoints(int(*callback)(struct breakpoint *, void *), void *data)
#define gdbscm_is_false(scm)
int is_watchpoint(const struct breakpoint *bpt)
static SCM gdbscm_set_breakpoint_task_x(SCM self, SCM newvalue)
struct observer * observer_attach_breakpoint_created(observer_breakpoint_created_ftype *f)
#define gdb_assert_not_reached(message)
static SCM gdbscm_set_breakpoint_enabled_x(SCM self, SCM newvalue)
static SCM gdbscm_set_breakpoint_silent_x(SCM self, SCM newvalue)
static breakpoint_smob * bpscm_get_breakpoint_smob_arg_unsafe(SCM self, int arg_pos, const char *func_name)
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
void disable_breakpoint(struct breakpoint *bpt)
static SCM gdbscm_breakpoint_thread(SCM self)
struct gdbarch * get_current_arch(void)
static SCM gdbscm_breakpoint_silent_p(SCM self)
struct breakpoint * get_breakpoint(int num)
static size_t bpscm_free_breakpoint_smob(SCM self)
static SCM gdbscm_breakpoint_valid_p(SCM self)
char * xstrprintf(const char *format,...)
struct gdbscm_breakpoint_object * scm_bp_object
struct gdbscm_breakpoint_object breakpoint_smob
void print_command_lines(struct ui_out *uiout, struct command_line *cmd, unsigned int depth)
static SCM gdbscm_breakpoint_task(SCM self)
static int bpscm_is_valid(breakpoint_smob *bp_smob)
struct breakpoint_ops bkpt_breakpoint_ops
struct ui_file * mem_fileopen(void)
static SCM wp_class_keyword
void gdbscm_printf(SCM port, const char *format,...) ATTRIBUTE_PRINTF(2
const struct extension_language_defn * get_ext_lang_defn(enum extension_language lang)
static scm_t_bits breakpoint_smob_tag
static SCM gdbscm_delete_breakpoint_x(SCM self)
void gdbscm_initialize_breakpoints(void)
SCM gdbscm_safe_call_1(SCM proc, SCM arg0, excp_matcher_func *ok_excps)
static SCM gdbscm_breakpoint_enabled_p(SCM self)
static SCM gdbscm_breakpoint_number(SCM self)
void gdbscm_define_integer_constants(const scheme_integer_constant *, int is_public)
const struct extension_language_defn * get_breakpoint_cond_ext_lang(struct breakpoint *b, enum extension_language skip_lang)
static SCM bpscm_get_breakpoint_arg_unsafe(SCM self, int arg_pos, const char *func_name)
static int bpscm_want_scm_wrapper_p(struct breakpoint *bp, int from_scheme)
int create_breakpoint(struct gdbarch *gdbarch, char *arg, char *cond_string, int thread, char *extra_string, int parse_arg, int tempflag, enum bptype type_wanted, int ignore_count, enum auto_boolean pending_break_support, const struct breakpoint_ops *ops, int from_tty, int enabled, int internal, unsigned flags)
void gdbscm_invalid_object_error(const char *subr, int arg_pos, SCM bad_value, const char *error) ATTRIBUTE_NORETURN
static void bpscm_breakpoint_created(struct breakpoint *bp)
const char * ext_lang_capitalized_name(const struct extension_language_defn *extlang)
static SCM gdbscm_set_breakpoint_hit_count_x(SCM self, SCM newvalue)
static SCM pending_breakpoint_scm
struct cleanup * make_cleanup_ui_file_delete(struct ui_file *arg)
void gdbscm_misc_error(const char *subr, int arg_pos, SCM bad_value, const char *error) ATTRIBUTE_NORETURN
void watch_command_wrapper(char *arg, int from_tty, int internal)
void gdbscm_out_of_range_error(const char *subr, int arg_pos, SCM bad_value, const char *error) ATTRIBUTE_NORETURN
void gdbscm_throw_gdb_exception(struct gdb_exception exception) ATTRIBUTE_NORETURN
static SCM gdbscm_breakpoint_type(SCM self)
void gdbscm_parse_function_args(const char *function_name, int beginning_arg_pos, const SCM *keywords, const char *format,...)
void breakpoint_set_silent(struct breakpoint *b, int silent)
int ui_out_redirect(struct ui_out *uiout, struct ui_file *outstream)
void breakpoint_set_thread(struct breakpoint *b, int thread)
#define GDBSCM_HANDLE_GDB_EXCEPTION(exception)
static void bpscm_breakpoint_deleted(struct breakpoint *b)
static SCM gdbscm_make_breakpoint(SCM location_scm, SCM rest)
static breakpoint_smob * bpscm_get_valid_breakpoint_smob_arg_unsafe(SCM self, int arg_pos, const char *func_name)
struct ui_out * current_uiout
enum enable_state enable_state
static const char * bpscm_enable_state_to_string(enum enable_state enable_state)
static int bpscm_is_breakpoint(SCM scm)
static SCM gdbscm_breakpoint_hit_count(SCM self)
int gdbscm_is_procedure(SCM proc)
void delete_breakpoint(struct breakpoint *bpt)
void set_breakpoint_condition(struct breakpoint *b, const char *exp, int from_tty)
void do_cleanups(struct cleanup *old_chain)
char * gdbscm_gc_xstrdup(const char *)
enum ext_lang_bp_stop gdbscm_breakpoint_cond_says_stop(const struct extension_language_defn *extlang, struct breakpoint *b)
static SCM gdbscm_breakpoint_p(SCM scm)
#define END_INTEGER_CONSTANTS