From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2023) id D342D385F024; Fri, 20 Mar 2020 14:51:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D342D385F024 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Kamil Rytarowski To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Update the return type of gdb_ptrace to be more flexible X-Act-Checkin: binutils-gdb X-Git-Author: Kamil Rytarowski X-Git-Refname: refs/heads/master X-Git-Oldrev: f7d4f0b1b9519fa10eb04cb195bdf7b5044d73c7 X-Git-Newrev: 1ff700c202465275d1ca3aee4dd979db36274294 Message-Id: <20200320145142.D342D385F024@sourceware.org> Date: Fri, 20 Mar 2020 14:51:42 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Mar 2020 14:51:42 -0000 https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1ff700c202465275d1ca3aee4dd979db36274294 commit 1ff700c202465275d1ca3aee4dd979db36274294 Author: Kamil Rytarowski Date: Fri Mar 20 15:37:18 2020 +0100 Update the return type of gdb_ptrace to be more flexible 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. Diff: --- 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 1be14b15d18..650b74bae4a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2020-03-20 Kamil Rytarowski + + * 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 * c-exp.y (lex_one_token): Fix assert. 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" -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" -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" -static int +static PTRACE_TYPE_RET gdb_ptrace (PTRACE_TYPE_ARG1 request, ptid_t ptid, PTRACE_TYPE_ARG3 addr) { #ifdef __NetBSD__