From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5389 invoked by alias); 16 Mar 2011 23:54:26 -0000 Received: (qmail 5380 invoked by uid 22791); 16 Mar 2011 23:54:25 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 16 Mar 2011 23:54:21 +0000 Received: from wpaz29.hot.corp.google.com (wpaz29.hot.corp.google.com [172.24.198.93]) by smtp-out.google.com with ESMTP id p2GNsJOb020563 for ; Wed, 16 Mar 2011 16:54:19 -0700 Received: from elbrus2.mtv.corp.google.com (elbrus2.mtv.corp.google.com [172.18.116.96]) by wpaz29.hot.corp.google.com with ESMTP id p2GNsIOi014575; Wed, 16 Mar 2011 16:54:18 -0700 Received: by elbrus2.mtv.corp.google.com (Postfix, from userid 74925) id 34BA7190B17; Wed, 16 Mar 2011 16:54:18 -0700 (PDT) To: gdb-patches@sourceware.org Cc: ppluzhnikov@google.com Subject: [patch] Fix for PR gdb/12573 Message-Id: <20110316235418.34BA7190B17@elbrus2.mtv.corp.google.com> Date: Thu, 17 Mar 2011 06:43:00 -0000 From: ppluzhnikov@google.com (Paul Pluzhnikov) 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-03/txt/msg00885.txt.bz2 Greetings, Attached patch fixes http://sourceware.org/bugzilla/show_bug.cgi?id=12573 by removing (I believe incorrect) assertion. The assertion is incorrect, because skip_prologue_sal may in fact put the sal at a different line than what original_pc describes (if there are inlined functions in the picture). Also, we don't perform the same check if expanded.nelts == 1, which is why the test from that PR does not cause a crash when built with GCC-4.6 (GCC-4.6 does not emit two copies -- C1 and C2 -- of a constructor). If it did, we'd see the same crash there as well. Thanks, -- Paul Pluzhnikov 2011-03-16 Paul Pluzhnikov PR gdb/12573 * breakpoint.c (expand_line_sal_maybe): Remove bogus assertion. Index: breakpoint.c =================================================================== RCS file: /cvs/src/src/gdb/breakpoint.c,v retrieving revision 1.552 diff -u -p -r1.552 breakpoint.c --- breakpoint.c 14 Mar 2011 16:09:52 -0000 1.552 +++ breakpoint.c 16 Mar 2011 22:31:08 -0000 @@ -7447,18 +7447,6 @@ expand_line_sal_maybe (struct symtab_and return expanded; } - if (original_pc) - { - found = 0; - for (i = 0; i < expanded.nelts; ++i) - if (expanded.sals[i].pc == original_pc) - { - found = 1; - break; - } - gdb_assert (found); - } - return expanded; }