Define supports_dumpcore and dumpcore for NetBSD, that wraps
the ptrace(2) call with the PT_DUMPCORE operation.
gdb/ChangeLog:
* nbsd-nat.h (nbsd_nat_target::supports_dumpcore)
(nbsd_nat_target::dumpcore): New declarations.
* nbsd-nat.c (nbsd_nat_target::supports_dumpcore)
(nbsd_nat_target::dumpcore): New functions.
len, xfered_len);
}
}
+
+/* Implement the "supports_dumpcore" target_ops method. */
+
+bool
+nbsd_nat_target::supports_dumpcore ()
+{
+ return true;
+}
+
+/* Implement the "dumpcore" target_ops method. */
+
+void
+nbsd_nat_target::dumpcore (const char *filename)
+{
+ pid_t pid = inferior_ptid.pid ();
+
+ if (ptrace (PT_DUMPCORE, pid, const_cast<char *>(filename),
+ strlen (filename)) == -1)
+ perror_with_name (("ptrace"));
+}
const gdb_byte *writebuf,
ULONGEST offset, ULONGEST len,
ULONGEST *xfered_len) override;
+ bool supports_dumpcore () override;
+ void dumpcore (const char *filename) override;
};
#endif /* nbsd-nat.h */