* Re: RFA: Recognize 'x' in response to 'p' packet
@ 2004-12-03 1:29 Paul Schlie
2004-12-03 4:32 ` Steven Johnson
2004-12-03 21:45 ` Michael Snyder
0 siblings, 2 replies; 17+ messages in thread
From: Paul Schlie @ 2004-12-03 1:29 UTC (permalink / raw)
To: gdb-patches
> 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?)
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: RFA: Recognize 'x' in response to 'p' packet
2004-12-03 1:29 RFA: Recognize 'x' in response to 'p' packet Paul Schlie
@ 2004-12-03 4:32 ` Steven Johnson
2004-12-03 4:54 ` Paul Schlie
2004-12-03 21:45 ` Michael Snyder
1 sibling, 1 reply; 17+ messages in thread
From: Steven Johnson @ 2004-12-03 4:32 UTC (permalink / raw)
To: Paul Schlie; +Cc: gdb-patches
The PowerPC is such an example, where the Register response usually
includes floating point registers, but say the MPC860 family doesnt have
them. I would imagine the reason to do it is so that, in future, GDB
can remove from the users view registers that are non existent for a
target, rather than show them as 0's.
If so, then this would be a necessary first step (identifying such from
the target.)
Steven
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?)
>
>
>
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: RFA: Recognize 'x' in response to 'p' packet
2004-12-03 4:32 ` Steven Johnson
@ 2004-12-03 4:54 ` Paul Schlie
2004-12-03 13:57 ` Daniel Jacobowitz
0 siblings, 1 reply; 17+ messages in thread
From: Paul Schlie @ 2004-12-03 4:54 UTC (permalink / raw)
To: Steven Johnson; +Cc: gdb-patches
I would have thought that the BFD etc. description of the target machine
would have correctly identified the register set the machine supported.
(but the desire to support a value of x "un-defined/initialized" may
make sense if interfaced to a simulator, if the value of x were a
represent-able gdb value, and could propagate through expression
evaluations which it presently can't, but would be potentially useful
if it could to catch subtle bugs; but it's not clear that was the intent?)
> From: Steven Johnson <sjohnson@neurizon.net>
>
> The PowerPC is such an example, where the Register response usually
> includes floating point registers, but say the MPC860 family doesnt have
> them. I would imagine the reason to do it is so that, in future, GDB
> can remove from the users view registers that are non existent for a
> target, rather than show them as 0's.
>
> If so, then this would be a necessary first step (identifying such from
> the target.)
>
> Steven
>
> 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?)
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: RFA: Recognize 'x' in response to 'p' packet
2004-12-03 4:54 ` Paul Schlie
@ 2004-12-03 13:57 ` Daniel Jacobowitz
2004-12-03 21:48 ` Michael Snyder
0 siblings, 1 reply; 17+ messages in thread
From: Daniel Jacobowitz @ 2004-12-03 13:57 UTC (permalink / raw)
To: Paul Schlie; +Cc: Steven Johnson, gdb-patches
On Thu, Dec 02, 2004 at 11:54:30PM -0500, Paul Schlie wrote:
> I would have thought that the BFD etc. description of the target machine
> would have correctly identified the register set the machine supported.
That is not always possible. Targets are strange...
--
Daniel Jacobowitz
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: RFA: Recognize 'x' in response to 'p' packet
2004-12-03 1:29 RFA: Recognize 'x' in response to 'p' packet Paul Schlie
2004-12-03 4:32 ` Steven Johnson
@ 2004-12-03 21:45 ` Michael Snyder
2004-12-03 22:53 ` Paul Schlie
1 sibling, 1 reply; 17+ messages in thread
From: Michael Snyder @ 2004-12-03 21:45 UTC (permalink / raw)
To: Paul Schlie; +Cc: gdb-patches
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.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: RFA: Recognize 'x' in response to 'p' packet
2004-12-03 13:57 ` Daniel Jacobowitz
@ 2004-12-03 21:48 ` Michael Snyder
0 siblings, 0 replies; 17+ messages in thread
From: Michael Snyder @ 2004-12-03 21:48 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: Paul Schlie, Steven Johnson, gdb-patches
Daniel Jacobowitz wrote:
> On Thu, Dec 02, 2004 at 11:54:30PM -0500, Paul Schlie wrote:
>
>>I would have thought that the BFD etc. description of the target machine
>>would have correctly identified the register set the machine supported.
>
>
> That is not always possible. Targets are strange...
I suppose the xxxx value could be used in this context, but its
original motivation was for tracepoints. See my other post in
this thread.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: RFA: Recognize 'x' in response to 'p' packet
2004-12-03 21:45 ` Michael Snyder
@ 2004-12-03 22:53 ` Paul Schlie
2004-12-03 23:44 ` Paul Schlie
0 siblings, 1 reply; 17+ messages in thread
From: Paul Schlie @ 2004-12-03 22:53 UTC (permalink / raw)
To: Michael Snyder; +Cc: gdb-patches
> From: Michael Snyder <msnyder@redhat.com>
>> 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.
Thanks, that makes a little more sense; but as xxxx values aren't represent-
able within GDB, hence transformed upon receipt to 0; what's the point of
transmit x's as opposed to 0's to begin with as an idiom until GDB is
capable of differentiating valid from unknown values, which it's far from
being capable of today, as it would imply that all logical values within GDB
would need to be either maintained as text strings, or utilize structures
containing it's value along with a tag indicating it's validity, and all
expression corresponding evaluation routines would need to be updated.
(so although the proposal tries to solve a problem, it can't until GDB is
capable of differentiation between valid and unknown values. If the
objective is to determine for the purposes of information only which
register value are valid independent of their value; therefore wonder if it
may make sense to simply define a new server/target message function which
requests the list of the validity of the register values, analogously it's
request for their values, as today it's incapable of differentiation between
valid and invalid ones if encoded into the value representation itself.)
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: RFA: Recognize 'x' in response to 'p' packet
2004-12-03 22:53 ` Paul Schlie
@ 2004-12-03 23:44 ` Paul Schlie
0 siblings, 0 replies; 17+ messages in thread
From: Paul Schlie @ 2004-12-03 23:44 UTC (permalink / raw)
To: Michael Snyder; +Cc: gdb-patches
> From: Paul Schlie <schlie@comcast.net>
>> From: Michael Snyder <msnyder@redhat.com>
>>> 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.
>
> Thanks, that makes a little more sense; but as xxxx values aren't represent-
> able within GDB, hence transformed upon receipt to 0; what's the point of
> transmit x's as opposed to 0's to begin with as an idiom until GDB is capable
> of differentiating valid from unknown values, which it's far from being
> capable of today, as it would imply that all logical values within GDB would
> need to be either maintained as text strings, or utilize structures containing
> it's value along with a tag indicating it's validity, and all expression
> corresponding evaluation routines would need to be updated.
>
> (so although the proposal tries to solve a problem, it can't until GDB is
> capable of differentiation between valid and unknown values. If the objective
> is to determine for the purposes of information only which register value are
> valid independent of their value; therefore wonder if it may make sense to
> simply define a new server/target message function which requests the list of
> the validity of the register values, analogously it's request for their
> values, as today it's incapable of differentiation between valid and invalid
> ones if encoded into the value representation itself.)
Where upon a little more thought, if the objective is to enable gdb to
represent, track, and manipulate "unknown" values, it's likely most flexibly
done by representing all debug-values as text strings, expressed in whatever
radix required to precisely represent the value to the precision desired;
where then in addition to numerical digits, X's may represent
correspondingly unknown/indeterminate values, likely also useful when
interfacing with simulators analogously capable; but would require a fairly
large overhaul to accomplish, however until then if x's are treated as 0's
or whatever, might as well transmit the value desired to be assumed to begin
with, and not pretend anything would be accomplished otherwise, I would
think.)
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: RFA: Recognize 'x' in response to 'p' packet
2004-12-23 17:22 ` Daniel Jacobowitz
@ 2004-12-28 13:15 ` Jim Blandy
0 siblings, 0 replies; 17+ messages in thread
From: Jim Blandy @ 2004-12-28 13:15 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches
Daniel Jacobowitz <drow@false.org> writes:
> On Thu, Dec 23, 2004 at 11:25:51AM -0500, Jim Blandy wrote:
> > Jim Blandy <jimb@redhat.com> writes:
> >
> > > Daniel Jacobowitz <drow@false.org> writes:
> > > > My real question, though, is what you needed this for - and whether
> > > > marking the register unavailable fixes it.
> > >
> > > The Red Hat Debug Agent generates replies to 'p' packets that contain
> > > 'x's. GDB generally seems to work, but 'info thread' fares poorly.
> > > Simply parsing the response at all should fix the problem; I'll make
> > > sure that marking the register as unavailable doesn't cause any new
> > > problems.
> > >
> > > Thanks for the review!
> >
> > Okay, here's the revised patch, against the properly re-indented
> > sources. Tested against RDA.
> >
> > 2004-12-17 Jim Blandy <jimb@redhat.com>
> >
> > * remote.c (fetch_register_using_p): Recognize a register value
> > starting with 'x' as indicating an unfetchable register.
>
> OK, thanks! I will be getting around to adding 'p' to gdbserver soon,
> so I'll need this too.
Committed --- thanks for the review.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: RFA: Recognize 'x' in response to 'p' packet
2004-12-23 16:43 ` Jim Blandy
@ 2004-12-23 17:22 ` Daniel Jacobowitz
2004-12-28 13:15 ` Jim Blandy
0 siblings, 1 reply; 17+ messages in thread
From: Daniel Jacobowitz @ 2004-12-23 17:22 UTC (permalink / raw)
To: gdb-patches
On Thu, Dec 23, 2004 at 11:25:51AM -0500, Jim Blandy wrote:
> Jim Blandy <jimb@redhat.com> writes:
>
> > Daniel Jacobowitz <drow@false.org> writes:
> > > My real question, though, is what you needed this for - and whether
> > > marking the register unavailable fixes it.
> >
> > The Red Hat Debug Agent generates replies to 'p' packets that contain
> > 'x's. GDB generally seems to work, but 'info thread' fares poorly.
> > Simply parsing the response at all should fix the problem; I'll make
> > sure that marking the register as unavailable doesn't cause any new
> > problems.
> >
> > Thanks for the review!
>
> Okay, here's the revised patch, against the properly re-indented
> sources. Tested against RDA.
>
> 2004-12-17 Jim Blandy <jimb@redhat.com>
>
> * remote.c (fetch_register_using_p): Recognize a register value
> starting with 'x' as indicating an unfetchable register.
OK, thanks! I will be getting around to adding 'p' to gdbserver soon,
so I'll need this too.
--
Daniel Jacobowitz
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: RFA: Recognize 'x' in response to 'p' packet
2004-12-21 21:30 ` Jim Blandy
@ 2004-12-23 16:43 ` Jim Blandy
2004-12-23 17:22 ` Daniel Jacobowitz
0 siblings, 1 reply; 17+ messages in thread
From: Jim Blandy @ 2004-12-23 16:43 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches
Jim Blandy <jimb@redhat.com> writes:
> Daniel Jacobowitz <drow@false.org> writes:
> > My real question, though, is what you needed this for - and whether
> > marking the register unavailable fixes it.
>
> The Red Hat Debug Agent generates replies to 'p' packets that contain
> 'x's. GDB generally seems to work, but 'info thread' fares poorly.
> Simply parsing the response at all should fix the problem; I'll make
> sure that marking the register as unavailable doesn't cause any new
> problems.
>
> Thanks for the review!
Okay, here's the revised patch, against the properly re-indented
sources. Tested against RDA.
2004-12-17 Jim Blandy <jimb@redhat.com>
* remote.c (fetch_register_using_p): Recognize a register value
starting with 'x' as indicating an unfetchable register.
Index: gdb/remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.156
diff -c -p -r1.156 remote.c
*** gdb/remote.c 21 Dec 2004 21:24:56 -0000 1.156
--- gdb/remote.c 23 Dec 2004 15:43:46 -0000
*************** fetch_register_using_p (int regnum)
*** 3192,3216 ****
p += hexnumstr (p, regnum);
*p++ = '\0';
remote_send (buf, rs->remote_packet_size);
! if (buf[0] != 0 && buf[0] != 'E')
{
! p = buf;
! i = 0;
! while (p[0] != 0)
! {
! if (p[1] == 0)
! {
! error ("fetch_register_using_p: early buf termination");
! return 0;
! }
! regp[i++] = fromhex (p[0]) * 16 + fromhex (p[1]);
! p += 2;
! }
! regcache_raw_supply (current_regcache, regnum, regp);
return 1;
}
! return 0;
}
static void
--- 3192,3227 ----
p += hexnumstr (p, regnum);
*p++ = '\0';
remote_send (buf, rs->remote_packet_size);
!
! /* If the stub didn't recognize the packet, or if we got an error,
! tell our caller. */
! if (buf[0] == '\0' || buf[0] == 'E')
! return 0;
!
! /* If this register is unfetchable, tell the regcache. */
! if (buf[0] == 'x')
{
! regcache_raw_supply (current_regcache, regnum, NULL);
! set_register_cached (regnum, -1);
return 1;
}
! /* Otherwise, parse and supply the value. */
! p = buf;
! i = 0;
! while (p[0] != 0)
! {
! if (p[1] == 0)
! {
! error("fetch_register_using_p: early buf termination");
! return 0;
! }
!
! regp[i++] = fromhex (p[0]) * 16 + fromhex (p[1]);
! p += 2;
! }
! regcache_raw_supply (current_regcache, regnum, regp);
! return 1;
}
static void
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: RFA: Recognize 'x' in response to 'p' packet
2004-12-18 1:24 ` Daniel Jacobowitz
@ 2004-12-21 21:30 ` Jim Blandy
2004-12-23 16:43 ` Jim Blandy
0 siblings, 1 reply; 17+ messages in thread
From: Jim Blandy @ 2004-12-21 21:30 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches
Daniel Jacobowitz <drow@false.org> writes:
> My real question, though, is what you needed this for - and whether
> marking the register unavailable fixes it.
The Red Hat Debug Agent generates replies to 'p' packets that contain
'x's. GDB generally seems to work, but 'info thread' fares poorly.
Simply parsing the response at all should fix the problem; I'll make
sure that marking the register as unavailable doesn't cause any new
problems.
Thanks for the review!
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: RFA: Recognize 'x' in response to 'p' packet
2004-12-17 22:45 ` Jim Blandy
@ 2004-12-18 1:24 ` Daniel Jacobowitz
2004-12-21 21:30 ` Jim Blandy
0 siblings, 1 reply; 17+ messages in thread
From: Daniel Jacobowitz @ 2004-12-18 1:24 UTC (permalink / raw)
To: Jim Blandy; +Cc: gdb-patches
On Fri, Dec 17, 2004 at 05:35:23PM -0500, Jim Blandy wrote:
> Daniel Jacobowitz <drow@false.org> writes:
> > I know this came up a bit already, but could you elaborate on why you
> > had to silently provide a value of 0? We do have a defined interface
> > for 'currently not available', though we do not use it well. This
> > isn't support for the xx response, just a workaround.
>
> I just missed it. Is this (untested!) what you're looking for?
>
> 2004-12-17 Jim Blandy <jimb@redhat.com>
>
> * remote.c (fetch_register_using_p): Recognize a register value
> starting with 'x' as indicating an unfetchable register.
More or less. Spelling, formatting, and the fallthrough here:
> ! /* If this register is unfetchable, tell the regcache. */
> ! if (buf[0] == 'x')
> ! {
> ! regcache_raw_supply (current_regcache, regnum, NULL);
> ! set_register_cached (regnum, -1);
return <something>;
> }
>
> ! /* Otherwise, parse and supply the value. */
My real question, though, is what you needed this for - and whether
marking the register unavailable fixes it.
--
Daniel Jacobowitz
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: RFA: Recognize 'x' in response to 'p' packet
2004-12-17 22:20 ` Daniel Jacobowitz
@ 2004-12-17 22:45 ` Jim Blandy
2004-12-18 1:24 ` Daniel Jacobowitz
0 siblings, 1 reply; 17+ messages in thread
From: Jim Blandy @ 2004-12-17 22:45 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches
Daniel Jacobowitz <drow@false.org> writes:
> I know this came up a bit already, but could you elaborate on why you
> had to silently provide a value of 0? We do have a defined interface
> for 'currently not available', though we do not use it well. This
> isn't support for the xx response, just a workaround.
I just missed it. Is this (untested!) what you're looking for?
2004-12-17 Jim Blandy <jimb@redhat.com>
* remote.c (fetch_register_using_p): Recognize a register value
starting with 'x' as indicating an unfetchable register.
Index: gdb/remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.155
diff -c -p -r1.155 remote.c
*** gdb/remote.c 17 Dec 2004 22:19:51 -0000 1.155
--- gdb/remote.c 17 Dec 2004 22:31:09 -0000
*************** fetch_register_using_p (int regnum)
*** 3192,3213 ****
p += hexnumstr (p, regnum);
*p++ = '\0';
remote_send (buf, rs->remote_packet_size);
! if (buf[0] != 0 && buf[0] != 'E') {
! p = buf;
! i = 0;
! while (p[0] != 0) {
! if (p[1] == 0) {
! error("fetch_register_using_p: early buf termination");
! return 0;
! }
! regp[i++] = fromhex (p[0]) * 16 + fromhex (p[1]);
! p += 2;
}
- regcache_raw_supply (current_regcache, regnum, regp);
- return 1;
- }
! return 0;
}
static void
--- 3192,3224 ----
p += hexnumstr (p, regnum);
*p++ = '\0';
remote_send (buf, rs->remote_packet_size);
!
! /* If the stub didn't recognize the packet, or if we got an error,
! tell our caler. */
! if (buf[0] == '\0' || buf[0] == 'E')
! return 0;
!
! /* If this register is unfetchable, tell the regcache. */
! if (buf[0] == 'x')
! {
! regcache_raw_supply (current_regcache, regnum, NULL);
! set_register_cached (regnum, -1);
}
! /* Otherwise, parse and supply the value. */
! p = buf;
! i = 0;
! while (p[0] != 0) {
! if (p[1] == 0) {
! error("fetch_register_using_p: early buf termination");
! return 0;
! }
!
! regp[i++] = fromhex (p[0]) * 16 + fromhex (p[1]);
! p += 2;
! }
! regcache_raw_supply (current_regcache, regnum, regp);
! return 1;
}
static void
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: RFA: Recognize 'x' in response to 'p' packet
2004-12-16 21:35 ` Jim Blandy
@ 2004-12-17 22:20 ` Daniel Jacobowitz
2004-12-17 22:45 ` Jim Blandy
0 siblings, 1 reply; 17+ messages in thread
From: Daniel Jacobowitz @ 2004-12-17 22:20 UTC (permalink / raw)
To: Jim Blandy; +Cc: gdb-patches
On Thu, Dec 16, 2004 at 04:12:00PM -0500, Jim Blandy wrote:
>
> Ping.
>
> Jim Blandy <jimb@redhat.com> writes:
>
> > 2004-12-02 Jim Blandy <jimb@redhat.com>
> >
> > * 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.
I know this came up a bit already, but could you elaborate on why you
had to silently provide a value of 0? We do have a defined interface
for 'currently not available', though we do not use it well. This
isn't support for the xx response, just a workaround.
--
Daniel Jacobowitz
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: RFA: Recognize 'x' in response to 'p' packet
2004-12-03 0:22 Jim Blandy
@ 2004-12-16 21:35 ` Jim Blandy
2004-12-17 22:20 ` Daniel Jacobowitz
0 siblings, 1 reply; 17+ messages in thread
From: Jim Blandy @ 2004-12-16 21:35 UTC (permalink / raw)
To: gdb-patches
Ping.
Jim Blandy <jimb@redhat.com> writes:
> 2004-12-02 Jim Blandy <jimb@redhat.com>
>
> * 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.
>
> Index: gdb/remote.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/remote.c,v
> retrieving revision 1.152
> diff -c -p -r1.152 remote.c
> *** gdb/remote.c 27 Oct 2004 20:03:50 -0000 1.152
> --- gdb/remote.c 3 Dec 2004 00:21:15 -0000
> *************** fetch_register_using_p (int regnum)
> *** 3189,3194 ****
> --- 3189,3198 ----
> error("fetch_register_using_p: early buf termination");
> return 0;
> }
> + if (p[0] == 'x' && p[1] == 'x')
> + /* Invalid register value. */
> + regp[i++] = 0; /* 'x' */
> + else
> regp[i++] = fromhex (p[0]) * 16 + fromhex (p[1]);
> p += 2;
> }
^ permalink raw reply [flat|nested] 17+ messages in thread
* RFA: Recognize 'x' in response to 'p' packet
@ 2004-12-03 0:22 Jim Blandy
2004-12-16 21:35 ` Jim Blandy
0 siblings, 1 reply; 17+ messages in thread
From: Jim Blandy @ 2004-12-03 0:22 UTC (permalink / raw)
To: gdb-patches
2004-12-02 Jim Blandy <jimb@redhat.com>
* 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.
Index: gdb/remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.152
diff -c -p -r1.152 remote.c
*** gdb/remote.c 27 Oct 2004 20:03:50 -0000 1.152
--- gdb/remote.c 3 Dec 2004 00:21:15 -0000
*************** fetch_register_using_p (int regnum)
*** 3189,3194 ****
--- 3189,3198 ----
error("fetch_register_using_p: early buf termination");
return 0;
}
+ if (p[0] == 'x' && p[1] == 'x')
+ /* Invalid register value. */
+ regp[i++] = 0; /* 'x' */
+ else
regp[i++] = fromhex (p[0]) * 16 + fromhex (p[1]);
p += 2;
}
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2004-12-28 9:10 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-03 1:29 RFA: Recognize 'x' in response to 'p' packet Paul Schlie
2004-12-03 4:32 ` Steven Johnson
2004-12-03 4:54 ` Paul Schlie
2004-12-03 13:57 ` Daniel Jacobowitz
2004-12-03 21:48 ` Michael Snyder
2004-12-03 21:45 ` Michael Snyder
2004-12-03 22:53 ` Paul Schlie
2004-12-03 23:44 ` Paul Schlie
-- strict thread matches above, loose matches on Subject: below --
2004-12-03 0:22 Jim Blandy
2004-12-16 21:35 ` Jim Blandy
2004-12-17 22:20 ` Daniel Jacobowitz
2004-12-17 22:45 ` Jim Blandy
2004-12-18 1:24 ` Daniel Jacobowitz
2004-12-21 21:30 ` Jim Blandy
2004-12-23 16:43 ` Jim Blandy
2004-12-23 17:22 ` Daniel Jacobowitz
2004-12-28 13:15 ` Jim Blandy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox