[PATCH] Enable multi-process mode in the NetBSD native target.

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] Enable multi-process mode in the NetBSD native target.

Kamil Rytarowski
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  | 7 +++++++
 gdb/nbsd-nat.c | 8 ++++++++
 gdb/nbsd-nat.h | 1 +
 3 files changed, 16 insertions(+)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 6d231f5d943..c1a62008477 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2020-07-20  Kamil Rytarowski  <[hidden email]>
+
+ * nbsd-nat.h (nbsd_nat_target::supports_multi_process): New
+ declaration.
+ * nbsd-nat.c (nbsd_nat_target::supports_multi_process): New
+ function.
+
 2020-07-18  Tom Tromey  <[hidden email]>

  * linux-nat.c (linux_multi_process): Remove.
diff --git a/gdb/nbsd-nat.c b/gdb/nbsd-nat.c
index 254a768eb37..e2725e01f68 100644
--- a/gdb/nbsd-nat.c
+++ b/gdb/nbsd-nat.c
@@ -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 "set_syscall_catchpoint" target_ops method. */
+
+bool
+nbsd_nat_target::supports_multi_process ()
+{
+  return true;
+}
diff --git a/gdb/nbsd-nat.h b/gdb/nbsd-nat.h
index 4a8b96026e6..0a7048ecf35 100644
--- a/gdb/nbsd-nat.h
+++ b/gdb/nbsd-nat.h
@@ -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 */
--
2.26.2

Reply | Threaded
Open this post in threaded view
|

[PATCH v2] Enable multi-process mode in the NetBSD native target.

Kamil Rytarowski
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  | 7 +++++++
 gdb/nbsd-nat.c | 8 ++++++++
 gdb/nbsd-nat.h | 1 +
 3 files changed, 16 insertions(+)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 6d231f5d943..c1a62008477 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2020-07-20  Kamil Rytarowski  <[hidden email]>
+
+ * nbsd-nat.h (nbsd_nat_target::supports_multi_process): New
+ declaration.
+ * nbsd-nat.c (nbsd_nat_target::supports_multi_process): New
+ function.
+
 2020-07-18  Tom Tromey  <[hidden email]>

  * linux-nat.c (linux_multi_process): Remove.
diff --git a/gdb/nbsd-nat.c b/gdb/nbsd-nat.c
index 254a768eb37..e2725e01f68 100644
--- a/gdb/nbsd-nat.c
+++ b/gdb/nbsd-nat.c
@@ -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 "set_syscall_catchpoint" target_ops method. */
+
+bool
+nbsd_nat_target::supports_multi_process ()
+{
+  return true;
+}
diff --git a/gdb/nbsd-nat.h b/gdb/nbsd-nat.h
index 4a8b96026e6..0a7048ecf35 100644
--- a/gdb/nbsd-nat.h
+++ b/gdb/nbsd-nat.h
@@ -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 */
--
2.26.2

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v2] Enable multi-process mode in the NetBSD native target.

Simon Marchi-4
On 2020-07-20 8:21 p.m., Kamil Rytarowski wrote:

> 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.

Thanks for the commit message, this is OK.

Simon

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v2] Enable multi-process mode in the NetBSD native target.

Pedro Alves-2
In reply to this post by Kamil Rytarowski
On 7/21/20 1:21 AM, Kamil Rytarowski wrote:
> +/* Implement the "set_syscall_catchpoint" target_ops method. */

Wrong method mentioned here.

> +
> +bool
> +nbsd_nat_target::supports_multi_process ()
> +{
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH v2] Enable multi-process mode in the NetBSD native target.

Kamil Rytarowski-2
On 21.07.2020 12:51, Pedro Alves wrote:
> On 7/21/20 1:21 AM, Kamil Rytarowski wrote:
>> +/* Implement the "set_syscall_catchpoint" target_ops method. */
>
> Wrong method mentioned here.
>

Fixed and the commit was merged.

>> +
>> +bool
>> +nbsd_nat_target::supports_multi_process ()
>> +{



signature.asc (849 bytes) Download Attachment