From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4394 invoked by alias); 17 May 2002 17:49:13 -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 4352 invoked from network); 17 May 2002 17:49:09 -0000 Received: from unknown (HELO cygnus.com) (205.180.83.203) by sources.redhat.com with SMTP; 17 May 2002 17:49:09 -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 KAA19685; Fri, 17 May 2002 10:48:59 -0700 (PDT) Message-ID: <3CE53F51.BEC03B6D@redhat.com> Date: Fri, 17 May 2002 10:49: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: <200205170906.KAA28644@cam-mail2.cambridge.arm.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-05/txt/msg00730.txt.bz2 Richard Earnshaw wrote: > > > > 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. > > Already tried that idea. It doesn't work. > > set_register_cached (-1) means that the register is "temporarily > unavailable" at this time (due to the way we gathered the registers). > Each time registers_changed() is called the value is reset to zero. > > I need a way the target vector to let REGISTER_NAME() know that the > register is "unavailable this session", so that it can return an empty > string for the register; so that gdb won't think it exists at all. I see. This is something that depends on both the arch and the target.