From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13801 invoked by alias); 20 Jun 2003 14:19:30 -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 13709 invoked from network); 20 Jun 2003 14:19:27 -0000 Received: from unknown (HELO localhost.redhat.com) (24.157.166.107) by sources.redhat.com with SMTP; 20 Jun 2003 14:19:27 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 813A62B5F; Fri, 20 Jun 2003 10:19:20 -0400 (EDT) Message-ID: <3EF317E8.8070209@redhat.com> Date: Fri, 20 Jun 2003 14:19:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030223 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Theodore A. Roth" Cc: gdb-patches@sources.redhat.com Subject: Re: [RFC:avr] use regcache instead of read_register References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-06/txt/msg00654.txt.bz2 > Hi, > > The ARI caught this and it seems like a trivial change. There is a bit of > confusion though in the use of current_regcache since the ARI says this: > > current regcache 57 Replace current_regcache with explict parameter > > What would that explicit parameter be? > > If this patch is ok, it brings the ARI count for the AVR down to 0. The patch is great. Don't be too worried about current_regcache for the moment. As for what parameter will be added to read_pc, I can give you several guesses: - made redundant by unwind_pc(frame) - replaced with something that takes the thread id and stop status The underlying problem is decr pc after break. Cleaning up that also involves read_pc, write_pc, and the update frame pc hack. Andrew > 2003-06-19 Theodore A. Roth > > * avr-tdep.c (avr_read_pc): Use regcache instead of read_register. > (avr_read_sp): Ditto. > > > > > 2003-06-19 Theodore A. Roth > > * avr-tdep.c (avr_read_pc): Use regcache instead of read_register. > (avr_read_sp): Ditto. > > Index: avr-tdep.c > =================================================================== > RCS file: /cvs/src/src/gdb/avr-tdep.c,v > retrieving revision 1.64 > diff -u -r1.64 avr-tdep.c > --- avr-tdep.c 20 Jun 2003 05:53:42 -0000 1.64 > +++ avr-tdep.c 20 Jun 2003 06:09:27 -0000 > @@ -324,12 +324,12 @@ > avr_read_pc (ptid_t ptid) > { > ptid_t save_ptid; > - CORE_ADDR pc; > + ULONGEST pc; > CORE_ADDR retval; > > save_ptid = inferior_ptid; > inferior_ptid = ptid; > - pc = (int) read_register (AVR_PC_REGNUM); > + regcache_cooked_read_unsigned (current_regcache, AVR_PC_REGNUM, &pc); > inferior_ptid = save_ptid; > retval = avr_make_iaddr (pc); > return retval; > @@ -349,7 +349,10 @@ > static CORE_ADDR > avr_read_sp (void) > { > - return (avr_make_saddr (read_register (AVR_SP_REGNUM))); > + ULONGEST sp; > + > + regcache_cooked_read_unsigned (current_regcache, AVR_SP_REGNUM, &sp); > + return (avr_make_saddr (sp)); > } > > static int