From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11403 invoked by alias); 16 May 2002 23:35:07 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 11391 invoked from network); 16 May 2002 23:35:04 -0000 Received: from unknown (HELO cygnus.com) (205.180.83.203) by sources.redhat.com with SMTP; 16 May 2002 23:35:04 -0000 Received: from redhat.com (reddwarf.sfbay.redhat.com [172.16.24.50]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id QAA09852; Thu, 16 May 2002 16:34:48 -0700 (PDT) Message-ID: <3CE43EE2.59DD49E3@redhat.com> Date: Thu, 16 May 2002 16:35:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. X-Accept-Language: en MIME-Version: 1.0 To: Richard.Earnshaw@arm.com CC: Andrew Cagney , gdb-patches@sources.redhat.com Subject: Re: [patch/rfc] Revise REGISTER_SIM_REGNO() References: <200205151045.LAA02092@cam-mail2.cambridge.arm.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-05/txt/msg00683.txt.bz2 Richard Earnshaw wrote: > > > Hello, > > > > The attached, per comments from RichardE, revises the definition and use > > of REGISTER_SIM_REGNO. I think I've managed to preserve existing behavour. > > > > Briefly, REGISTER_SIM_REGNO() [Hmm, do I doco `legacy' behavour?] > > returns a cardinal indicating the simulators register number, or > > SIM_REGNO_UNAVAILABLE/-1 when the register isn't there. > > > > To preserve current behavour on existing targets, > > LEGACY_SIM_REGNO_IGNORE is returned by the default > > legacy_register_sim_regno() function. > > I'd like to see a target have a way to report that it is permanently > unable to recover a register -- because there's nothing in the protocol to > allow its recovery. > > For example, I've added the privileged mode registers to my ARM target > code; when the target is using a ptrace() interface for debugging a user > program, then these registers are never available and it's pointless > having gdb report them. How about having target_fetch_register set them to -1 in the cache? See remote.c:remote_fetch_registers: set_register_cached (i, -1); This tells the rest of GDB that the value of the register is "not available". You could unconditionally mark certain regs as unavailable whenever target_fetch_registers is called.