From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16172 invoked by alias); 21 Mar 2012 22:08:21 -0000 Received: (qmail 16163 invoked by uid 22791); 21 Mar 2012 22:08:20 -0000 X-SWARE-Spam-Status: No, hits=-6.0 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,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, 21 Mar 2012 22:08:06 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q2LM86uV026106 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 21 Mar 2012 18:08:06 -0400 Received: from mesquite.lan (ovpn-113-58.phx2.redhat.com [10.3.113.58]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q2LM853k032654 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Wed, 21 Mar 2012 18:08:05 -0400 Date: Wed, 21 Mar 2012 22:08:00 -0000 From: Kevin Buettner To: gdb-patches@sourceware.org Subject: Re: [RFC] symtab.c: Change skip_prologue_sal comparison to match main() too Message-ID: <20120321150804.61acc01e@mesquite.lan> In-Reply-To: <20120314090228.GA13802@host2.jankratochvil.net> References: <20120313155817.44b4f280@mesquite.lan> <4F5FD74B.1090500@redhat.com> <20120314090228.GA13802@host2.jankratochvil.net> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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: 2012-03/txt/msg00784.txt.bz2 On Wed, 14 Mar 2012 10:02:28 +0100 Jan Kratochvil wrote: > On Wed, 14 Mar 2012 00:24:59 +0100, Pedro Alves wrote: > > I'm going to guess this is fallback from physname. The code looked like > > this when it was originally added: > > > > + /* On targets with executable formats that don't have a concept of > > + constructors (ELF with .init has, PE doesn't), gcc emits a call > > + to `__main' in `main' between the prologue and before user > > + code. */ > > + if (funfirstline > > + && gdbarch_skip_main_prologue_p (current_gdbarch) > > + && SYMBOL_LINKAGE_NAME (sym) > > + && strcmp (SYMBOL_LINKAGE_NAME (sym), "main") == 0) > > > > And SYMBOL_LINKAGE_NAME (sym) used to be "main" for C++ too. > > This is: > regression by physname: PE32 prologue skip vs. static initializers > http://sourceware.org/bugzilla/show_bug.cgi?id=12680 > > I would welcome also a testcase, though. While it wasn't really designed to test this case, gdb.cp/koenig.exp does provide a test as the resulting failures are due to not executing everything up to the first line in the body of main(). If you wanted a more direct test, all that's needed is to place a breakpoint in main() in a C++ program and make sure that this breakpoint ends up being placed on the first line of the function body. Kevin