This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC/RFA] fix calculation of sizeof_g_packet


On Tue, 3 Jun 2003, Andrew Cagney wrote:

:)> On Tue, 3 Jun 2003, Andrew Cagney wrote:
:)> 
:)> :) > The attached patch changes init_remote_state() so that sizeof_g_packet
:)> :) > computed using REGISTER_RAW_SIZE() instead of blindly set to
:)> :) > DEPRECATED_REGISTER_BYTES.
:)> :) >
:)> :) > I'm assuming two things which I'm not sure are true:
:)> :) >
:)> :) > 1) REGISTER_RAW_SIZE() is usable for all targets now
:)> :) >
:)> :) > 2) REGISTER_RAW_SIZE() is valid when passed pseudo register.
:)> :) >
:)> :) > Ok to commit?
:)> :)
:)> :) Just a few tweaks.
:)> 
:)> 
:)> :) > -  /* Start out by having the remote protocol mimic the existing
:)> :) > -     behavour - just copy in the description of the register cache.  */
:)> :) > -  rs->sizeof_g_packet = DEPRECATED_REGISTER_BYTES; /* OK */
:)> :) > +  rs->sizeof_g_packet = 0;
:)> :)
:)> :) For the moment it is safer to do:
:)> :)
:)> :) 	if (DEPRECATED_REGISTER_BYTES_P ())
:)> :) 	  rs-> ... = ...;
:)> :) 	else
:)> :) 	  rs-> ... = 0;
:)> 
:)> Well, DEPRECATED_REGISTER_BYTES_P() doesn't seem to exist.
:)> So there should need to be a change in gdbarch.sh I assume.
:)
:)Doh, sorry.  Easier to just test for a non-zero value:
:)
:)	if (DEPRECATED_REGISTER_BYTES == 0)
:)
:)With that yes, definitly approved.
:)
:)Andrew

Ok. 

I've committed the attached.

Ted Roth

2003-06-03  Theodore A. Roth  <troth@openavr.org>
                                                                               
        * remote.c (init_remote_state): Compute sizeof_g_packet by
        accumulation of the size of all registers instead of blindly using
        DEPRECATED_REGISTER_BYTES.

Attachment: sizeof-g-packet-fix-3.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]