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, -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"));
777 if (bp_smob->
bp->
task != -1)
779 _(
"cannot set both task and thread attributes"),
785 SCM_ASSERT_TYPE (0, newvalue, SCM_ARG2,
FUNC_NAME, _(
"integer or #f"));
789 _(
"Cannot have both 'thread' and 'inferior' "
790 "conditions on a breakpoint"), SCM_EOL);
794 return SCM_UNSPECIFIED;
805 if (bp_smob->
bp->
task == -1)
808 return scm_from_long (bp_smob->
bp->
task);
821 if (scm_is_signed_integer (newvalue, LONG_MIN, LONG_MAX))
823 id = scm_to_long (newvalue);
830 catch (
const gdb_exception &except)
839 _(
"invalid task id"));
844 _(
"cannot set both task and thread attributes"),
850 SCM_ASSERT_TYPE (0, newvalue, SCM_ARG2,
FUNC_NAME, _(
"integer or #f"));
857 catch (
const gdb_exception &except)
863 return SCM_UNSPECIFIED;
877 const char *str = bp_smob->
bp->
locspec->to_string ();
897 watchpoint *wp = gdb::checked_static_cast<watchpoint *> (bp_smob->
bp);
931 SCM_ASSERT_TYPE (scm_is_string (newvalue) ||
gdbscm_is_false (newvalue),
937 gdb::unique_xmalloc_ptr<char> exp
944 return SCM_UNSPECIFIED;
956 return bp_smob->
stop;
972 _(
"procedure or #f"));
981 = xstrprintf (_(
"Only one stop condition allowed. There is"
982 " currently a %s stop condition defined for"
983 " this breakpoint."),
986 scm_dynwind_begin ((scm_t_dynwind_flags) 0);
994 bp_smob->
stop = newvalue;
996 return SCM_UNSPECIFIED;
1011 if (
bp->commands == NULL)
1022 catch (
const gdb_exception &except)
1041 return scm_from_long (bp_smob->
bp->
type);
1052 return scm_from_bool (bp_smob->
bp->
number >= 0);
1063 return scm_from_long (bp_smob->
number);
1088 if (bp_smob == NULL)
1107 SCM predicate_result;
1110 if (bp_smob == NULL)
1176 bp_smob->
stop = SCM_BOOL_F;
1194 {
"WP_READ", hw_read },
1195 {
"WP_WRITE", hw_write },
1196 {
"WP_ACCESS", hw_access },
1205Create a GDB breakpoint object.\n\
1208 location [#:type <type>] [#:wp-class <wp-class>] [#:internal <bool>] [#:temporary <bool>]\n\
1210 <gdb:breakpoint> object" },
1212 {
"register-breakpoint!", 1, 0, 0,
1215Register a <gdb:breakpoint> object with GDB." },
1219Delete the breakpoint from GDB." },
1223Return a list of all GDB breakpoints.\n\
1229Return #t if the object is a <gdb:breakpoint> object." },
1233Return #t if the breakpoint has not been deleted from GDB." },
1237Return the breakpoint's number." },
1241Return #t if the breakpoint is a temporary breakpoint." },
1245Return the type of the breakpoint." },
1249Return #t if the breakpoint is visible to the user." },
1251 {
"breakpoint-location", 1, 0, 0,
1254Return the location of the breakpoint as specified by the user." },
1256 {
"breakpoint-expression", 1, 0, 0,
1259Return the expression of the breakpoint as specified by the user.\n\
1260Valid for watchpoints only, returns #f for non-watchpoints." },
1262 {
"breakpoint-enabled?", 1, 0, 0,
1265Return #t if the breakpoint is enabled." },
1267 {
"set-breakpoint-enabled!", 2, 0, 0,
1270Set the breakpoint's enabled state.\n\
1272 Arguments: <gdb:breakpoint> boolean" },
1276Return #t if the breakpoint is silent." },
1278 {
"set-breakpoint-silent!", 2, 0, 0,
1281Set the breakpoint's silent state.\n\
1283 Arguments: <gdb:breakpoint> boolean" },
1285 {
"breakpoint-ignore-count", 1, 0, 0,
1288Return the breakpoint's \"ignore\" count." },
1290 {
"set-breakpoint-ignore-count!", 2, 0, 0,
1293Set the breakpoint's \"ignore\" count.\n\
1295 Arguments: <gdb:breakpoint> count" },
1297 {
"breakpoint-hit-count", 1, 0, 0,
1300Return the breakpoint's \"hit\" count." },
1302 {
"set-breakpoint-hit-count!", 2, 0, 0,
1305Set the breakpoint's \"hit\" count. The value must be zero.\n\
1307 Arguments: <gdb:breakpoint> 0" },
1311Return the breakpoint's global thread id or #f if there isn't one." },
1313 {
"set-breakpoint-thread!", 2, 0, 0,
1316Set the global thread id for this breakpoint.\n\
1318 Arguments: <gdb:breakpoint> global-thread-id" },
1322Return the breakpoint's Ada task-id or #f if there isn't one." },
1324 {
"set-breakpoint-task!", 2, 0, 0,
1327Set the breakpoint's Ada task-id.\n\
1329 Arguments: <gdb:breakpoint> task-id" },
1331 {
"breakpoint-condition", 1, 0, 0,
1334Return the breakpoint's condition as specified by the user.\n\
1335Return #f if there isn't one." },
1337 {
"set-breakpoint-condition!", 2, 0, 0,
1340Set the breakpoint's condition.\n\
1342 Arguments: <gdb:breakpoint> condition\n\
1343 condition: a string" },
1347Return the breakpoint's stop predicate.\n\
1348Return #f if there isn't one." },
1350 {
"set-breakpoint-stop!", 2, 0, 0,
1353Set the breakpoint's stop predicate.\n\
1355 Arguments: <gdb:breakpoint> procedure\n\
1356 procedure: A procedure of one argument, the breakpoint.\n\
1357 Its result is true if program execution should stop." },
1359 {
"breakpoint-commands", 1, 0, 0,
1362Return 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, int inferior, 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::@76 spec
gdb::unique_xmalloc_ptr< char > exp_string