From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27642 invoked by alias); 28 Aug 2002 22:25: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 27634 invoked from network); 28 Aug 2002 22:25:51 -0000 Received: from unknown (HELO jackfruit.Stanford.EDU) (171.64.38.136) by sources.redhat.com with SMTP; 28 Aug 2002 22:25:51 -0000 Received: (from carlton@localhost) by jackfruit.Stanford.EDU (8.11.6/8.11.6) id g7SMPoF17606; Wed, 28 Aug 2002 15:25:50 -0700 X-Authentication-Warning: jackfruit.Stanford.EDU: carlton set sender to carlton@math.stanford.edu using -f To: gdb-patches@sources.redhat.com Subject: [David Carlton ] Re: [RFA] dwarf2read.c: set TYPE_DOMAIN_TYPE correctly for methods Cc: Daniel Jacobowitz From: David Carlton Date: Wed, 28 Aug 2002 15:42:00 -0000 Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-SW-Source: 2002-08/txt/msg00957.txt.bz2 --=-=-= Content-length: 438 Here's a ping for a patch that I'd like to get in before the 5.3 branch is cut; I'm sending the ping now even though I originally sent the patch out just under a week ago because I'll be out of the office through next Monday. (I'm not this pushy normally, honest.) The reason why I want to get this into the 5.3 branch is because it fixes a seg fault and seg faults make me unduly nervous. :-) David Carlton carlton@math.stanford.edu --=-=-= Content-Type: message/rfc822 Content-Disposition: inline Content-length: 5149 X-From-Line: gdb-patches-return-17966-carlton=math.stanford.edu@sources.redhat.com Thu Aug 22 14:24:17 2002 Received: from sources.redhat.com (sources.redhat.com [209.249.29.67]) by math.Stanford.EDU (8.9.1/8.9.1) with SMTP id OAA10871 for ; Thu, 22 Aug 2002 14:24:16 -0700 (PDT) Received: (qmail 22937 invoked by alias); 22 Aug 2002 21:24:19 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Delivered-To: mailing list gdb-patches@sources.redhat.com Received: (qmail 22929 invoked from network); 22 Aug 2002 21:24:19 -0000 Received: from unknown (HELO jackfruit.Stanford.EDU) (171.64.38.136) by sources.redhat.com with SMTP; 22 Aug 2002 21:24:19 -0000 Received: (from carlton@localhost) by jackfruit.Stanford.EDU (8.11.6/8.11.6) id g7MLOHW15810; Thu, 22 Aug 2002 14:24:17 -0700 X-Authentication-Warning: jackfruit.Stanford.EDU: carlton set sender to carlton@math.stanford.edu using -f To: Andrew Cagney Cc: Daniel Jacobowitz , gdb-patches@sources.redhat.com Subject: Re: [RFA] dwarf2read.c: set TYPE_DOMAIN_TYPE correctly for methods References: <20020822204211.GA31727@nevyn.them.org> <3D655311.6030603@ges.redhat.com> Cc: carlton@math.Stanford.EDU From: David Carlton Date: 22 Aug 2002 14:24:16 -0700 In-Reply-To: <3D655311.6030603@ges.redhat.com> Gnus-Warning: This is a duplicate of message Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp) Lines: 76 Xref: jackfruit.Stanford.EDU technical.gdb:788 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-length: 2974 In article <3D655311.6030603@ges.redhat.com>, Andrew Cagney writes: > The place to put comments explaining changes is in the source > code. ... > The ChangeLog need only state what changed, not why. Whoops, sorry about that. How about this patch? By the way, am I correct in thinking that the ChangeLog is supposed to mention the PR number? I noticed that GNATS picked up some of my earlier changes, and I'm assuming it noticed the PR number from the log message. David Carlton carlton@math.stanford.edu 2002-08-22 David Carlton * dwarf2read.c (dwarf2_add_member_fn): Add the 'type' argument (PR gdb/653). Update call to smash_to_method_type. (read_structure_scope): Update call to dwarf2_add_member_fn. Index: dwarf2read.c =================================================================== RCS file: /cvs/src/src/gdb/dwarf2read.c,v retrieving revision 1.65 diff -u -p -r1.65 dwarf2read.c --- dwarf2read.c 20 Aug 2002 18:45:30 -0000 1.65 +++ dwarf2read.c 22 Aug 2002 21:22:51 -0000 @@ -803,7 +803,8 @@ static void dwarf2_attach_fields_to_type struct type *, struct objfile *); static void dwarf2_add_member_fn (struct field_info *, - struct die_info *, struct objfile *objfile, + struct die_info *, struct type *, + struct objfile *objfile, const struct comp_unit_head *); static void dwarf2_attach_fn_fields_to_type (struct field_info *, @@ -2259,7 +2260,7 @@ dwarf2_attach_fields_to_type (struct fie static void dwarf2_add_member_fn (struct field_info *fip, struct die_info *die, - struct objfile *objfile, + struct type *type, struct objfile *objfile, const struct comp_unit_head *cu_header) { struct attribute *attr; @@ -2327,7 +2328,15 @@ dwarf2_add_member_fn (struct field_info struct type *return_type = TYPE_TARGET_TYPE (die->type); int nparams = TYPE_NFIELDS (die->type); - smash_to_method_type (fnp->type, die->type, + /* NOTE: carlton/2002-08-22: Previously, the second argument to + smash_to_method_type was die->type rather than type, and the + type argument to dwarf2_add_member_fn didn't exst. This is + incorrect: the second argument to smash_to_method_type should + be the type of the class that this is a method of, whereas + die->type is the type of the method itself. So we need to + pass that type in from read_structure_scope explicitly. See + PR gdb/653. */ + smash_to_method_type (fnp->type, type, TYPE_TARGET_TYPE (die->type), TYPE_FIELDS (die->type), TYPE_NFIELDS (die->type), @@ -2516,7 +2525,7 @@ read_structure_scope (struct die_info *d { /* C++ member function. */ process_die (child_die, objfile, cu_header); - dwarf2_add_member_fn (&fi, child_die, objfile, cu_header); + dwarf2_add_member_fn (&fi, child_die, type, objfile, cu_header); } else if (child_die->tag == DW_TAG_inheritance) { --=-=-=--