Enable multi-process mode in the NetBSD native target.
authorKamil Rytarowski <n54@gmx.com>
Mon, 20 Jul 2020 15:07:25 +0000 (17:07 +0200)
committerKamil Rytarowski <n54@gmx.com>
Tue, 21 Jul 2020 12:43:36 +0000 (14:43 +0200)
This enables proper support for multiple inferiors and ptrace(2)
assisted management of the inferior processes and their threads.

(gdb) info inferior
  Num  Description       Connection           Executable
* 1    process 14952     1 (native)           /usr/bin/dig
  2    <null>            1 (native)
  3    process 25684     1 (native)           /bin/ls
  4    <null>            1 (native)           /bin/ls

Without this patch, additional inferiors can be added, but not
properly controlled.

gdb/ChangeLog:

        * nbsd-nat.h (nbsd_nat_target::supports_multi_process): New
        declaration.
        * nbsd-nat.c (nbsd_nat_target::supports_multi_process): New
        function.

gdb/ChangeLog
gdb/nbsd-nat.c
gdb/nbsd-nat.h

index fad4608002f6b3abfcedc977e512f1e6b552065b..eec2d55800edd310996842c8d659318ec5593498 100644 (file)
@@ -1,3 +1,10 @@
+2020-07-21  Kamil Rytarowski  <n54@gmx.com>
+
+       * nbsd-nat.h (nbsd_nat_target::supports_multi_process): New
+       declaration.
+       * nbsd-nat.c (nbsd_nat_target::supports_multi_process): New
+       function.
+
 2020-07-20  John Baldwin  <jhb@FreeBSD.org>
 
        * fbsd-tdep.c (fbsd_skip_solib_resolver): New function.
index 254a768eb370a3116df4c3b530f6a02d4f30a738..a9405ebf862d712807cc3a68e545d8686d679e48 100644 (file)
@@ -837,3 +837,11 @@ nbsd_nat_target::set_syscall_catchpoint (int pid, bool needed,
      are filtered by GDB rather than the kernel.  */
   return 0;
 }
+
+/* Implement the "supports_multi_process" target_ops method. */
+
+bool
+nbsd_nat_target::supports_multi_process ()
+{
+  return true;
+}
index 4a8b96026e638ae3686e89b32eff1f31bb00ec22..0a7048ecf357e79a0a369373529739ad7fa0a392 100644 (file)
@@ -48,6 +48,7 @@ struct nbsd_nat_target : public inf_ptrace_target
                              gdb::array_view<const int> syscall_counts)
     override;
 
+  bool supports_multi_process () override;
 };
 
 #endif /* nbsd-nat.h */