From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14953 invoked by alias); 1 Jun 2011 22:22:40 -0000 Received: (qmail 14945 invoked by uid 22791); 1 Jun 2011 22:22:39 -0000 X-SWARE-Spam-Status: No, hits=-5.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_BJ,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 01 Jun 2011 22:22:25 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p51MMPYv011089 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 1 Jun 2011 18:22:25 -0400 Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p51MMHno002426 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 1 Jun 2011 18:22:23 -0400 Message-ID: <4DE6BB98.5070901@redhat.com> Date: Wed, 01 Jun 2011 22:22:00 -0000 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc13 Lightning/1.0b3pre Thunderbird/3.1.10 MIME-Version: 1.0 To: Jan Kratochvil CC: gdb-patches@sourceware.org Subject: Re: regression: gdb.objc/basicclass.exp [Re: [RFA] "Error in re-setting breakpoint," c++/12750] References: <4DD6B72D.3060706@redhat.com> <4DE568A5.4000306@redhat.com> <20110601070737.GA29856@host1.jankratochvil.net> In-Reply-To: <20110601070737.GA29856@host1.jankratochvil.net> Content-Type: multipart/mixed; boundary="------------080507050308080902000704" X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-06/txt/msg00015.txt.bz2 This is a multi-part message in MIME format. --------------080507050308080902000704 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1760 On 06/01/2011 12:07 AM, Jan Kratochvil wrote: > -PASS: gdb.objc/basicclass.exp: resetting breakpoints when rerunning > -PASS: gdb.objc/basicclass.exp: continue until method breakpoint > -PASS: gdb.objc/basicclass.exp: print an ivar of self > -PASS: gdb.objc/basicclass.exp: print self > -PASS: gdb.objc/basicclass.exp: print contents of self > +FAIL: gdb.objc/basicclass.exp: resetting breakpoints when rerunning > +FAIL: gdb.objc/basicclass.exp: continue until method breakpoint (GDB internal error) > +FAIL: gdb.objc/basicclass.exp: print an ivar of self > +FAIL: gdb.objc/basicclass.exp: print self > +FAIL: gdb.objc/basicclass.exp: print contents of self This is caused by a thinko in objc-lang.c:find_methods. Amongst its many duties, that function counts the number of ObjC symbols seen in an objfile, storing this result in the objfile. It is then checked every time find_methods is called. However, the loop over the minimal symbols has a few continuations in it, e.g., to check if the symbol is in the desired block and other things; if not, it continues the loop with the next minimal symbol. Unfortunately, that bypasses the incrementing of the objfile's symbol counter. The method not being in the desired block does not make it an invalid ObjC method for the objfile. It must still be counted for the later assertion. Before the patch for c++/12750, decode_objc would always get NULL for file_symtab (so why does it even have that parameter?), and the check for the block would never occur. This is all way more verbiage than the simple patch to fix it: increment the counter before shorting the loop. Keith ChangeLog 2011-06-01 Keith Seitz * objc-lang.c (find_methods): Increment objfile_csym earlier. --------------080507050308080902000704 Content-Type: text/plain; name="objc-regression.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="objc-regression.patch" Content-length: 684 diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c index dfa5388..592b52e 100644 --- a/gdb/objc-lang.c +++ b/gdb/objc-lang.c @@ -1221,6 +1221,8 @@ find_methods (struct symtab *symtab, char type, pc = gdbarch_convert_from_func_ptr_addr (gdbarch, pc, ¤t_target); + objfile_csym++; + if (symtab) if (pc < BLOCK_START (block) || pc >= BLOCK_END (block)) /* Not in the specified symtab. */ @@ -1237,8 +1239,6 @@ find_methods (struct symtab *symtab, char type, if (parse_method (tmp, &ntype, &nclass, &ncategory, &nselector) == NULL) continue; - - objfile_csym++; if ((type != '\0') && (ntype != type)) continue; --------------080507050308080902000704--