gdb: add inferior-specific breakpoints
[binutils-gdb.git] / gdb / guile / scm-breakpoint.c
index 2931df265d74293e127da4a0cc9c33d9fc0dfd9c..59254646bcc4415f8f380e1d1ac256917c90e352 100644 (file)
@@ -465,7 +465,7 @@ gdbscm_register_breakpoint_x (SCM self)
            const breakpoint_ops *ops =
              breakpoint_ops_for_location_spec (locspec.get (), false);
            create_breakpoint (get_current_arch (),
-                              locspec.get (), NULL, -1, NULL, false,
+                              locspec.get (), NULL, -1, -1, NULL, false,
                               0,
                               temporary, bp_breakpoint,
                               0,
@@ -569,8 +569,8 @@ gdbscm_breakpoints (void)
 {
   SCM list = SCM_EOL;
 
-  for (breakpoint *bp : all_breakpoints ())
-    bpscm_build_bp_list (bp, &list);
+  for (breakpoint &bp : all_breakpoints ())
+    bpscm_build_bp_list (&bp, &list);
 
   return scm_reverse_x (list, SCM_EOL);
 }
@@ -784,6 +784,11 @@ gdbscm_set_breakpoint_thread_x (SCM self, SCM newvalue)
   else
     SCM_ASSERT_TYPE (0, newvalue, SCM_ARG2, FUNC_NAME, _("integer or #f"));
 
+  if (bp_smob->bp->inferior != -1 && id != -1)
+    scm_misc_error (FUNC_NAME,
+                   _("Cannot have both 'thread' and 'inferior' "
+                     "conditions on a breakpoint"), SCM_EOL);
+
   breakpoint_set_thread (bp_smob->bp, id);
 
   return SCM_UNSPECIFIED;