This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: RFA: Recognize 'x' in response to 'p' packet
- From: Michael Snyder <msnyder at redhat dot com>
- To: Paul Schlie <schlie at comcast dot net>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Fri, 03 Dec 2004 13:44:24 -0800
- Subject: Re: RFA: Recognize 'x' in response to 'p' packet
- Organization: Red Hat, Inc.
- References: <BDD52B8E.81EA%schlie@comcast.net>
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.