From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30427 invoked by alias); 25 Apr 2006 19:38:15 -0000 Received: (qmail 30417 invoked by uid 22791); 25 Apr 2006 19:38:14 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 25 Apr 2006 19:38:13 +0000 Received: from elgar.sibelius.xs4all.nl (root@elgar.sibelius.xs4all.nl [192.168.0.2]) by sibelius.xs4all.nl (8.13.4/8.13.4) with ESMTP id k3PJc9u9009943; Tue, 25 Apr 2006 21:38:10 +0200 (CEST) Received: from elgar.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.13.6/8.13.6) with ESMTP id k3PJc90R029642; Tue, 25 Apr 2006 21:38:09 +0200 (CEST) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.13.6/8.13.6/Submit) id k3PJc9dl014571; Tue, 25 Apr 2006 21:38:09 +0200 (CEST) Date: Tue, 25 Apr 2006 19:38:00 -0000 Message-Id: <200604251938.k3PJc9dl014571@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: pgilliam@us.ibm.com CC: gdb-patches@sources.redhat.com In-reply-to: <1145924593.18934.48.camel@dufur.beaverton.ibm.com> (message from PAUL GILLIAM on Mon, 24 Apr 2006 17:23:13 -0700) Subject: Re: [patch] Can't build ppc32 GDB References: <1145924338.18934.45.camel@dufur.beaverton.ibm.com> <1145924593.18934.48.camel@dufur.beaverton.ibm.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-04/txt/msg00338.txt.bz2 > From: PAUL GILLIAM > Date: Mon, 24 Apr 2006 17:23:13 -0700 > > Darn! I forgot to 'trim' the patch'. > > I have attached the 'trimmed' version. Get rid of the PTRACE_XFER_TYPE and PTRACE_ARG3_TYPE. Replace them with PTRACE_TYPE_RET and PTRACE_TYPE_ARG3. Or better yet, if the prototype for ptrace(2) is consistent for all powerpc Linux variants, simply replace them with the proper type (which is probably "long"). Oh and while you're there, get rid of PT_READ_U/PT_WRITE_U in favour of PTRACE_PEEKUSR/PTRACE_POKEUSR. Mark > On Mon, 2006-04-24 at 17:18 -0700, PAUL GILLIAM wrote: > > I don't know if all ppc systems have this problem. But on a PowerPC-64 > > system, I get the following when I try to build a 32-bit gdb: > > > > gcc -c -g -O2 -mminimal-toc -I. -I.././gdb -I.././gdb/config > > -DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H > > -I.././gdb/../include/opcode -I.././gdb/../readline/.. -I../bfd > > -I.././gdb/../bfd -I.././gdb/../include -I../intl -I.././gdb/../intl > > -DMI_OUT=1 -DTUI=1 -Wimplicit -Wreturn-type -Wcomment -Wtrigraphs > > -Wformat -Wparentheses -Wpointer-arith -Wformat-nonliteral > > -Wunused-label -Wunused-function -Wno-pointer-sign -Wuninitialized > > -Werror ppc-linux-nat.c > > cc1: warnings being treated as errors > > ppc-linux-nat.c: In function ‘fetch_register’: > > ppc-linux-nat.c:396: warning: cast to pointer from integer of different > > size > > ppc-linux-nat.c: In function ‘store_register’: > > ppc-linux-nat.c:691: warning: cast to pointer from integer of different > > size > > ppc-linux-nat.c: In function ‘ppc_linux_stopped_by_watchpoint’: > > ppc-linux-nat.c:904: warning: cast from pointer to integer of different > > size > > make: *** [ppc-linux-nat.o] Error 1 > > > > > > So as a starting point, I have attached a patch that gets rid of the > > warnings. > > > > OK to commit? (not expecting a 'yes', but you never know unless you ask > > 8-) > > > > -=# Paul #=- > > > > > > --=-vPdNruxeVr+2Uj34B6nP > Content-Disposition: attachment; filename=cast.diff > Content-Type: text/x-patch; name=cast.diff; charset=utf-8 > Content-Transfer-Encoding: 7bit > > Index: ppc-linux-nat.c > =================================================================== > RCS file: /cvs/src/src/gdb/ppc-linux-nat.c,v > retrieving revision 1.60 > diff -a -u -r1.60 ppc-linux-nat.c > --- ppc-linux-nat.c 24 Mar 2006 23:08:16 -0000 1.60 > +++ ppc-linux-nat.c 25 Apr 2006 00:10:12 -0000 > @@ -393,7 +393,7 @@ > { > errno = 0; > *(PTRACE_XFER_TYPE *) & buf[bytes_transferred] > - = ptrace (PT_READ_U, tid, (PTRACE_ARG3_TYPE) regaddr, 0); > + = ptrace (PT_READ_U, tid, (PTRACE_ARG3_TYPE) (long) regaddr, 0); > regaddr += sizeof (PTRACE_XFER_TYPE); > if (errno != 0) > { > @@ -688,7 +688,7 @@ > for (i = 0; i < bytes_to_transfer; i += sizeof (PTRACE_XFER_TYPE)) > { > errno = 0; > - ptrace (PT_WRITE_U, tid, (PTRACE_ARG3_TYPE) regaddr, > + ptrace (PT_WRITE_U, tid, (PTRACE_ARG3_TYPE) (long) regaddr, > *(PTRACE_XFER_TYPE *) & buf[i]); > regaddr += sizeof (PTRACE_XFER_TYPE); > > @@ -901,7 +901,7 @@ > (siginfo.si_code & 0xffff) != 0x0004) > return 0; > > - last_stopped_data_address = (CORE_ADDR) siginfo.si_addr; > + last_stopped_data_address = (CORE_ADDR) (long) siginfo.si_addr; > return 1; > } > > > --=-vPdNruxeVr+2Uj34B6nP-- > >