122 bp_smob->
stop = SCM_UNDEFINED;
135 case bp_none:
return "BP_NONE";
141 default:
return "internal/other";
155 default:
return "unknown";
182 b->
silent ?
"silent" :
"noisy");
192 scm_puts (
">", port);
194 scm_remember_upto_here_1 (
self);
209 memset (bp_smob, 0,
sizeof (*bp_smob));
211 bp_smob->
stop = SCM_BOOL_F;
213 bp_smob->containing_scm = bp_scm;
227 if (
bp->number < 0 && !from_scheme)
257 scm_gc_protect_object (containing_scm);
293 const char *func_name)
306 return bp_smob->
bp != NULL;
315 const char *func_name)
323 _(
"<gdb:breakpoint>"));
341 const SCM keywords[] = {
346 int type_arg_pos = -1, access_type_arg_pos = -1, internal_arg_pos = -1;
355 &type_arg_pos, &
type,
356 &access_type_arg_pos, &access_type,
357 &internal_arg_pos, &
internal);
369 if (access_type_arg_pos > 0)
372 scm_from_int (access_type),
373 _(
"access type with breakpoint is not allowed"));
385 scm_from_int (access_type),
386 _(
"invalid watchpoint class"));
392 _(
"invalid breakpoint type"));
415 const char *location, *copy;
419 scm_misc_error (
FUNC_NAME,
_(
"not a Scheme breakpoint"), SCM_EOL);
422 scm_misc_error (
FUNC_NAME,
_(
"breakpoint is already registered"), SCM_EOL);
441 eloc.get (), NULL, -1, NULL,
458 else if (access_type ==
hw_read)
478 return SCM_UNSPECIFIED;
503 return SCM_UNSPECIFIED;
511 SCM *list = (SCM *) arg;
525 bp_smob =
bp->scm_bp_object;
554 return scm_reverse_x (list, SCM_EOL);
604 return SCM_UNSPECIFIED;
615 return scm_from_bool (bp_smob->
bp->
silent);
639 return SCM_UNSPECIFIED;
663 SCM_ASSERT_TYPE (scm_is_signed_integer (newvalue, LONG_MIN,
LONG_MAX),
666 value = scm_to_long (newvalue);
680 return SCM_UNSPECIFIED;
703 SCM_ASSERT_TYPE (scm_is_signed_integer (newvalue, LONG_MIN,
LONG_MAX),
706 value = scm_to_long (newvalue);
713 _(
"hit-count must be zero"));
718 return SCM_UNSPECIFIED;
732 return scm_from_long (bp_smob->
bp->
thread);
744 if (scm_is_signed_integer (newvalue, LONG_MIN,
LONG_MAX))
746 id = scm_to_long (newvalue);
750 _(
"invalid thread id"));
756 SCM_ASSERT_TYPE (0, newvalue, SCM_ARG2,
FUNC_NAME,
_(
"integer or #f"));
760 return SCM_UNSPECIFIED;
771 if (bp_smob->
bp->
task == 0)
774 return scm_from_long (bp_smob->
bp->
task);
787 if (scm_is_signed_integer (newvalue, LONG_MIN,
LONG_MAX))
789 id = scm_to_long (newvalue);
804 _(
"invalid task id"));
810 SCM_ASSERT_TYPE (0, newvalue, SCM_ARG2,
FUNC_NAME,
_(
"integer or #f"));
822 return SCM_UNSPECIFIED;
894 SCM_ASSERT_TYPE (scm_is_string (newvalue) ||
gdbscm_is_false (newvalue),
916 return SCM_UNSPECIFIED;
927 return bp_smob->
stop;
943 _(
"procedure or #f"));
952 =
xstrprintf (
_(
"Only one stop condition allowed. There is" 953 " currently a %s stop condition defined for" 954 " this breakpoint."),
957 scm_dynwind_begin ((scm_t_dynwind_flags) 0);
965 bp_smob->
stop = newvalue;
967 return SCM_UNSPECIFIED;
982 if (
bp->commands == NULL)
1013 return scm_from_long (bp_smob->
bp->
type);
1024 return scm_from_bool (bp_smob->
bp->
number >= 0);
1035 return scm_from_long (bp_smob->
number);
1048 if (bp_smob == NULL)
1067 SCM predicate_result;
1070 if (bp_smob == NULL)
1136 bp_smob->
stop = SCM_BOOL_F;
1164 Create a GDB breakpoint object.\n\ 1167 location [#:type <type>] [#:wp-class <wp-class>] [#:internal <bool>]\n\ 1169 <gdb:breakpoint object" },
1171 {
"register-breakpoint!", 1, 0, 0,
1174 Register a <gdb:breakpoint> object with GDB." },
1178 Delete the breakpoint from GDB." },
1182 Return a list of all GDB breakpoints.\n\ 1188 Return #t if the object is a <gdb:breakpoint> object." },
1192 Return #t if the breakpoint has not been deleted from GDB." },
1196 Return the breakpoint's number." },
1200 Return the type of the breakpoint." },
1204 Return #t if the breakpoint is visible to the user." },
1206 {
"breakpoint-location", 1, 0, 0,
1209 Return the location of the breakpoint as specified by the user." },
1211 {
"breakpoint-expression", 1, 0, 0,
1214 Return the expression of the breakpoint as specified by the user.\n\ 1215 Valid for watchpoints only, returns #f for non-watchpoints." },
1217 {
"breakpoint-enabled?", 1, 0, 0,
1220 Return #t if the breakpoint is enabled." },
1222 {
"set-breakpoint-enabled!", 2, 0, 0,
1225 Set the breakpoint's enabled state.\n\ 1227 Arguments: <gdb:breakpoint> boolean" },
1231 Return #t if the breakpoint is silent." },
1233 {
"set-breakpoint-silent!", 2, 0, 0,
1236 Set the breakpoint's silent state.\n\ 1238 Arguments: <gdb:breakpoint> boolean" },
1240 {
"breakpoint-ignore-count", 1, 0, 0,
1243 Return the breakpoint's \"ignore\" count." },
1245 {
"set-breakpoint-ignore-count!", 2, 0, 0,
1248 Set the breakpoint's \"ignore\" count.\n\ 1250 Arguments: <gdb:breakpoint> count" },
1252 {
"breakpoint-hit-count", 1, 0, 0,
1255 Return the breakpoint's \"hit\" count." },
1257 {
"set-breakpoint-hit-count!", 2, 0, 0,
1260 Set the breakpoint's \"hit\" count. The value must be zero.\n\ 1262 Arguments: <gdb:breakpoint> 0" },
1266 Return the breakpoint's global thread id or #f if there isn't one." },
1268 {
"set-breakpoint-thread!", 2, 0, 0,
1271 Set the global thread id for this breakpoint.\n\ 1273 Arguments: <gdb:breakpoint> global-thread-id" },
1277 Return the breakpoint's Ada task-id or #f if there isn't one." },
1279 {
"set-breakpoint-task!", 2, 0, 0,
1282 Set the breakpoint's Ada task-id.\n\ 1284 Arguments: <gdb:breakpoint> task-id" },
1286 {
"breakpoint-condition", 1, 0, 0,
1289 Return the breakpoint's condition as specified by the user.\n\ 1290 Return #f if there isn't one." },
1292 {
"set-breakpoint-condition!", 2, 0, 0,
1295 Set the breakpoint's condition.\n\ 1297 Arguments: <gdb:breakpoint> condition\n\ 1298 condition: a string" },
1302 Return the breakpoint's stop predicate.\n\ 1303 Return #f if there isn't one." },
1305 {
"set-breakpoint-stop!", 2, 0, 0,
1308 Set the breakpoint's stop predicate.\n\ 1310 Arguments: <gdb:breakpoint> procedure\n\ 1311 procedure: A procedure of one argument, the breakpoint.\n\ 1312 Its result is true if program execution should stop." },
1314 {
"breakpoint-commands", 1, 0, 0,
1317 Return the breakpoint's commands." },
int gdbscm_breakpoint_has_cond(const struct extension_language_defn *extlang, struct breakpoint *b)
static scm_t_subr as_a_scm_t_subr(SCM(*func)(void))
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 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)
static SCM gdbscm_breakpoint_location(SCM self)
char * gdbscm_scm_to_c_string(SCM string)
static const char breakpoint_smob_name[]
struct gdbscm_breakpoint_object::@73 spec
static SCM gdbscm_breakpoint_ignore_count(SCM self)
void * memset(T *s, int c, size_t n)=delete
int valid_global_thread_id(int global_id)
void awatch_command_wrapper(const char *arg, int from_tty, int internal)
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)
char * skip_spaces(char *chp)
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)
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)
event_location_up string_to_event_location_basic(const char **stringp, const struct language_defn *language, symbol_name_match_type match_type)
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
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)
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)
std::unique_ptr< event_location, event_location_deleter > event_location_up
const char * event_location_to_string(struct event_location *location)
static SCM gdbscm_breakpoint_valid_p(SCM self)
char * xstrprintf(const char *format,...)
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
static SCM wp_class_keyword
void gdbscm_printf(SCM port, const char *format,...) ATTRIBUTE_PRINTF(2
void watch_command_wrapper(const char *arg, int from_tty, int internal)
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)
const struct language_defn * current_language
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)
static const scheme_integer_constant breakpoint_integer_constants[]
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
event_location_up location
void gdbscm_misc_error(const char *subr, int arg_pos, SCM bad_value, const char *error) ATTRIBUTE_NORETURN
const char * c_str() const
void gdbscm_out_of_range_error(const char *subr, int arg_pos, SCM bad_value, const char *error) ATTRIBUTE_NORETURN
int create_breakpoint(struct gdbarch *gdbarch, const struct event_location *location, const char *cond_string, int thread, const char *extra_string, int parse_extra, 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_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)
void breakpoint_set_thread(struct breakpoint *b, int thread)
#define GDBSCM_HANDLE_GDB_EXCEPTION(exception)
static void bpscm_breakpoint_deleted(struct breakpoint *b)
gdbscm_breakpoint_object * scm_bp_object
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)
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)
void rwatch_command_wrapper(const char *arg, int from_tty, int internal)
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)
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)
static const scheme_function breakpoint_functions[]
#define END_INTEGER_CONSTANTS