ranged_breakpoint: don't use init_raw_breakpoint
authorPedro Alves <pedro@palves.net>
Fri, 6 May 2022 21:21:36 +0000 (22:21 +0100)
committerPedro Alves <pedro@palves.net>
Fri, 20 May 2022 19:41:00 +0000 (20:41 +0100)
ranged_breakpoint's ctor already sets the breakpoint's type to
bp_hardware_breakpoint.

Since this is a "regular" breakpoint, b->pspace should remain NULL.

Thus, the only thing init_raw_breakpoint is needed for, is to add the
breakpoint's location.  Do that directly.

Change-Id: I1505de94c3919881c2b300437e2c0da9b05f76bd

gdb/breakpoint.c

index 8f6794511e7d735f252d73b6b399e6822488c291..f9332e1f998c2feed5d6f451318fb86937171455 100644 (file)
@@ -9439,7 +9439,7 @@ break_range_command (const char *arg, int from_tty)
 
   /* Now set up the breakpoint.  */
   std::unique_ptr<breakpoint> br (new ranged_breakpoint (get_current_arch ()));
-  init_raw_breakpoint (br.get (), sal_start, bp_hardware_breakpoint);
+  br->add_location (sal_start);
   b = add_to_breakpoint_chain (std::move (br));
 
   set_breakpoint_count (breakpoint_count + 1);