From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32552 invoked by alias); 25 Aug 2002 01:31:32 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 32537 invoked from network); 25 Aug 2002 01:31:26 -0000 Received: from unknown (HELO localhost.redhat.com) (24.112.240.27) by sources.redhat.com with SMTP; 25 Aug 2002 01:31:26 -0000 Received: from ges.redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id CA6093DF5; Sat, 24 Aug 2002 20:18:50 -0400 (EDT) Message-ID: <3D68226A.2090601@ges.redhat.com> Date: Sat, 24 Aug 2002 18:31:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020810 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Mark Kettenis Cc: gdb-patches@sources.redhat.com Subject: Re: [PATCH/RFA] regcache_raw_write_signed and regcache_raw_write_unsigned References: <200208241505.g7OF51ma070689@elgar.kettenis.dyndns.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-08/txt/msg00806.txt.bz2 > To supplement regcache_raw_read_signed and regcache_raw_read_unsigned. > They would be might convenient for me as a replacement for > write_register. > > OK to check this in? Yep! Andrew > Index: ChangeLog > from Mark Kettenis > > * regcache.c (regcache_raw_write_signed, > regcache_raw_write_unsigned): New functions. > * regcache.h (regcache_raw_write_signed, > regcache_raw_write_unsigned): New prototypes. > > Index: regcache.c > =================================================================== > RCS file: /cvs/src/src/gdb/regcache.c,v > retrieving revision 1.54 > diff -u -p -r1.54 regcache.c > --- regcache.c 19 Aug 2002 00:43:41 -0000 1.54 > +++ regcache.c 24 Aug 2002 15:00:26 -0000 > @@ -693,6 +693,29 @@ regcache_raw_read_unsigned (struct regca > } > > void > +regcache_raw_write_signed (struct regcache *regcache, int regnum, LONGEST val) > +{ > + void *buf; > + gdb_assert (regcache != NULL); > + gdb_assert (regnum >=0 && regnum < regcache->descr->nr_raw_registers); > + buf = alloca (regcache->descr->sizeof_register[regnum]); > + store_signed_integer (buf, regcache->descr->sizeof_register[regnum], val); > + regcache_raw_write (regcache, regnum, buf); > +} > + > +void > +regcache_raw_write_unsigned (struct regcache *regcache, int regnum, > + ULONGEST val) > +{ > + void *buf; > + gdb_assert (regcache != NULL); > + gdb_assert (regnum >=0 && regnum < regcache->descr->nr_raw_registers); > + buf = alloca (regcache->descr->sizeof_register[regnum]); > + store_unsigned_integer (buf, regcache->descr->sizeof_register[regnum], val); > + regcache_raw_write (regcache, regnum, buf); > +} > + > +void > read_register_gen (int regnum, char *buf) > { > gdb_assert (current_regcache != NULL); > Index: regcache.h > =================================================================== > RCS file: /cvs/src/src/gdb/regcache.h,v > retrieving revision 1.15 > diff -u -p -r1.15 regcache.h > --- regcache.h 19 Aug 2002 00:43:41 -0000 1.15 > +++ regcache.h 24 Aug 2002 15:00:26 -0000 > @@ -42,6 +42,10 @@ extern void regcache_raw_read_signed (st > int regnum, LONGEST *val); > extern void regcache_raw_read_unsigned (struct regcache *regcache, > int regnum, ULONGEST *val); > +extern void regcache_raw_write_signed (struct regcache *regcache, > + int regnum, LONGEST val); > +extern void regcache_raw_write_unsigned (struct regcache *regcache, > + int regnum, ULONGEST val); > > /* Partial transfer of a raw registers. These perform read, modify, > write style operations. */ > >