From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7161 invoked by alias); 7 Aug 2013 11:45:30 -0000 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 Received: (qmail 7152 invoked by uid 89); 7 Aug 2013 11:45:30 -0000 X-Spam-SWARE-Status: No, score=-4.1 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_MED,RDNS_NONE,SPF_PASS autolearn=ham version=3.3.1 Received: from Unknown (HELO e28smtp09.in.ibm.com) (122.248.162.9) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 07 Aug 2013 11:44:58 +0000 Received: from /spool/local by e28smtp09.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 7 Aug 2013 17:09:15 +0530 Received: from d28dlp01.in.ibm.com (9.184.220.126) by e28smtp09.in.ibm.com (192.168.1.139) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 7 Aug 2013 17:09:13 +0530 Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id 2ECAFE004F for ; Wed, 7 Aug 2013 17:15:02 +0530 (IST) Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay05.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r77BihMq40566830 for ; Wed, 7 Aug 2013 17:14:44 +0530 Received: from d28av04.in.ibm.com (localhost [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r77BikmW003044 for ; Wed, 7 Aug 2013 17:14:46 +0530 Received: from d23ml188.in.ibm.com (d23ml188.in.ibm.com [9.182.8.144]) by d28av04.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id r77BikD2003034; Wed, 7 Aug 2013 17:14:46 +0530 In-Reply-To: <201308071137.r77BbZ4G010318@glazunov.sibelius.xs4all.nl> References: <201308011328.r71DS4Da001305@glazunov.sibelius.xs4all.nl> <201308071137.r77BbZ4G010318@glazunov.sibelius.xs4all.nl> Subject: Re: [PATCH 5/5] make calls to ptrace64 in aix-thread.c when defined X-KeepSent: B021585B:3F2B84D1-65257BC0:00400755; type=4; name=$KeepSent To: Mark Kettenis , Ulrich Weigand Cc: gdb-patches@sourceware.org, tromey@redhat.com Message-ID: From: Raunaq 12 Date: Wed, 07 Aug 2013 11:45:00 -0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13080711-2674-0000-0000-00000A242DA8 X-SW-Source: 2013-08/txt/msg00191.txt.bz2 Mark Kettenis wrote on 08/07/2013 05:07:35 PM: > From: Mark Kettenis > To: Raunaq 12/India/IBM@IBMIN > Cc: gdb-patches@sourceware.org, tromey@redhat.com > Date: 08/07/2013 05:06 PM > Subject: Re: [PATCH 5/5] make calls to ptrace64 in aix-thread.c when defined > > > From: Raunaq 12 > > Date: Wed, 7 Aug 2013 16:57:50 +0530 > > > > > ChangeLog :- > > > * aixthread.c: call ptrace64 instead of ptracex if defined > > > Call ptrace64 instead of ptrace if defined > > > Add macro addr_ptr to take care of ptrace address arguement > > > (pdc_read_regs): Likewise > > > (pdc_write_regs): Likewise > > > (aix_thread_resume): Likewise > > > (fetch_regs_kernel_thread): Likewise > > > (store_regs_kernel_thread): Likewise > > > > > Mark> Again, you're being sloppy here. Sentences start with a capital > > letter and end in a full stop. > > > > Hi, > > > > Apologize for the overlooking punctuation errors. Fixing it here. > > Also re-submitting the patch here for review. Is it okay to Commit? > > Yes, fine with me. Do you have a copyright assignment in place? Or > is this covered by a company-wide assignment that IBM has in place? Looping Ulrich Weigand in here. He has agreed to help me out with this. Hi Ulrich, Any comments regarding this ? > > > > --- > > ChangeLog :- > > * aixthread.c: Call ptrace64 instead of ptracex if defined. > > Call ptrace64 instead of ptrace if defined. > > Add macro addr_ptr to take care of ptrace address arguement. > > (pdc_read_regs): Likewise. > > (pdc_write_regs): Likewise. > > (aix_thread_resume): Likewise. > > (fetch_regs_kernel_thread): Likewise. > > (store_regs_kernel_thread): Likewise. > > > > > > --- > > Index: ./gdb/aix-thread.c > > =================================================================== > > --- ./gdb.orig/aix-thread.c > > +++ .gdb/aix-thread.c > > @@ -237,7 +237,14 @@ > > return 0; /* Not reached. */ > > } > > > > -/* Call ptracex (REQ, ID, ADDR, DATA, BUF). Return success. */ > > +/* Call ptracex (REQ, ID, ADDR, DATA, BUF) or > > + ptrace64 (REQ, ID, ADDR, DATA, BUF) if HAVE_PTRACE64. > > + Return success. */ > > + > > +#ifdef HAVE_PTRACE64 > > +# define ptracex(request, pid, addr, data, buf) \ > > + ptrace64 (request, pid, addr, data, buf) > > +#endif > > > > static int > > ptrace64aix (int req, int id, long long addr, int data, int *buf) > > @@ -246,14 +253,24 @@ > > return ptrace_check (req, id, ptracex (req, id, addr, data, buf)); > > } > > > > -/* Call ptrace (REQ, ID, ADDR, DATA, BUF). Return success. */ > > +/* Call ptrace (REQ, ID, ADDR, DATA, BUF) or > > + ptrace64 (REQ, ID, ADDR, DATA, BUF) if HAVE_PTRACE64. > > + Return success. */ > > + > > +#ifdef HAVE_PTRACE64 > > +# define ptrace(request, pid, addr, data, buf) \ > > + ptrace64 (request, pid, addr, data, buf) > > +# define addr_ptr long long > > +#else > > +# define addr_ptr int * > > +#endif > > > > static int > > -ptrace32 (int req, int id, int *addr, int data, int *buf) > > +ptrace32 (int req, int id, addr_ptr addr, int data, int *buf) > > { > > errno = 0; > > return ptrace_check (req, id, > > - ptrace (req, id, (int *) addr, data, buf)); > > + ptrace (req, id, (addr_ptr) addr, data, buf)); > > } > > > > /* If *PIDP is a composite process/thread id, convert it to a > > @@ -361,7 +378,7 @@ > > /* Floating-point registers. */ > > if (flags & PTHDB_FLAG_FPRS) > > { > > - if (!ptrace32 (PTT_READ_FPRS, tid, (void *) fprs, 0, NULL)) > > + if (!ptrace32 (PTT_READ_FPRS, tid, (addr_ptr) fprs, 0, NULL)) > > memset (fprs, 0, sizeof (fprs)); > > memcpy (context->fpr, fprs, sizeof(fprs)); > > } > > @@ -378,7 +395,7 @@ > > } > > else > > { > > - if (!ptrace32 (PTT_READ_SPRS, tid, (int *) &sprs32, 0, NULL)) > > + if (!ptrace32 (PTT_READ_SPRS, tid, (addr_ptr) &sprs32, 0, NULL)) > > memset (&sprs32, 0, sizeof (sprs32)); > > memcpy (&context->msr, &sprs32, sizeof(sprs32)); > > } > > @@ -413,13 +430,13 @@ > > ptrace64aix (PTT_WRITE_GPRS, tid, > > (unsigned long) context->gpr, 0, NULL); > > else > > - ptrace32 (PTT_WRITE_GPRS, tid, (int *) context->gpr, 0, NULL); > > + ptrace32 (PTT_WRITE_GPRS, tid, (addr_ptr) context->gpr, 0, NULL); > > } > > > > > /* Floating-point registers. */ > > > if (flags & PTHDB_FLAG_FPRS) > > > { > > > - ptrace32 (PTT_WRITE_FPRS, tid, (int *) context->fpr, 0, NULL); > > > + ptrace32 (PTT_WRITE_FPRS, tid, (addr_ptr) context->fpr, 0, NULL); > > > } > > > > > > /* Special-purpose registers. */ > > > @@ -432,7 +449,7 @@ > > > } > > > else > > > { > > > - ptrace32 (PTT_WRITE_SPRS, tid, (void *) &context->msr, 0, NULL); > > > + ptrace32 (PTT_WRITE_SPRS, tid, (addr_ptr) &context->msr, 0, NULL); > > > } > > > } > > > return 0; > > > @@ -997,10 +1014,10 @@ > > > tid[1] = 0; > > > > > > if (arch64) > > > - ptrace64aix (PTT_CONTINUE, tid[0], 1, > > > + ptrace64aix (PTT_CONTINUE, tid[0], (long long) 1, > > > gdb_signal_to_host (sig), (void *) tid); > > > else > > > - ptrace32 (PTT_CONTINUE, tid[0], (int *) 1, > > > + ptrace32 (PTT_CONTINUE, tid[0], (addr_ptr) 1, > > > gdb_signal_to_host (sig), (void *) tid); > > > } > > > } > > > @@ -1239,7 +1256,7 @@ > > > } > > > else > > > { > > > - if (!ptrace32 (PTT_READ_GPRS, tid, gprs32, 0, NULL)) > > > + if (!ptrace32 (PTT_READ_GPRS, tid, (addr_ptr) gprs32, 0, NULL)) > > > memset (gprs32, 0, sizeof (gprs32)); > > > for (i = 0; i < ppc_num_gprs; i++) > > > supply_reg32 (regcache, tdep->ppc_gp0_regnum + i, gprs32[i]); > > > @@ -1253,7 +1270,7 @@ > > > || (regno >= tdep->ppc_fp0_regnum > > > && regno < tdep->ppc_fp0_regnum + ppc_num_fprs))) > > > { > > - if (!ptrace32 (PTT_READ_FPRS, tid, (void *) fprs, 0, NULL)) > > + if (!ptrace32 (PTT_READ_FPRS, tid, (addr_ptr) fprs, 0, NULL)) > > memset (fprs, 0, sizeof (fprs)); > > supply_fprs (regcache, fprs); > > } > > @@ -1275,7 +1292,7 @@ > > { > > struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); > > > > - if (!ptrace32 (PTT_READ_SPRS, tid, (int *) &sprs32, 0, NULL)) > > + if (!ptrace32 (PTT_READ_SPRS, tid, (addr_ptr) &sprs32, 0, NULL)) > > memset (&sprs32, 0, sizeof (sprs32)); > > supply_sprs32 (regcache, sprs32.pt_iar, sprs32.pt_msr, > > sprs32.pt_cr, > > sprs32.pt_lr, sprs32.pt_ctr, sprs32.pt_xer, > > @@ -1570,9 +1587,9 @@ > > else > > { > > /* Pre-fetch: some regs may not be in the cache. */ > > - ptrace32 (PTT_READ_GPRS, tid, gprs32, 0, NULL); > > + ptrace32 (PTT_READ_GPRS, tid, (addr_ptr) gprs32, 0, NULL); > > fill_gprs32 (regcache, gprs32); > > - ptrace32 (PTT_WRITE_GPRS, tid, gprs32, 0, NULL); > > + ptrace32 (PTT_WRITE_GPRS, tid, (addr_ptr) gprs32, 0, NULL); > > } > > } > > > > @@ -1584,9 +1601,9 @@ > > && regno < tdep->ppc_fp0_regnum + ppc_num_fprs))) > > { > > /* Pre-fetch: some regs may not be in the cache. */ > > - ptrace32 (PTT_READ_FPRS, tid, (void *) fprs, 0, NULL); > > + ptrace32 (PTT_READ_FPRS, tid, (addr_ptr) fprs, 0, NULL); > > fill_fprs (regcache, fprs); > > - ptrace32 (PTT_WRITE_FPRS, tid, (void *) fprs, 0, NULL); > > + ptrace32 (PTT_WRITE_FPRS, tid, (addr_ptr) fprs, 0, NULL); > > } > > > > /* Special-purpose registers. */ > > @@ -1618,7 +1635,7 @@ > > gdb_assert (sizeof (sprs32.pt_iar) == 4); > > > > /* Pre-fetch: some registers won't be in the cache. */ > > - ptrace32 (PTT_READ_SPRS, tid, (int *) &sprs32, 0, NULL); > > + ptrace32 (PTT_READ_SPRS, tid, (addr_ptr) &sprs32, 0, NULL); > > > > fill_sprs32 (regcache, &tmp_iar, &tmp_msr, &tmp_cr, &tmp_lr, > > &tmp_ctr, &tmp_xer, &tmp_fpscr); > > @@ -1637,7 +1654,7 @@ > > regcache_raw_collect (regcache, tdep->ppc_mq_regnum, > > &sprs32.pt_mq); > > > > - ptrace32 (PTT_WRITE_SPRS, tid, (int *) &sprs32, 0, NULL); > > + ptrace32 (PTT_WRITE_SPRS, tid, (addr_ptr) &sprs32, 0, NULL); > > } > > } > > } > > --- > > > > > > >