From patchwork Fri Jul 24 19:31:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 7841 Received: (qmail 24436 invoked by alias); 24 Jul 2015 19:31:55 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 24422 invoked by uid 89); 24 Jul 2015 19:31:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 24 Jul 2015 19:31:54 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id DA6278E934 for ; Fri, 24 Jul 2015 19:31:52 +0000 (UTC) Received: from brno.lan (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t6OJVpF4027515 for ; Fri, 24 Jul 2015 15:31:52 -0400 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [pushed] Fix s390 GNU/Linux build after enum __ptrace_request changes Date: Fri, 24 Jul 2015 20:31:51 +0100 Message-Id: <1437766311-2201-1-git-send-email-palves@redhat.com> The buildbot noticed that the enum __ptrace_request series broke the s390 GNU/Linux build: ../../binutils-gdb/gdb/s390-linux-nat.c: In function 'fetch_regs': ../../binutils-gdb/gdb/s390-linux-nat.c:226:54: error: macro "ptrace" requires 4 arguments, but only 3 given if (ptrace (PTRACE_PEEKUSR_AREA, tid, (long) &parea) < 0) ^ ../../binutils-gdb/gdb/s390-linux-nat.c: In function 'store_regs': ../../binutils-gdb/gdb/s390-linux-nat.c:243:54: error: macro "ptrace" requires 4 arguments, but only 3 given if (ptrace (PTRACE_PEEKUSR_AREA, tid, (long) &parea) < 0) ^ Fix this the same way it's handled everywhere else -- just pass 0 as forth argument, which also handles non-varargs ptrace prototypes in non-glibc libcs, e.g., Bionic (if it ever gets a s390 port...). gdb/ChangeLog: 2015-07-24 Pedro Alves * s390-linux-nat.c (fetch_regs, store_regs, fetch_fpregs) (s390_stopped_by_watchpoint, s390_prepare_to_resume): Pass 0 as forth argument to ptrace PTRACE_PEEKUSR_AREA/PTRACE_POKEUSR_AREA. --- gdb/ChangeLog | 6 ++++++ gdb/s390-linux-nat.c | 20 ++++++++++---------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b781698..0061bff 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2015-07-24 Pedro Alves + * s390-linux-nat.c (fetch_regs, store_regs, fetch_fpregs) + (s390_stopped_by_watchpoint, s390_prepare_to_resume): Pass 0 as + forth argument to ptrace PTRACE_PEEKUSR_AREA/PTRACE_POKEUSR_AREA. + +2015-07-24 Pedro Alves + PR gdb/18717 * linux-nat.c (linux_nat_filter_event): Don't assert that the lwp is resumed, and extend the debug log. diff --git a/gdb/s390-linux-nat.c b/gdb/s390-linux-nat.c index 94edce8..360d761 100644 --- a/gdb/s390-linux-nat.c +++ b/gdb/s390-linux-nat.c @@ -223,7 +223,7 @@ fetch_regs (struct regcache *regcache, int tid) parea.len = sizeof (regs); parea.process_addr = (addr_t) ®s; parea.kernel_addr = offsetof (struct user_regs_struct, psw); - if (ptrace (PTRACE_PEEKUSR_AREA, tid, (long) &parea) < 0) + if (ptrace (PTRACE_PEEKUSR_AREA, tid, (long) &parea, 0) < 0) perror_with_name (_("Couldn't get registers")); supply_gregset (regcache, (const gregset_t *) ®s); @@ -240,12 +240,12 @@ store_regs (const struct regcache *regcache, int tid, int regnum) parea.len = sizeof (regs); parea.process_addr = (addr_t) ®s; parea.kernel_addr = offsetof (struct user_regs_struct, psw); - if (ptrace (PTRACE_PEEKUSR_AREA, tid, (long) &parea) < 0) + if (ptrace (PTRACE_PEEKUSR_AREA, tid, (long) &parea, 0) < 0) perror_with_name (_("Couldn't get registers")); fill_gregset (regcache, ®s, regnum); - if (ptrace (PTRACE_POKEUSR_AREA, tid, (long) &parea) < 0) + if (ptrace (PTRACE_POKEUSR_AREA, tid, (long) &parea, 0) < 0) perror_with_name (_("Couldn't write registers")); } @@ -260,7 +260,7 @@ fetch_fpregs (struct regcache *regcache, int tid) parea.len = sizeof (fpregs); parea.process_addr = (addr_t) &fpregs; parea.kernel_addr = offsetof (struct user_regs_struct, fp_regs); - if (ptrace (PTRACE_PEEKUSR_AREA, tid, (long) &parea) < 0) + if (ptrace (PTRACE_PEEKUSR_AREA, tid, (long) &parea, 0) < 0) perror_with_name (_("Couldn't get floating point status")); supply_fpregset (regcache, (const fpregset_t *) &fpregs); @@ -277,12 +277,12 @@ store_fpregs (const struct regcache *regcache, int tid, int regnum) parea.len = sizeof (fpregs); parea.process_addr = (addr_t) &fpregs; parea.kernel_addr = offsetof (struct user_regs_struct, fp_regs); - if (ptrace (PTRACE_PEEKUSR_AREA, tid, (long) &parea) < 0) + if (ptrace (PTRACE_PEEKUSR_AREA, tid, (long) &parea, 0) < 0) perror_with_name (_("Couldn't get floating point status")); fill_fpregset (regcache, &fpregs, regnum); - if (ptrace (PTRACE_POKEUSR_AREA, tid, (long) &parea) < 0) + if (ptrace (PTRACE_POKEUSR_AREA, tid, (long) &parea, 0) < 0) perror_with_name (_("Couldn't write floating point status")); } @@ -459,7 +459,7 @@ s390_stopped_by_watchpoint (struct target_ops *ops) parea.len = sizeof (per_lowcore); parea.process_addr = (addr_t) & per_lowcore; parea.kernel_addr = offsetof (struct user_regs_struct, per_info.lowcore); - if (ptrace (PTRACE_PEEKUSR_AREA, s390_inferior_tid (), &parea) < 0) + if (ptrace (PTRACE_PEEKUSR_AREA, s390_inferior_tid (), &parea, 0) < 0) perror_with_name (_("Couldn't retrieve watchpoint status")); result = (per_lowcore.perc_storage_alteration == 1 @@ -469,7 +469,7 @@ s390_stopped_by_watchpoint (struct target_ops *ops) { /* Do not report this watchpoint again. */ memset (&per_lowcore, 0, sizeof (per_lowcore)); - if (ptrace (PTRACE_POKEUSR_AREA, s390_inferior_tid (), &parea) < 0) + if (ptrace (PTRACE_POKEUSR_AREA, s390_inferior_tid (), &parea, 0) < 0) perror_with_name (_("Couldn't clear watchpoint status")); } @@ -508,7 +508,7 @@ s390_prepare_to_resume (struct lwp_info *lp) parea.len = sizeof (per_info); parea.process_addr = (addr_t) & per_info; parea.kernel_addr = offsetof (struct user_regs_struct, per_info); - if (ptrace (PTRACE_PEEKUSR_AREA, tid, &parea) < 0) + if (ptrace (PTRACE_PEEKUSR_AREA, tid, &parea, 0) < 0) perror_with_name (_("Couldn't retrieve watchpoint status")); if (watch_base) @@ -524,7 +524,7 @@ s390_prepare_to_resume (struct lwp_info *lp) per_info.starting_addr = watch_lo_addr; per_info.ending_addr = watch_hi_addr; - if (ptrace (PTRACE_POKEUSR_AREA, tid, &parea) < 0) + if (ptrace (PTRACE_POKEUSR_AREA, tid, &parea, 0) < 0) perror_with_name (_("Couldn't modify watchpoint status")); }