From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25963 invoked by alias); 18 Aug 2002 17:46:24 -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 25954 invoked from network); 18 Aug 2002 17:46:23 -0000 Received: from unknown (HELO localhost.redhat.com) (24.112.240.27) by sources.redhat.com with SMTP; 18 Aug 2002 17:46:23 -0000 Received: from ges.redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 3D9193CFA; Sun, 18 Aug 2002 13:46:17 -0400 (EDT) Message-ID: <3D5FDD69.7000102@ges.redhat.com> Date: Sun, 18 Aug 2002 10:46: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] Remove some write_register_bytes occurences from i386-tdep.c References: <200208181718.g7IHIrg6029437@elgar.kettenis.dyndns.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-08/txt/msg00512.txt.bz2 > This replaces two write_register_bytes invocations with > write_register_gen. The remaining occurences are in principle > legitimate calls to write_register_bytes, since the intent *is* a > partial update of a register. Of course I can "open code" these calls > if that's desirable. > > Checked in. > > Mark > > Index: ChangeLog > from Mark Kettenis > * i386-tdep.c (i386_do_pop_frame, i386_store_return_value): Call > write_register_gen instead of write_register_bytes. Hmm, [change-request bug report] pop_frame and store_return_value are going to need the same treatment as was given to extract_return_value() -- add a regcache parameter so that the registers can be directly written to the register cache. This reduces the reliance on a single global register cache. As for write_register_bytes() can it be avoided? I've just posted ``regcache_cooked_write_with_offset_hack(). But I don't think that hack is right here. Perhaphs a single register read - modify - write function is needed? Andrew > Index: i386-tdep.c > =================================================================== > RCS file: /cvs/src/src/gdb/i386-tdep.c,v > retrieving revision 1.81 > diff -u -p -r1.81 i386-tdep.c > --- i386-tdep.c 17 Aug 2002 11:39:38 -0000 1.81 > +++ i386-tdep.c 18 Aug 2002 17:15:10 -0000 > @@ -833,8 +833,7 @@ i386_do_pop_frame (struct frame_info *fr > if (addr) > { > read_memory (addr, regbuf, REGISTER_RAW_SIZE (regnum)); > - write_register_bytes (REGISTER_BYTE (regnum), regbuf, > - REGISTER_RAW_SIZE (regnum)); > + write_register_gen (regnum, regbuf); > } > } > write_register (FP_REGNUM, read_memory_integer (fp, 4)); > @@ -1003,8 +1002,7 @@ i386_store_return_value (struct type *ty > not exactly how it would happen on the target itself, but > it is the best we can do. */ > convert_typed_floating (valbuf, type, buf, builtin_type_i387_ext); > - write_register_bytes (REGISTER_BYTE (FP0_REGNUM), buf, > - FPU_REG_RAW_SIZE); > + write_register_gen (FP0_REGNUM, buf); > > /* Set the top of the floating-point register stack to 7. The > actual value doesn't really matter, but 7 is what a normal >