From aa5b6559bd80cdf2c161c1341878876061bdf606 Mon Sep 17 00:00:00 2001 From: Peter O'Gorman Date: Tue, 21 Sep 2010 11:24:35 -0500 Subject: [PATCH 2/6] Allow build to succeed on AIX 6.1 getthrds is prototyped on aix 6.1 (and probably later) The third argument to ptrace32 is an int* --- gdb/aix-thread.c | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-) diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c index cbdb099..01a276c 100644 --- a/gdb/aix-thread.c +++ b/gdb/aix-thread.c @@ -349,7 +349,7 @@ pdc_read_regs (pthdb_user_t user, } else { - if (!ptrace32 (PTT_READ_GPRS, tid, gprs32, 0, NULL)) + if (!ptrace32 (PTT_READ_GPRS, tid, (int*)gprs32, 0, NULL)) memset (gprs32, 0, sizeof (gprs32)); memcpy (context->gpr, gprs32, sizeof(gprs32)); } @@ -647,9 +647,12 @@ get_signaled_thread (void) pthdb_tid_t ktid = 0; int result = 0; - /* getthrds(3) isn't prototyped in any AIX 4.3.3 #include file. */ + /* getthrds(3) isn't prototyped in any AIX 4.3.3 #include file. + but is in AIX 6.1 (and later?) */ +#ifndef _AIX61 extern int getthrds (pid_t, struct thrdsinfo64 *, int, pthdb_tid_t *, int); +#endif while (1) { @@ -1238,7 +1241,7 @@ fetch_regs_kernel_thread (struct regcache *regcache, int regno, } else { - if (!ptrace32 (PTT_READ_GPRS, tid, gprs32, 0, NULL)) + if (!ptrace32 (PTT_READ_GPRS, tid, (int*)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]); @@ -1557,9 +1560,9 @@ store_regs_kernel_thread (const struct regcache *regcache, int regno, else { /* Pre-fetch: some regs may not be in the cache. */ - ptrace32 (PTT_READ_GPRS, tid, gprs32, 0, NULL); + ptrace32 (PTT_READ_GPRS, tid, (int*)gprs32, 0, NULL); fill_gprs32 (regcache, gprs32); - ptrace32 (PTT_WRITE_GPRS, tid, gprs32, 0, NULL); + ptrace32 (PTT_WRITE_GPRS, tid, (int*)gprs32, 0, NULL); } } -- 1.7.0.1