From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8047 invoked by alias); 2 Feb 2003 16:52:10 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 8015 invoked from network); 2 Feb 2003 16:51:59 -0000 Received: from unknown (HELO localhost.redhat.com) (24.157.209.173) by 172.16.49.205 with SMTP; 2 Feb 2003 16:51:59 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id BF3DF3CB1; Sun, 2 Feb 2003 11:14:29 -0500 (EST) Message-ID: <3E3D43E5.3060904@redhat.com> Date: Sun, 02 Feb 2003 16:52:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.1) Gecko/20021211 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Mark Kettenis Cc: drow@mvista.com, gdb@sources.redhat.com Subject: Re: RFC: Variables in blocks of registers References: <200302011448.h11EmCkP001176@elgar.kettenis.dyndns.org> <3E3BEC50.9040104@redhat.com> <20030201171001.GB29662@nevyn.them.org> <3E3C3200.8070803@redhat.com> <200302012235.h11MZ30D023842@elgar.kettenis.dyndns.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-02/txt/msg00029.txt.bz2 If only it were that easy. The dwarf2 reader, for instance, also contains the assumption that registers are allocated sequentially. Is the proposal to modify such readers so that they check against this next_allocated_regnum algorithm? Andrew > Index: findvar.c > =================================================================== > RCS file: /cvs/src/src/gdb/findvar.c,v > retrieving revision 1.44 > diff -u -p -r1.44 findvar.c > --- findvar.c 14 Jan 2003 00:49:03 -0000 1.44 > +++ findvar.c 1 Feb 2003 22:29:45 -0000 > @@ -753,17 +753,18 @@ value_from_register (struct type *type, > for (local_regnum = regnum; > value_bytes_copied < len; > (value_bytes_copied += REGISTER_RAW_SIZE (local_regnum), > - ++local_regnum)) > + local_regnum = gdbarch_next_allocated_regnum (current_gdbarch, > + local_regnum))) > { > + if (local_regnum == -1) > + return NULL; /* Register unknown. */ > + > get_saved_register (value_bytes + value_bytes_copied, > - &optim, > - &addr, > - frame, > - local_regnum, > + &optim, &addr, frame, local_regnum, > &lval); > > Index: valops.c > =================================================================== > RCS file: /cvs/src/src/gdb/valops.c,v > retrieving revision 1.89 > diff -u -p -r1.89 valops.c > --- valops.c 30 Jan 2003 16:44:20 -0000 1.89 > +++ valops.c 1 Feb 2003 22:29:47 -0000 > @@ -704,13 +704,17 @@ value_assign (struct value *toval, struc > /* Copy it out. */ > for (regno = reg_offset, amount_copied = 0; > amount_copied < amount_to_copy; > - amount_copied += REGISTER_RAW_SIZE (regno), regno++) > + (amount_copied += REGISTER_RAW_SIZE (regno), > + regno = gdbarch_next_allocated_regnum (current_gdbarch, regno))) > { > enum lval_type lval; > CORE_ADDR addr; > int optim; > int realnum; > - > + > + if (regno == -1) > + error ("Location of variable is unknown."); > + > /* Just find out where to put it. */ > frame_register (frame, regno, &optim, &lval, &addr, &realnum, > NULL); > > >