Sync config.sub,config.guess with upstream.
[deliverable/binutils-gdb.git] / gdb / breakpoint.c
index 32d6a9509b5d7809e45ea1f2f2d474a0f28211ff..3908dabffecdbc375dfdfbeeb298a89e943a838b 100644 (file)
@@ -2603,6 +2603,28 @@ build_target_command_list (struct bp_location *bl)
     bl->target_info.persist = 1;
 }
 
+/* Return the kind of breakpoint on address *ADDR.  Get the kind
+   of breakpoint according to ADDR except single-step breakpoint.
+   Get the kind of single-step breakpoint according to the current
+   registers state.  */
+
+static int
+breakpoint_kind (struct bp_location *bl, CORE_ADDR *addr)
+{
+  if (bl->owner->type == bp_single_step)
+    {
+      struct thread_info *thr = find_thread_global_id (bl->owner->thread);
+      struct regcache *regcache;
+
+      regcache = get_thread_regcache (thr->ptid);
+
+      return gdbarch_breakpoint_kind_from_current_state (bl->gdbarch,
+                                                        regcache, addr);
+    }
+  else
+    return gdbarch_breakpoint_kind_from_pc (bl->gdbarch, addr);
+}
+
 /* Insert a low-level "breakpoint" of some type.  BL is the breakpoint
    location.  Any error messages are printed to TMP_ERROR_STREAM; and
    DISABLED_BREAKS, and HW_BREAKPOINT_ERROR are used to report problems.
@@ -2762,6 +2784,9 @@ insert_bp_location (struct bp_location *bl,
                    {
                      int val;
 
+                     bl->overlay_target_info.kind
+                       = breakpoint_kind (bl, &addr);
+                     bl->overlay_target_info.placed_address = addr;
                      val = target_insert_breakpoint (bl->gdbarch,
                                                      &bl->overlay_target_info);
                      if (val)
@@ -5238,8 +5263,6 @@ watchpoint_check (void *p)
     }
   else
     {
-      struct switch_thru_all_uis state;
-
       /* This seems like the only logical thing to do because
          if we temporarily ignored the watchpoint, then when
          we reenter the block in which it is valid it contains
@@ -5254,7 +5277,7 @@ watchpoint_check (void *p)
         already.  So we have no choice but print the information
         here.  */
 
-      SWITCH_THRU_ALL_UIS (state)
+      SWITCH_THRU_ALL_UIS ()
         {
          struct ui_out *uiout = current_uiout;
 
@@ -5435,9 +5458,7 @@ bpstat_check_watchpoint (bpstat bs)
            case 0:
              /* Error from catch_errors.  */
              {
-               struct switch_thru_all_uis state;
-
-               SWITCH_THRU_ALL_UIS (state)
+               SWITCH_THRU_ALL_UIS ()
                  {
                    printf_filtered (_("Watchpoint %d deleted.\n"),
                                     b->base.number);
@@ -13117,6 +13138,11 @@ bkpt_re_set (struct breakpoint *b)
 static int
 bkpt_insert_location (struct bp_location *bl)
 {
+  CORE_ADDR addr = bl->target_info.reqstd_address;
+
+  bl->target_info.kind = breakpoint_kind (bl, &addr);
+  bl->target_info.placed_address = addr;
+
   if (bl->loc_type == bp_loc_hardware_breakpoint)
     return target_insert_hw_breakpoint (bl->gdbarch, &bl->target_info);
   else
This page took 0.028341 seconds and 4 git commands to generate.