From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1132 invoked by alias); 25 Apr 2006 00:18:20 -0000 Received: (qmail 1119 invoked by uid 22791); 25 Apr 2006 00:18:18 -0000 X-Spam-Check-By: sourceware.org Received: from e4.ny.us.ibm.com (HELO e4.ny.us.ibm.com) (32.97.182.144) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 25 Apr 2006 00:18:16 +0000 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e4.ny.us.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id k3P0IEWR012190 for ; Mon, 24 Apr 2006 20:18:14 -0400 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay04.pok.ibm.com (8.12.10/NCO/VER6.8) with ESMTP id k3P0IE3O209428 for ; Mon, 24 Apr 2006 20:18:14 -0400 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.12.11/8.13.3) with ESMTP id k3P0ID1k029219 for ; Mon, 24 Apr 2006 20:18:13 -0400 Received: from dufur.beaverton.ibm.com (dufur.beaverton.ibm.com [9.47.22.20]) by d01av04.pok.ibm.com (8.12.11/8.12.11) with ESMTP id k3P0ID0g029209 for ; Mon, 24 Apr 2006 20:18:13 -0400 Subject: [patch] Can't build ppc32 GDB From: PAUL GILLIAM Reply-To: pgilliam@us.ibm.com To: gdb-patches@sources.redhat.com Content-Type: multipart/mixed; boundary="=-ikZah6ZBZkplZ53Jxp9T" Date: Tue, 25 Apr 2006 00:18:00 -0000 Message-Id: <1145924338.18934.45.camel@dufur.beaverton.ibm.com> Mime-Version: 1.0 X-Mailer: Evolution 2.2.2 (2.2.2-5) X-IsSubscribed: yes 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/msg00331.txt.bz2 --=-ikZah6ZBZkplZ53Jxp9T Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-length: 1254 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 #=- --=-ikZah6ZBZkplZ53Jxp9T Content-Description: Content-Disposition: inline; filename=cast.diff Content-Type: text/x-patch; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-length: 2352 ? .NEWS.annotate.swp ? .gdbinit ? Makefile ? ada-exp.c ? ada-lex.c ? c-exp.c ? chit.diff ? config.cache ? config.h ? config.log ? config.status ? cp-name-parser.c ? f-exp.c ? gdb ? gdbtui ? hope.patch ? init.c ? jv-exp.c ? m2-exp.c ? maintainers.patch ? objc-exp.c ? observer.h ? observer.inc ? p-exp.c ? stamp-h ? tweek.patch ? version.c ? doc/Makefile ? doc/config.log ? doc/config.status ? gdbserver/Makefile ? gdbserver/config.h ? gdbserver/config.log ? gdbserver/config.status ? gdbserver/gdbreplay ? gdbserver/gdbserver ? gdbserver/reg-ppc64.c ? gdbserver/stamp-h ? gdbserver/version.c ? testsuite/Makefile ? testsuite/config.log ? testsuite/config.status ? testsuite/gdb.ada/Makefile ? testsuite/gdb.arch/Makefile ? testsuite/gdb.asm/Makefile ? testsuite/gdb.base/Makefile ? testsuite/gdb.cp/Makefile ? testsuite/gdb.disasm/Makefile ? testsuite/gdb.dwarf2/Makefile ? testsuite/gdb.fortran/Makefile ? testsuite/gdb.java/Makefile ? testsuite/gdb.mi/Makefile ? testsuite/gdb.objc/Makefile ? testsuite/gdb.server/Makefile ? testsuite/gdb.stabs/Makefile ? testsuite/gdb.stabs/config.log ? testsuite/gdb.stabs/config.status ? testsuite/gdb.threads/Makefile ? testsuite/gdb.trace/Makefile 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; } --=-ikZah6ZBZkplZ53Jxp9T--