Kevin Buettner | 30 Jul 2012 22:49
Picon
Favicon

[RFC] arm sim: Adjust return values in sim_{fetch,store}_register

The change, below, to sim_store_register() fixes the following
GDB internal error for an arm-eabi target:

remote-sim.c:531: internal-error: Register 14 not updated

On the GDB side of things, remote-sim.c now requires that
sim_store_register() return the length of the register being stored. 
(This requirement has been in place for quite a while now.)  Returning
a value less than zero triggers an internal error.  Returning 0
triggers a warning.

The change to sim_fetch_register() is not strictly required, though
the comments in remote-sim.c suggests that return of -1 might be
considered to be broken at some point too.

The include of libiberty.h fixes a warning regarding xstrdup() that I
noticed during a rebuild.  I can post this separately if desired.

Comments?

Kevin

sim/arm/ChangeLog:

	* wrapper.c (libiberty.h): Include.
	(sim_store_register, sim_fetch_register): On success, return
	length, instead of -1.

Index: arm/wrapper.c
===================================================================
(Continue reading)

Mike Frysinger | 31 Jul 2012 17:32
Picon
Favicon
Gravatar

Re: [RFC] arm sim: Adjust return values in sim_{fetch,store}_register

On Monday 30 July 2012 16:49:26 Kevin Buettner wrote:
> The change, below, to sim_store_register() fixes the following
> GDB internal error for an arm-eabi target:
> 
> remote-sim.c:531: internal-error: Register 14 not updated
> 
> On the GDB side of things, remote-sim.c now requires that
> sim_store_register() return the length of the register being stored.
> (This requirement has been in place for quite a while now.)  Returning
> a value less than zero triggers an internal error.  Returning 0
> triggers a warning.
> 
> The change to sim_fetch_register() is not strictly required, though
> the comments in remote-sim.c suggests that return of -1 might be
> considered to be broken at some point too.
> 
> The include of libiberty.h fixes a warning regarding xstrdup() that I
> noticed during a rebuild.  I can post this separately if desired.

LGTM.  also looks like i need to update the Blackfin port :).
-mike
Kevin Buettner | 1 Aug 2012 16:39
Picon
Favicon

Re: [RFC] arm sim: Adjust return values in sim_{fetch,store}_register

On Tue, 31 Jul 2012 11:32:24 -0400
Mike Frysinger <vapier <at> gentoo.org> wrote:

> LGTM.  also looks like i need to update the Blackfin port :).
> -mike

Thanks for looking it over.

I've committed this change.

Kevin


Gmane