From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15318 invoked by alias); 28 Nov 2001 03:37:54 -0000 Mailing-List: contact gdb-patches-help@sourceware.cygnus.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 15295 invoked from network); 28 Nov 2001 03:37:53 -0000 Received: from unknown (HELO localhost.cygnus.com) (24.114.42.213) by hostedprojects.ges.redhat.com with SMTP; 28 Nov 2001 03:37:53 -0000 Received: from cygnus.com (localhost [127.0.0.1]) by localhost.cygnus.com (Postfix) with ESMTP id D41943DC2; Tue, 27 Nov 2001 22:37:52 -0500 (EST) Message-ID: <3C045C10.3020902@cygnus.com> Date: Thu, 15 Nov 2001 10:53:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:0.9.3) Gecko/20011020 X-Accept-Language: en-us MIME-Version: 1.0 To: Pierre Muller Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA 2nd try] tell in which register a register var is loaded. References: <4.2.0.58.20011120180519.016c6008@ics.u-strasbg.fr> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2001-11/txt/msg00307.txt.bz2 Message-ID: <20011115105300.zRjwkGwOctkC_TfOVjNsLZFFSz8YdfLRKfAL9jU-EBI@z> > This patch superseeds the previous one, > the lval_reg_frame_relative case was not handled correctly there. > > http://sources.redhat.com/ml/gdb-patches/2001-11/msg00301.html > > > Still no idea who should give an approval for this patch ? No one else did so ... > 2001-11-20 Pierre Muller > > * findvar.c (locate_var_value): specify in which register a register > variable is stored. Don't forget to ucase ``specify''. Hmm, can REGISTER_NAME (num) ever be invalid or is this just being careful? If the latter then can I suggest an assertion vis: gdb_assert (REGISTER_NAME (...) != NULL && *REGISTER_NAME (...) != '\0'); If the former then the test will need to be tweeked to check for both NULL and '\0'. Your choice. I don't think the ``$'' prefix is consistent with existing code - based mainly on a quick grep that didn't reveal any code doing this. (I don't actually have anything agains the convention though - just a separate change :-) Otherwize, yes, a much more helpful error message. enjoy, Andrew > Index: findvar.c > =================================================================== > RCS file: /cvs/src/src/gdb/findvar.c,v > retrieving revision 1.25 > diff -u -r1.25 findvar.c > --- findvar.c 2001/11/10 21:34:56 1.25 > +++ findvar.c 2001/11/20 17:04:06 > @@ -869,8 +869,20 @@ > switch (VALUE_LVAL (lazy_value)) > { > case lval_register: > + if (REGISTER_NAME (VALUE_REGNO (lazy_value))) > + error("Address requested for identifier \"%s\" which is in register $%s", > + SYMBOL_SOURCE_NAME (var), REGISTER_NAME (VALUE_REGNO (lazy_value))); > + else > + error ("Address requested for identifier \"%s\" which is in a register.", > + SYMBOL_SOURCE_NAME (var)); > + break; > + > case lval_reg_frame_relative: > - error ("Address requested for identifier \"%s\" which is in a register.", > + if (REGISTER_NAME (VALUE_FRAME_REGNUM (lazy_value))) > + error("Address requested for identifier \"%s\" which is in frame register $%s", > + SYMBOL_SOURCE_NAME (var), REGISTER_NAME (VALUE_FRAME_REGNUM (lazy_value))); > + else > + error ("Address requested for identifier \"%s\" which is in a register.", > SYMBOL_SOURCE_NAME (var)); > break; >