ODR warnings for "struct insn_info"
[binutils-gdb.git] / gdb / break-catch-syscall.c
index 5ed15ac8bf911fde4792662193dc84c9afa1a25a..06d48466de7466b38b0d7076167f4a38256ab91d 100644 (file)
 /* An instance of this type is used to represent a syscall
    catchpoint.  */
 
-struct syscall_catchpoint : public breakpoint
+struct syscall_catchpoint : public catchpoint
 {
-  syscall_catchpoint (struct gdbarch *gdbarch, std::vector<int> &&calls)
-    : breakpoint (gdbarch, bp_catchpoint),
+  syscall_catchpoint (struct gdbarch *gdbarch, bool tempflag,
+                     std::vector<int> &&calls)
+    : catchpoint (gdbarch, tempflag, nullptr),
       syscalls_to_be_caught (std::move (calls))
   {
   }
@@ -196,7 +197,7 @@ syscall_catchpoint::print_it (const bpstat *bs) const
      must print "called syscall" or "returned from syscall".  */
   struct target_waitstatus last;
   struct syscall s;
-  struct gdbarch *gdbarch = bs->bp_location_at->gdbarch;
+  struct gdbarch *gdbarch = b->gdbarch;
 
   get_last_target_status (nullptr, nullptr, &last);
 
@@ -241,7 +242,7 @@ syscall_catchpoint::print_one (bp_location **last_loc) const
 {
   struct value_print_options opts;
   struct ui_out *uiout = current_uiout;
-  struct gdbarch *gdbarch = loc->gdbarch;
+  struct gdbarch *gdbarch = loc->owner->gdbarch;
 
   get_user_print_options (&opts);
   /* Field 4, the address, is omitted (which makes the columns not
@@ -292,7 +293,7 @@ syscall_catchpoint::print_one (bp_location **last_loc) const
 void
 syscall_catchpoint::print_mention () const
 {
-  struct gdbarch *gdbarch = loc->gdbarch;
+  struct gdbarch *gdbarch = loc->owner->gdbarch;
 
   if (!syscalls_to_be_caught.empty ())
     {
@@ -354,8 +355,7 @@ create_syscall_event_catchpoint (int tempflag, std::vector<int> &&filter)
   struct gdbarch *gdbarch = get_current_arch ();
 
   std::unique_ptr<syscall_catchpoint> c
-    (new syscall_catchpoint (gdbarch, std::move (filter)));
-  init_catchpoint (c.get (), gdbarch, tempflag, nullptr);
+    (new syscall_catchpoint (gdbarch, tempflag, std::move (filter)));
 
   install_breakpoint (0, std::move (c), 1);
 }