From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8333 invoked by alias); 14 Apr 2007 22:50:07 -0000 Received: (qmail 8324 invoked by uid 22791); 14 Apr 2007 22:50:07 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO brahms.sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 14 Apr 2007 23:50:04 +0100 Received: from brahms.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by brahms.sibelius.xs4all.nl (8.14.0/8.14.0) with ESMTP id l3EMnmdq018133; Sun, 15 Apr 2007 00:49:48 +0200 (CEST) Received: (from kettenis@localhost) by brahms.sibelius.xs4all.nl (8.14.0/8.14.0/Submit) id l3EMnlut014933; Sun, 15 Apr 2007 00:49:47 +0200 (CEST) Date: Sat, 14 Apr 2007 22:55:00 -0000 Message-Id: <200704142249.l3EMnlut014933@brahms.sibelius.xs4all.nl> From: Mark Kettenis To: uweigand@de.ibm.com CC: gdb-patches@sourceware.org In-reply-to: <200704142110.l3ELASpq008358@d12av02.megacenter.de.ibm.com> (uweigand@de.ibm.com) Subject: Re: [rfc/rft] [3/5] Untangle register_addr: CANNOT_FETCH/STORE_REGISTER References: <200704142110.l3ELASpq008358@d12av02.megacenter.de.ibm.com> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-04/txt/msg00229.txt.bz2 > Date: Sat, 14 Apr 2007 23:10:28 +0200 (CEST) > From: "Ulrich Weigand" > > Hello, > > this patch removes the calls to CANNOT_FETCH_REGISTER / CANNOT_STORE_REGISTER > from within the inf_ptrace_trad_target routines. This is enabled by two > changes to the register_u_offset callback: > - the routine is allowed to return (CORE_ADDR)-1 to indicate the > requested register cannot be accessed > - the routine gains a new argument STORE_P that indicates whether > the register is to be fetched or stored So effectively, this turns CANNOT_FETCH_REGISTER/CANNOT_STORE_REGISTER from being overloaded as both a native and target property into a target-architecture-only property instead. That's probably a good idea. However, I think you removing the calls from the calls from the inf_ptrace_trad_target routines is wrong. We should never fetch/store the registers for which the target architecture says that they cannot be fetched/stored. If you leave them in, do any targets remain that have any registers that can be fetched but cannot be stored by ptrace(2), that are not defined as such by the target architecture. I'd be surprised if there were any such registers. In that cas you wouldn't need the extra store_p argument for the register_u_addr() callback. > ChangeLog: > > * inf-ptrace.c (inf_ptrace_register_u_offset): Add STORE_P argument. > (inf_ptrace_fetch_register): Update call. Check for (CORE_ADDR)-1 > return value; replaces CANNOT_FETCH_REGISTER call. > (inf_ptrace_store_register): Update call. Check for (CORE_ADDR)-1 > return value; replaces CANNOT_STORE_REGISTER call. > (inf_ptrace_trad_target): Update signature. > * inf-ptrace.h (inf_ptrace_trad_target): Likewise. > * linux-nat.c (linux_trad_target): Likewise. > * linux-nat.h (linux_trad_target): Likewise. > > * alpha-linux-nat.c (alpha_linux_register_u_offset): Add STORE_P > argument. Call CANNOT_STORE_REGISTER / CANNOT_FETCH_REGISTER. > * mips-linux-nat.c (mips_linux_register_u_offset): Likewise. > * vax-nat.c (vax_register_u_addr): Add STORE_P argument.