From patchwork Thu Apr 21 13:02:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 11833 Received: (qmail 127278 invoked by alias); 21 Apr 2016 13:03:04 -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 127256 invoked by uid 89); 21 Apr 2016 13:03:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= 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; Thu, 21 Apr 2016 13:03:00 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E1479800AF for ; Thu, 21 Apr 2016 13:02:58 +0000 (UTC) Received: from cascais.lan (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3LD2uN5016874 for ; Thu, 21 Apr 2016 09:02:56 -0400 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [pushed] Fix AIX gdb build with C++ compiler Date: Thu, 21 Apr 2016 14:02:56 +0100 Message-Id: <1461243776-8964-1-git-send-email-palves@redhat.com> We currently get: ../../src/gdb/aix-thread.c: In function 'int pdc_read_data(pthdb_user_t, void*, pthdb_addr_t, size_t)': ../../src/gdb/aix-thread.c:465:46: error: invalid conversion from 'void*' to 'gdb_byte* {aka unsigned char*}' [-fpermissive] status = target_read_memory (addr, buf, len); ^ ../../src/gdb/aix-thread.c: In function 'void aix_thread_resume(target_ops*, ptid_t, int, gdb_signal)': ../../src/gdb/aix-thread.c:1010:46: error: invalid conversion from 'void*' to 'int*' [-fpermissive] gdb_signal_to_host (sig), (void *) tid); ^ ../../src/gdb/aix-thread.c:243:1: error: initializing argument 5 of 'int ptrace64aix(int, int, long long int, int, int*)' [-fpermissive] ptrace64aix (int req, int id, long long addr, int data, int *buf) ../../src/gdb/rs6000-nat.c: In function 'gdb_byte* rs6000_ptrace_ldinfo(ptid_t)': ../../src/gdb/rs6000-nat.c:596:36: error: invalid conversion from 'void*' to 'gdb_byte* {aka unsigned char*}' [-fpermissive] gdb_byte *ldi = xmalloc (ldi_size); ^ ../../src/gdb/rs6000-nat.c:615:36: error: invalid conversion from 'void*' to 'gdb_byte* {aka unsigned char*}' [-fpermissive] ldi = xrealloc (ldi, ldi_size); ^ (and more instances of the same). gdb/ChangeLog: 2016-04-21 Pedro Alves * aix-thread.c (pdc_read_data, pdc_write_data): Add cast. (aix_thread_resume): Use PTRACE_TYPE_ARG5. * rs6000-nat.c (rs6000_ptrace64): Use PTRACE_TYPE_ARG5. (rs6000_ptrace_ldinfo): Change type of 'ldi' local to void pointer, and cast return to gdb_byte pointer. --- gdb/ChangeLog | 8 ++++++++ gdb/aix-thread.c | 8 ++++---- gdb/rs6000-nat.c | 8 ++++---- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0741d1c..6e09030 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,13 @@ 2016-04-21 Pedro Alves + * aix-thread.c (pdc_read_data, pdc_write_data): Add cast. + (aix_thread_resume): Use PTRACE_TYPE_ARG5. + * rs6000-nat.c (rs6000_ptrace64): Use PTRACE_TYPE_ARG5. + (rs6000_ptrace_ldinfo): Change type of 'ldi' local to void + pointer, and cast return to gdb_byte pointer. + +2016-04-21 Pedro Alves + * s390-linux-nat.c (fetch_regset, store_regset, check_regset): Use void * instead of gdb_byte *. diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c index 11140466..693d6f6 100644 --- a/gdb/aix-thread.c +++ b/gdb/aix-thread.c @@ -462,7 +462,7 @@ pdc_read_data (pthdb_user_t user, void *buf, "pdc_read_data (user = %ld, buf = 0x%lx, addr = %s, len = %ld)\n", user, (long) buf, hex_string (addr), len); - status = target_read_memory (addr, buf, len); + status = target_read_memory (addr, (gdb_byte *) buf, len); ret = status == 0 ? PDC_SUCCESS : PDC_FAILURE; if (debug_aix_thread) @@ -484,7 +484,7 @@ pdc_write_data (pthdb_user_t user, void *buf, "pdc_write_data (user = %ld, buf = 0x%lx, addr = %s, len = %ld)\n", user, (long) buf, hex_string (addr), len); - status = target_write_memory (addr, buf, len); + status = target_write_memory (addr, (gdb_byte *) buf, len); ret = status == 0 ? PDC_SUCCESS : PDC_FAILURE; if (debug_aix_thread) @@ -1007,10 +1007,10 @@ aix_thread_resume (struct target_ops *ops, if (arch64) ptrace64aix (PTT_CONTINUE, tid[0], (long long) 1, - gdb_signal_to_host (sig), (void *) tid); + gdb_signal_to_host (sig), (PTRACE_TYPE_ARG5) tid); else ptrace32 (PTT_CONTINUE, tid[0], (addr_ptr) 1, - gdb_signal_to_host (sig), (void *) tid); + gdb_signal_to_host (sig), (PTRACE_TYPE_ARG5) tid); } } diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c index ca333f2..1ae3cc3 100644 --- a/gdb/rs6000-nat.c +++ b/gdb/rs6000-nat.c @@ -143,9 +143,9 @@ rs6000_ptrace64 (int req, int id, long long addr, int data, void *buf) { #ifdef ARCH3264 # ifdef HAVE_PTRACE64 - int ret = ptrace64 (req, id, addr, data, buf); + int ret = ptrace64 (req, id, addr, data, (PTRACE_TYPE_ARG5) buf); # else - int ret = ptracex (req, id, addr, data, buf); + int ret = ptracex (req, id, addr, data, (PTRACE_TYPE_ARG5) buf); # endif #else int ret = 0; @@ -593,7 +593,7 @@ rs6000_ptrace_ldinfo (ptid_t ptid) { const int pid = ptid_get_pid (ptid); int ldi_size = 1024; - gdb_byte *ldi = xmalloc (ldi_size); + void *ldi = xmalloc (ldi_size); int rc = -1; while (1) @@ -615,7 +615,7 @@ rs6000_ptrace_ldinfo (ptid_t ptid) ldi = xrealloc (ldi, ldi_size); } - return ldi; + return (gdb_byte *) ldi; } /* Implement the to_xfer_partial target_ops method for