From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27605 invoked by alias); 3 Dec 2004 21:44:31 -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 27350 invoked from network); 3 Dec 2004 21:44:26 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 3 Dec 2004 21:44:26 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id iB3LiQEd013901 for ; Fri, 3 Dec 2004 16:44:26 -0500 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id iB3LiQr19140; Fri, 3 Dec 2004 16:44:26 -0500 Received: from redhat.com (dhcp-172-16-25-137.sfbay.redhat.com [172.16.25.137]) by potter.sfbay.redhat.com (8.12.8/8.12.8) with ESMTP id iB3LiOso022705; Fri, 3 Dec 2004 16:44:24 -0500 Message-ID: <41B0DE38.1010107@redhat.com> Date: Fri, 03 Dec 2004 21:45:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.3) Gecko/20040924 MIME-Version: 1.0 To: Paul Schlie CC: gdb-patches@sources.redhat.com Subject: Re: RFA: Recognize 'x' in response to 'p' packet References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-12/txt/msg00085.txt.bz2 Paul Schlie wrote: >>Jim Blandy >>* remote.c (fetch_register_using_p): Recognize 'x's for the value >> of the register as indicating that the register's value is not >> available. > > > Out of curiosity, under what practical circumstances would the value of a > register not be accessible? (and if not, shouldn't an error be returned, as > opposed to an 'x' which is converted to a 0 anyway? Which I've noticed "g" > packets also assume?) Post-mortem debugging. See tracepoint.c. In a nutshell, you set up a tracing experiment wherein a debugging agent on the target (like an enhanced version of gdbserver) will collect data for you on the fly, saving it to be retrieved later. Data can include register values and memory values. During the post-mortem data examination stage, the target agent enters a mode where, whenever GDB requests a register or memory value, the agent supplies it from the collected cache rather than from the 'live' target. It lets GDB look at a saved machine state, but you can only examine those registers that were saved. Those that weren't saved are not available, hence we need an idiom for reporting this to gdb. We can't use any legitimate integer value because a saved register might actually have had that value.