+2021-05-06 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * guile/scm-breakpoint.c (bpscm_print_breakpoint_smob): Only print
+ breakpoint locations when the breakpoint actually has a location.
+
2021-05-06 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
* mi/mi-cmd-break.c (mi_cmd_break_condition): New function.
/* Careful, the breakpoint may be invalid. */
if (b != NULL)
{
- const char *str;
-
gdbscm_printf (port, " %s %s %s",
bpscm_type_to_string (b->type),
bpscm_enable_state_to_string (b->enable_state),
gdbscm_printf (port, " hit:%d", b->hit_count);
gdbscm_printf (port, " ignore:%d", b->ignore_count);
- str = event_location_to_string (b->location.get ());
- if (str != NULL)
- gdbscm_printf (port, " @%s", str);
+ if (b->location != nullptr)
+ {
+ const char *str = event_location_to_string (b->location.get ());
+ if (str != nullptr)
+ gdbscm_printf (port, " @%s", str);
+ }
}
scm_puts (">", port);
+2021-05-06 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * gdb.guile/scm-breakpoint.exp (test_watchpoints): Print the
+ watchpoint object before and after registering it with GDB.
+
2021-05-06 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb.guile/scm-breakpoint.exp (test_bkpt_basic): Convert to
gdb_scm_test_silent_cmd "guile (define wp1 (make-breakpoint \"result\" #:type BP_WATCHPOINT #:wp-class WP_WRITE))" \
"create watchpoint"
+ gdb_test "guile (display wp1) (newline)" "#<gdb:breakpoint #-1>" \
+ "print watchpoint before registering"
gdb_scm_test_silent_cmd "guile (register-breakpoint! wp1)" \
"register wp1"
+ gdb_test "guile (display wp1) (newline)" \
+ "#<gdb:breakpoint #${decimal} BP_(?:HARDWARE_)?WATCHPOINT enabled noisy hit:0 ignore:0>" \
+ "print watchpoint after registering"
gdb_test "continue" \
".*\[Ww\]atchpoint.*result.*Old value = 0.*New value = 25.*main.*" \
"test watchpoint write"