From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5749 invoked by alias); 16 May 2002 22:33:52 -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 5701 invoked from network); 16 May 2002 22:33:50 -0000 Received: from unknown (HELO zwingli.cygnus.com) (208.245.165.35) by sources.redhat.com with SMTP; 16 May 2002 22:33:50 -0000 Received: by zwingli.cygnus.com (Postfix, from userid 442) id 90D2B5EA11; Thu, 16 May 2002 17:33:49 -0500 (EST) To: Daniel Jacobowitz Cc: Elena Zannoni , gdb-patches@sources.redhat.com Subject: Re: [RFA] [4/5] Use DWARF-2 DW_AT_artificial information References: <20020115153157.A28714@nevyn.them.org> <20020307154311.A19496@nevyn.them.org> <20020514211335.GA11766@nevyn.them.org> <15585.58783.368594.458392@localhost.redhat.com> <20020515045247.GA14330@nevyn.them.org> <15586.42427.974873.473657@localhost.redhat.com> <20020515185143.GA31364@nevyn.them.org> From: Jim Blandy Date: Thu, 16 May 2002 15:33:00 -0000 In-Reply-To: <20020515185143.GA31364@nevyn.them.org> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-05/txt/msg00671.txt.bz2 Possibly clueless suggestion: Couldn't we represent a method's arguments the same way we represent a function's arguments? That is, nfields would carry the number of arguments, and fields[i] would describe the n'th field. We could use the `artificial' member of `union field_location' in `struct field' to hold the information conveyed by DW_AT_artificial. The fact that we've distinguished these has caused problems in the past. Check out the following code in hand_function_call: for (i = nargs - 1; i >= 0; i--) { /* Assume that methods are always prototyped, unless they are off the end (which we should only be allowing if there is a ``...''). FIXME. */ if (TYPE_CODE (ftype) == TYPE_CODE_METHOD) { if (i < n_method_args) args[i] = value_arg_coerce (args[i], TYPE_ARG_TYPES (ftype)[i], 1); else args[i] = value_arg_coerce (args[i], NULL, 0); } /* If we're off the end of the known arguments, do the standard promotions. FIXME: if we had a prototype, this should only be allowed if ... were present. */ if (i >= TYPE_NFIELDS (ftype)) args[i] = value_arg_coerce (args[i], NULL, 0); else { param_type = TYPE_FIELD_TYPE (ftype, i); args[i] = value_arg_coerce (args[i], param_type, TYPE_PROTOTYPED (ftype)); } Those two loops could be re-collapsed into one.