126 bp_smob->
stop = SCM_UNDEFINED;
139 case bp_none:
return "BP_NONE";
146 default:
return "internal/other";
160 default:
return "unknown";
185 b->
silent ?
"silent" :
"noisy");
192 const char *str = b->
locspec->to_string ();
198 scm_puts (
">", port);
200 scm_remember_upto_here_1 (self);
215 memset (bp_smob, 0,
sizeof (*bp_smob));
217 bp_smob->
stop = SCM_BOOL_F;
233 if (
bp->number < 0 && !from_scheme)
264 scm_gc_protect_object (containing_scm);
300 const char *func_name)
313 return bp_smob->
bp != NULL;
322 const char *func_name)
330 _(
"<gdb:breakpoint>"));
348 const SCM keywords[] = {
354 int type_arg_pos = -1, access_type_arg_pos = -1,
355 internal_arg_pos = -1, temporary_arg_pos = -1;
357 int access_type = hw_write;
364 location_scm, &location, rest,
365 &type_arg_pos, &
type,
366 &access_type_arg_pos, &access_type,
367 &internal_arg_pos, &internal,
368 &temporary_arg_pos, &temporary);
380 if (access_type_arg_pos > 0)
383 scm_from_int (access_type),
384 _(
"access type with breakpoint is not allowed"));
396 scm_from_int (access_type),
397 _(
"invalid watchpoint class"));
409 _(
"unsupported breakpoint type"));
415 _(
"invalid breakpoint type"));
439 const char *location, *copy;
443 scm_misc_error (
FUNC_NAME, _(
"not a Scheme breakpoint"), SCM_EOL);
446 scm_misc_error (
FUNC_NAME, _(
"breakpoint is already registered"), SCM_EOL);
450 copy = skip_spaces (location);
468 locspec.get (), NULL, -1, NULL,
false,
481 if (access_type == hw_write)
483 else if (access_type == hw_access)
485 else if (access_type == hw_read)
488 gdb_assert_not_reached (
"invalid access type");
492 gdb_assert_not_reached (
"invalid breakpoint type");
495 catch (
const gdb_exception &ex)
504 return SCM_UNSPECIFIED;
524 catch (
const gdb_exception &except)
530 return SCM_UNSPECIFIED;
551 bp_smob =
bp->scm_bp_object;
575 return scm_reverse_x (list, SCM_EOL);
620 catch (
const gdb_exception &except)
626 return SCM_UNSPECIFIED;
637 return scm_from_bool (bp_smob->
bp->
silent);
656 catch (
const gdb_exception &except)
662 return SCM_UNSPECIFIED;
686 SCM_ASSERT_TYPE (scm_is_signed_integer (newvalue, LONG_MIN,
LONG_MAX),
687 newvalue, SCM_ARG2,
FUNC_NAME, _(
"integer"));
689 value = scm_to_long (newvalue);
698 catch (
const gdb_exception &except)
704 return SCM_UNSPECIFIED;
727 SCM_ASSERT_TYPE (scm_is_signed_integer (newvalue, LONG_MIN,
LONG_MAX),
728 newvalue, SCM_ARG2,
FUNC_NAME, _(
"integer"));
730 value = scm_to_long (newvalue);
737 _(
"hit-count must be zero"));
742 return SCM_UNSPECIFIED;
756 return scm_from_long (bp_smob->
bp->
thread);
768 if (scm_is_signed_integer (newvalue, LONG_MIN,
LONG_MAX))
770 id = scm_to_long (newvalue);
774 _(
"invalid thread id"));
780 SCM_ASSERT_TYPE (0, newvalue, SCM_ARG2,
FUNC_NAME, _(
"integer or #f"));
784 return SCM_UNSPECIFIED;
795 if (bp_smob->
bp->
task == 0)
798 return scm_from_long (bp_smob->
bp->
task);
811 if (scm_is_signed_integer (newvalue, LONG_MIN,
LONG_MAX))
813 id = scm_to_long (newvalue);
820 catch (
const gdb_exception &except)
829 _(
"invalid task id"));
835 SCM_ASSERT_TYPE (0, newvalue, SCM_ARG2,
FUNC_NAME, _(
"integer or #f"));
842 catch (
const gdb_exception &except)
848 return SCM_UNSPECIFIED;
862 const char *str = bp_smob->
bp->
locspec->to_string ();
917 SCM_ASSERT_TYPE (scm_is_string (newvalue) ||
gdbscm_is_false (newvalue),
923 gdb::unique_xmalloc_ptr<char>
exp
930 return SCM_UNSPECIFIED;
942 return bp_smob->
stop;
958 _(
"procedure or #f"));
967 = xstrprintf (_(
"Only one stop condition allowed. There is"
968 " currently a %s stop condition defined for"
969 " this breakpoint."),
972 scm_dynwind_begin ((scm_t_dynwind_flags) 0);
980 bp_smob->
stop = newvalue;
982 return SCM_UNSPECIFIED;
997 if (
bp->commands == NULL)
1008 catch (
const gdb_exception &except)
1027 return scm_from_long (bp_smob->
bp->
type);
1038 return scm_from_bool (bp_smob->
bp->
number >= 0);
1049 return scm_from_long (bp_smob->
number);
1074 if (bp_smob == NULL)
1093 SCM predicate_result;
1096 if (bp_smob == NULL)
1162 bp_smob->
stop = SCM_BOOL_F;
1180 {
"WP_READ", hw_read },
1181 {
"WP_WRITE", hw_write },
1182 {
"WP_ACCESS", hw_access },
1191Create a GDB breakpoint object.\n\
1194 location [#:type <type>] [#:wp-class <wp-class>] [#:internal <bool>] [#:temporary <bool>]\n\
1196 <gdb:breakpoint> object" },
1198 {
"register-breakpoint!", 1, 0, 0,
1201Register a <gdb:breakpoint> object with GDB." },
1205Delete the breakpoint from GDB." },
1209Return a list of all GDB breakpoints.\n\
1215Return #t if the object is a <gdb:breakpoint> object." },
1219Return #t if the breakpoint has not been deleted from GDB." },
1223Return the breakpoint's number." },
1227Return #t if the breakpoint is a temporary breakpoint." },
1231Return the type of the breakpoint." },
1235Return #t if the breakpoint is visible to the user." },
1237 {
"breakpoint-location", 1, 0, 0,
1240Return the location of the breakpoint as specified by the user." },
1242 {
"breakpoint-expression", 1, 0, 0,
1245Return the expression of the breakpoint as specified by the user.\n\
1246Valid for watchpoints only, returns #f for non-watchpoints." },
1248 {
"breakpoint-enabled?", 1, 0, 0,
1251Return #t if the breakpoint is enabled." },
1253 {
"set-breakpoint-enabled!", 2, 0, 0,
1256Set the breakpoint's enabled state.\n\
1258 Arguments: <gdb:breakpoint> boolean" },
1262Return #t if the breakpoint is silent." },
1264 {
"set-breakpoint-silent!", 2, 0, 0,
1267Set the breakpoint's silent state.\n\
1269 Arguments: <gdb:breakpoint> boolean" },
1271 {
"breakpoint-ignore-count", 1, 0, 0,
1274Return the breakpoint's \"ignore\" count." },
1276 {
"set-breakpoint-ignore-count!", 2, 0, 0,
1279Set the breakpoint's \"ignore\" count.\n\
1281 Arguments: <gdb:breakpoint> count" },
1283 {
"breakpoint-hit-count", 1, 0, 0,
1286Return the breakpoint's \"hit\" count." },
1288 {
"set-breakpoint-hit-count!", 2, 0, 0,
1291Set the breakpoint's \"hit\" count. The value must be zero.\n\
1293 Arguments: <gdb:breakpoint> 0" },
1297Return the breakpoint's global thread id or #f if there isn't one." },
1299 {
"set-breakpoint-thread!", 2, 0, 0,
1302Set the global thread id for this breakpoint.\n\
1304 Arguments: <gdb:breakpoint> global-thread-id" },
1308Return the breakpoint's Ada task-id or #f if there isn't one." },
1310 {
"set-breakpoint-task!", 2, 0, 0,
1313Set the breakpoint's Ada task-id.\n\
1315 Arguments: <gdb:breakpoint> task-id" },
1317 {
"breakpoint-condition", 1, 0, 0,
1320Return the breakpoint's condition as specified by the user.\n\
1321Return #f if there isn't one." },
1323 {
"set-breakpoint-condition!", 2, 0, 0,
1326Set the breakpoint's condition.\n\
1328 Arguments: <gdb:breakpoint> condition\n\
1329 condition: a string" },
1333Return the breakpoint's stop predicate.\n\
1334Return #f if there isn't one." },
1336 {
"set-breakpoint-stop!", 2, 0, 0,
1339Set the breakpoint's stop predicate.\n\
1341 Arguments: <gdb:breakpoint> procedure\n\
1342 procedure: A procedure of one argument, the breakpoint.\n\
1343 Its result is true if program execution should stop." },
1345 {
"breakpoint-commands", 1, 0, 0,
1348Return the breakpoint's commands." },
static struct parser_state * pstate
struct gdbarch * get_current_arch(void)
void enable_breakpoint(struct breakpoint *bpt)
void delete_breakpoint(struct breakpoint *bpt)
void breakpoint_set_thread(struct breakpoint *b, int thread)
struct breakpoint * get_breakpoint(int num)
void watch_command_wrapper(const char *arg, int from_tty, bool internal)
void rwatch_command_wrapper(const char *arg, int from_tty, bool internal)
int create_breakpoint(struct gdbarch *gdbarch, location_spec *locspec, const char *cond_string, int thread, const char *extra_string, bool force_condition, 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)
bool is_watchpoint(const struct breakpoint *bpt)
void awatch_command_wrapper(const char *arg, int from_tty, bool internal)
struct command_line * breakpoint_commands(struct breakpoint *b)
void breakpoint_set_silent(struct breakpoint *b, int silent)
void disable_breakpoint(struct breakpoint *bpt)
void breakpoint_set_task(struct breakpoint *b, int task)
void set_ignore_count(int bptnum, int count, int from_tty)
void set_breakpoint_condition(struct breakpoint *b, const char *exp, int from_tty, bool force)
const struct breakpoint_ops * breakpoint_ops_for_location_spec(const location_spec *locspec, bool is_tracepoint)
breakpoint_range all_breakpoints()
const char * c_str() const
void print_command_lines(struct ui_out *uiout, struct command_line *cmd, unsigned int depth)
const struct extension_language_defn * get_breakpoint_cond_ext_lang(struct breakpoint *b, enum extension_language skip_lang)
const struct extension_language_defn * get_ext_lang_defn(enum extension_language lang)
const char * ext_lang_capitalized_name(const struct extension_language_defn *extlang)
int valid_global_thread_id(int global_id)
#define gdbscm_is_true(scm)
SCM gdbscm_wrap(Function &&func, Args &&... args)
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)
void gdbscm_misc_error(const char *subr, int arg_pos, SCM bad_value, const char *error) ATTRIBUTE_NORETURN
int gdbscm_is_procedure(SCM proc)
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
void gdbscm_dynwind_xfree(void *ptr)
char * gdbscm_gc_xstrdup(const char *)
void gdbscm_out_of_range_error(const char *subr, int arg_pos, SCM bad_value, const char *error) ATTRIBUTE_NORETURN
SCM gdbscm_safe_call_1(SCM proc, SCM arg0, excp_matcher_func *ok_excps)
#define gdbscm_is_false(scm)
#define gdbscm_is_bool(scm)
void gdbscm_printf(SCM port, const char *format,...) ATTRIBUTE_PRINTF(2
gdb::unique_xmalloc_ptr< char > gdbscm_scm_to_c_string(SCM string)
void gdbscm_define_integer_constants(const scheme_integer_constant *, int is_public)
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)
#define GDBSCM_HANDLE_GDB_EXCEPTION(exception)
scm_t_bits gdbscm_make_smob_type(const char *name, size_t size)
static scm_t_subr as_a_scm_t_subr(SCM(*func)(void))
SCM gdbscm_scm_from_c_string(const char *string)
const struct language_defn * current_language
location_spec_up string_to_location_spec_basic(const char **stringp, const struct language_defn *language, symbol_name_match_type match_type)
std::unique_ptr< location_spec > location_spec_up
observable< struct breakpoint * > breakpoint_created
observable< struct breakpoint * > breakpoint_deleted
static SCM bpscm_get_breakpoint_arg_unsafe(SCM self, int arg_pos, const char *func_name)
static SCM bpscm_make_breakpoint_smob(void)
static breakpoint_smob * bpscm_get_breakpoint_smob_arg_unsafe(SCM self, int arg_pos, const char *func_name)
static SCM gdbscm_breakpoint_valid_p(SCM self)
static SCM gdbscm_set_breakpoint_thread_x(SCM self, SCM newvalue)
static SCM gdbscm_breakpoint_type(SCM self)
static SCM internal_keyword
static void bpscm_breakpoint_created(struct breakpoint *bp)
static const char * bpscm_enable_state_to_string(enum enable_state enable_state)
static SCM temporary_keyword
static void bpscm_build_bp_list(struct breakpoint *bp, SCM *list)
static SCM gdbscm_breakpoint_temporary(SCM self)
enum ext_lang_bp_stop gdbscm_breakpoint_cond_says_stop(const struct extension_language_defn *extlang, struct breakpoint *b)
int gdbscm_breakpoint_has_cond(const struct extension_language_defn *extlang, struct breakpoint *b)
static int bpscm_is_breakpoint(SCM scm)
static int bpscm_want_scm_wrapper_p(struct breakpoint *bp, int from_scheme)
static SCM gdbscm_breakpoint_expression(SCM self)
static SCM gdbscm_breakpoint_thread(SCM self)
static int bpscm_print_breakpoint_smob(SCM self, SCM port, scm_print_state *pstate)
static SCM gdbscm_set_breakpoint_task_x(SCM self, SCM newvalue)
static SCM gdbscm_breakpoint_condition(SCM self)
static SCM gdbscm_set_breakpoint_ignore_count_x(SCM self, SCM newvalue)
static SCM gdbscm_breakpoint_ignore_count(SCM self)
static SCM gdbscm_make_breakpoint(SCM location_scm, SCM rest)
static SCM gdbscm_breakpoint_location(SCM self)
static void bpscm_attach_scm_to_breakpoint(struct breakpoint *bp, SCM containing_scm)
static size_t bpscm_free_breakpoint_smob(SCM self)
static SCM gdbscm_breakpoint_p(SCM scm)
static const char * bpscm_type_to_string(enum bptype type)
static const char breakpoint_smob_name[]
static breakpoint_smob * bpscm_get_valid_breakpoint_smob_arg_unsafe(SCM self, int arg_pos, const char *func_name)
static SCM gdbscm_set_breakpoint_hit_count_x(SCM self, SCM newvalue)
static SCM gdbscm_breakpoint_commands(SCM self)
static const scheme_function breakpoint_functions[]
static SCM gdbscm_breakpoint_enabled_p(SCM self)
static SCM gdbscm_breakpoint_silent_p(SCM self)
static SCM gdbscm_set_breakpoint_silent_x(SCM self, SCM newvalue)
static SCM gdbscm_set_breakpoint_condition_x(SCM self, SCM newvalue)
static SCM gdbscm_breakpoint_hit_count(SCM self)
static scm_t_bits breakpoint_smob_tag
void gdbscm_initialize_breakpoints(void)
static SCM wp_class_keyword
static int bpscm_is_valid(breakpoint_smob *bp_smob)
static SCM pending_breakpoint_scm
static SCM gdbscm_register_breakpoint_x(SCM self)
static SCM gdbscm_delete_breakpoint_x(SCM self)
static SCM gdbscm_breakpoint_visible(SCM self)
static void bpscm_breakpoint_deleted(struct breakpoint *b)
static SCM gdbscm_breakpoint_task(SCM self)
static SCM gdbscm_breakpoints(void)
static SCM gdbscm_breakpoint_stop(SCM self)
struct gdbscm_breakpoint_object breakpoint_smob
static SCM gdbscm_breakpoint_number(SCM self)
static const scheme_integer_constant breakpoint_integer_constants[]
static SCM gdbscm_set_breakpoint_stop_x(SCM self, SCM newvalue)
static SCM gdbscm_set_breakpoint_enabled_x(SCM self, SCM newvalue)
gdb::unique_xmalloc_ptr< char > cond_string
gdbscm_breakpoint_object * scm_bp_object
enum enable_state enable_state
enum target_hw_bp_type access_type
struct gdbscm_breakpoint_object::@73 spec
gdb::unique_xmalloc_ptr< char > exp_string