[gdb/build] Fix build with gcc 4.8.5
[binutils-gdb.git] / gdb / break-catch-fork.c
index e8d613f062dcdeed026199e66295e649c87c41f1..1f8deec6a62fd1f112a96fcd848ec30c067d93a9 100644 (file)
    catchpoint.  A breakpoint is really of this type iff its ops pointer points
    to CATCH_FORK_BREAKPOINT_OPS.  */
 
-struct fork_catchpoint : public breakpoint
+struct fork_catchpoint : public catchpoint
 {
+  fork_catchpoint (struct gdbarch *gdbarch, bool temp,
+                  const char *cond_string, bool is_vfork_)
+    : catchpoint (gdbarch, temp, cond_string),
+      is_vfork (is_vfork_)
+  {
+  }
+
   int insert_location (struct bp_location *) override;
   int remove_location (struct bp_location *,
                       enum remove_bp_reason reason) override;
@@ -52,7 +59,7 @@ struct fork_catchpoint : public breakpoint
   /* Process id of a child process whose forking triggered this
      catchpoint.  This field is only valid immediately after this
      catchpoint has triggered.  */
-  ptid_t forked_inferior_pid;
+  ptid_t forked_inferior_pid = null_ptid;
 };
 
 /* Implement the "insert" method for fork catchpoints.  */
@@ -180,11 +187,8 @@ create_fork_vfork_event_catchpoint (struct gdbarch *gdbarch,
                                    bool temp, const char *cond_string,
                                    bool is_vfork)
 {
-  std::unique_ptr<fork_catchpoint> c (new fork_catchpoint ());
-
-  init_catchpoint (c.get (), gdbarch, temp, cond_string);
-  c->is_vfork = is_vfork;
-  c->forked_inferior_pid = null_ptid;
+  std::unique_ptr<fork_catchpoint> c
+    (new fork_catchpoint (gdbarch, temp, cond_string, is_vfork));
 
   install_breakpoint (0, std::move (c), 1);
 }