Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Update the return type of gdb_ptrace to be more flexible
@ 2020-03-20 14:47 Kamil Rytarowski
  2020-03-20 14:49 ` Simon Marchi
  0 siblings, 1 reply; 2+ messages in thread
From: Kamil Rytarowski @ 2020-03-20 14:47 UTC (permalink / raw)
  To: gdb-patches; +Cc: simark, Kamil Rytarowski

Linux returns long from ptrace(2) and BSDs int.

gdb/ChangeLog:

       * amd64-bsd-nat.c (gdb_ptrace): Change return type from `int' to
       `PTRACE_TYPE_RET'.
       * i386-bsd-nat.c (gdb_ptrace): Likewise.
       * sparc-nat.c (gdb_ptrace): Likewise.
       * x86-bsd-nat.c (gdb_ptrace): Likewise.
---
 gdb/ChangeLog       | 8 ++++++++
 gdb/amd64-bsd-nat.c | 2 +-
 gdb/i386-bsd-nat.c  | 2 +-
 gdb/sparc-nat.c     | 2 +-
 gdb/x86-bsd-nat.c   | 2 +-
 5 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 3a16003d9d6..9853e97a472 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
+2020-03-20  Kamil Rytarowski  <n54@gmx.com>
+
+	* amd64-bsd-nat.c (gdb_ptrace): Change return type from `int' to
+	`PTRACE_TYPE_RET'.
+	* i386-bsd-nat.c (gdb_ptrace): Likewise.
+	* sparc-nat.c (gdb_ptrace): Likewise.
+	* x86-bsd-nat.c (gdb_ptrace): Likewise.
+
 2020-03-20  Tom Tromey  <tromey@adacore.com>

 	* ada-valprint.c (print_variant_part): Remove parameters; switch
diff --git a/gdb/amd64-bsd-nat.c b/gdb/amd64-bsd-nat.c
index 1ff044ff470..04322c70378 100644
--- a/gdb/amd64-bsd-nat.c
+++ b/gdb/amd64-bsd-nat.c
@@ -36,7 +36,7 @@
 #include "amd64-bsd-nat.h"
 \f

-static int
+static PTRACE_TYPE_RET
 gdb_ptrace (PTRACE_TYPE_ARG1 request, ptid_t ptid, PTRACE_TYPE_ARG3 addr,
 	    PTRACE_TYPE_ARG4 data)
 {
diff --git a/gdb/i386-bsd-nat.c b/gdb/i386-bsd-nat.c
index 3250dab737f..4e8693246c8 100644
--- a/gdb/i386-bsd-nat.c
+++ b/gdb/i386-bsd-nat.c
@@ -34,7 +34,7 @@
 #include "inf-ptrace.h"
 \f

-static int
+static PTRACE_TYPE_RET
 gdb_ptrace (PTRACE_TYPE_ARG1 request, ptid_t ptid, PTRACE_TYPE_ARG3 addr,
 	    PTRACE_TYPE_ARG4 data)
 {
diff --git a/gdb/sparc-nat.c b/gdb/sparc-nat.c
index fadcfd34474..8d5bf350bdb 100644
--- a/gdb/sparc-nat.c
+++ b/gdb/sparc-nat.c
@@ -78,7 +78,7 @@ typedef struct fp_status fpregset_t;
 #define PTRACE_SETFPREGS PT_SETFPREGS
 #endif

-static int
+static PTRACE_TYPE_RET
 gdb_ptrace (PTRACE_TYPE_ARG1 request, ptid_t ptid, PTRACE_TYPE_ARG3 addr)
 {
 #ifdef __NetBSD__
diff --git a/gdb/x86-bsd-nat.c b/gdb/x86-bsd-nat.c
index 9e2bea1e020..e2ebf5f2e50 100644
--- a/gdb/x86-bsd-nat.c
+++ b/gdb/x86-bsd-nat.c
@@ -33,7 +33,7 @@
 #include "inf-ptrace.h"
 \f

-static int
+static PTRACE_TYPE_RET
 gdb_ptrace (PTRACE_TYPE_ARG1 request, ptid_t ptid, PTRACE_TYPE_ARG3 addr)
 {
 #ifdef __NetBSD__
--
2.25.0



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Update the return type of gdb_ptrace to be more flexible
  2020-03-20 14:47 [PATCH] Update the return type of gdb_ptrace to be more flexible Kamil Rytarowski
@ 2020-03-20 14:49 ` Simon Marchi
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Marchi @ 2020-03-20 14:49 UTC (permalink / raw)
  To: Kamil Rytarowski, gdb-patches

On 2020-03-20 10:47 a.m., Kamil Rytarowski wrote:
> Linux returns long from ptrace(2) and BSDs int.
> 
> gdb/ChangeLog:
> 
>        * amd64-bsd-nat.c (gdb_ptrace): Change return type from `int' to
>        `PTRACE_TYPE_RET'.
>        * i386-bsd-nat.c (gdb_ptrace): Likewise.
>        * sparc-nat.c (gdb_ptrace): Likewise.
>        * x86-bsd-nat.c (gdb_ptrace): Likewise.

Thanks, this is ok.

Simon



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-20 14:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-20 14:47 [PATCH] Update the return type of gdb_ptrace to be more flexible Kamil Rytarowski
2020-03-20 14:49 ` Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox