This is the mail archive of the gdb-patches@sourceware.org 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: [PATCH, RFC] Changes to sim_store_register API


Hi,

Updated patch, I also realise I forgot a changelog entry - I've included one below.

I'm currently using this code in a company branch of gdb. For this patch off mainline I've tested building a few different gdb targets and am currently working on setting up a cross-compiler tool chain so I can run some simulator tests.
While I'm doing that if anyone would like to review this and give any feedback, then I can make any changes needed.

Thanks,

Andrew

ChangeLog Entries:

gdb/ChangeLog : 

2010-11-16  Andrew Burgess <aburgess@broadcom.com>

	* remote-sim.c (gdbsim_store_register): Update API to 
	  sim_store_register to check more error conditions.

sim/erc32/ChangeLog :

2010-11-16  Andrew Burgess <aburgess@broadcom.com>

	* interf.c (sim_store_register): Update return value to 
	  match new API. 

sim/h8300/ChangeLog :

2010-11-16  Andrew Burgess <aburgess@broadcom.com>

	* compile.c (sim_store_register): Update return value to 
	  match new API. 

sim/m32c/ChangesLog : 

2010-11-16  Andrew Burgess <aburgess@broadcom.com>

	* gdb-if.c (sim_store_register): Update return value to 
	  match new API. 

sim/mn10300/ChangeLog : 

2010-11-16  Andrew Burgess <aburgess@broadcom.com>

	* interp.c (sim_store_register): Update return value to 
	  match new API. 

sim/ppc/ChangeLog : 

2010-11-16  Andrew Burgess <aburgess@broadcom.com>

	* gdb-sim.c (sim_store_register): Update return value to 
	  match new API. 

sim/rx/ChangeLog :

2010-11-16  Andrew Burgess  <aburgess@broadcom.com>

	* gdb-if.c (sim_store_register): Update return value to
	  match new API.

sim/v850/ChangeLog : 

2010-11-16  Andrew Burgess  <aburgess@broadcom.com>

	* interp.c (sim_store_register): Update return value to
	  match new API.

> -----Original Message-----
> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] On Behalf Of Andrew Burgess
> Sent: 08 November 2010 08:12
> To: gdb-patches@sourceware.org
> Subject: [PATCH, RFC] Changes to sim_store_register API
> 
> The current API to sim_store_register returns the length of the
> register that was updated. However if the length returned is <= 0 then
> this is acceptable. Some simulators return 0 or -1 even on a successful
> register write.
> 
> I would like to propose the following changes,
> 
> (1) As the length of the register to be written is already passed into
> sim_store_register all simulators should return that length if they
> successfully update the register.
> (2) If a length of 0 is returned this indicates that the simulator
> understood the request but couldn't update the register, this might
> mean that the register is read only, or just that updating of this
> register has not been implemented yet; in this case gdb will give a
> warning that the register has not been updated and continue.
> (3) If a length of -1 is returned this indicates that the simulator
> didn't understand the request or some other non-recoverable error has
> occurred; in this case gdb will quit with an error.
> 
> The attached patch implements this change and updates the existing
> simulators to either return the length in the case of success or to
> return 0 for errors.
> 
> I would welcome your feedback and suggestions.
> 
> I would be happy to update the fetch register case in a similar fashion
> but thought I'd start small to begin with.
> 
> Thanks,
> Andrew

Attachment: gdb-sim-store.patch;size=4064;creation-date="Tue,
Description: gdb-sim-store.patch


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