Sorry if this is a dup, I seem to be having mailer problems... On Tue, 2006-04-25 at 21:38 +0200, Mark Kettenis wrote: > > 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 > Changeing the PTRACE_... stuff had kind of a wrinkle (see below) but the big problem is with this line in ppc_linux_nat.c: last_stopped_data_address = (CORE_ADDR) siginfo.si_addr; in subroutine ppc_linux_stopped_by_watchpoint() A 'CORE_ADDR' is a 'bfd_vma' and on ppc64 systems, a 'bfd_vma' is an 'unsigned long long'. If gdb is built on such a system with CC='gcc -m64', an 'unsigned long long' is 64 bits as are an 'unsigned long' and a 'void *'. No problem. But if CC is just 'gcc', then an 'unsigned long long' is still 64 bits, but an 'unsigned long' and a 'void *' are 32 bits. Changing the line to: last_stopped_data_address = (CORE_ADDR) (unsigned long) siginfo.si_addr; Fixes the problem because the extra cast does nothing when CC='gcc -m64' but when CC='gcc', siginfo.si_addr is cast from a 'void *' to an integer of the same size, which is then cast to an integer of a larger size, avoiding the warning. I have attached the new patch, OK to commit? -=# Paul #=- PS: Here is the wrinkle On a ppc64 system: This is from /usr/include/sys/ptrace.h: extern long int ptrace (enum __ptrace_request __request, ...) __THROW; So I think PTRACE_TYPE_RET should default to 'long' in ppc_linux_nat.c Also from /usr/include/sys/ptrace.h: enum __ptrace_request { ... /* Return the word in the process's user area at offset ADDR. */ PTRACE_PEEKUSER = 3, #define PT_READ_U PTRACE_PEEKUSER ... /* Write the word DATA into the process's user area at offset ADDR. */ PTRACE_POKEUSER = 6, #define PT_WRITE_U PTRACE_POKEUSER ... Even though the man pages says PTRACE_PEEKUSR and PTRACE_POKEUSR