From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28534 invoked by alias); 29 Mar 2012 21:29:21 -0000 Received: (qmail 28522 invoked by uid 22791); 29 Mar 2012 21:29:20 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 29 Mar 2012 21:29:03 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q2TLT1LK031785 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 29 Mar 2012 17:29:01 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q2TLSxKV028701; Thu, 29 Mar 2012 17:29:00 -0400 Message-ID: <4F74D41B.7010107@redhat.com> Date: Thu, 29 Mar 2012 21:29:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120316 Thunderbird/11.0 MIME-Version: 1.0 To: gdb-patches@sourceware.org CC: "H.J. Lu" , Thiago Jung Bauermann , Mark Kettenis Subject: Re: sparc gdbserver bug? (Re: [RFA] handle android bionic ptrace in gdbserver.) References: <1332802002.30339.16.camel@hactar> <201203271611.q2RGBs2N025666@glazunov.sibelius.xs4all.nl> <1332894408.16415.14.camel@hactar> <4F749597.6000600@redhat.com> <4F74AED8.4020404@redhat.com> In-Reply-To: <4F74AED8.4020404@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-03/txt/msg01020.txt.bz2 On 03/29/2012 07:50 PM, Pedro Alves wrote: > On 03/29/2012 06:22 PM, H.J. Lu wrote: > >> > On Thu, Mar 29, 2012 at 10:02 AM, Pedro Alves wrote: > >>> >> #ifndef __sparc__ >>> >> - res = ptrace (regset->get_request, pid, 0, buf); >>> >> + res = ptrace (regset->get_request, pid, nt_type, data); >>> >> #else >>> >> - res = ptrace (regset->get_request, pid, buf, 0); >>> >> + res = ptrace (regset->get_request, pid, &iov, data); >>> >> #endif >>> >> >>> >> I think that should have ended up with: >>> >> >>> >> #ifndef __sparc__ >>> >> res = ptrace (regset->get_request, pid, nt_type, data); >>> >> #else >>> >> res = ptrace (regset->get_request, pid, data, nt_type); >>> >> #endif >>> >> >> > >> > It may be a typo for sparc branch. > > Thanks. I found a sparc-linux machine on the gcc compile farm, > and since I'm already making changes that affect all gdbserver > ports, I'll eventually run into it and fix it. Indeed, gdbserver crashes on SPARC due to that. I've applied the obvious fix below. 2012-03-29 Pedro Alves * linux-low.c (regsets_store_inferior_registers) [__sparc__]: Correct ptrace arguments. Index: src/gdb/gdbserver/linux-low.c =================================================================== --- src.orig/gdb/gdbserver/linux-low.c +++ src/gdb/gdbserver/linux-low.c @@ -4036,7 +4036,7 @@ regsets_store_inferior_registers (struct #ifndef __sparc__ res = ptrace (regset->get_request, pid, nt_type, data); #else - res = ptrace (regset->get_request, pid, &iov, data); + res = ptrace (regset->get_request, pid, data, nt_type); #endif if (res == 0)