From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10954 invoked by alias); 13 Mar 2012 22:58:36 -0000 Received: (qmail 10945 invoked by uid 22791); 13 Mar 2012 22:58:36 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,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; Tue, 13 Mar 2012 22:58:20 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q2DMwJWV002182 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 13 Mar 2012 18:58:19 -0400 Received: from mesquite.lan (ovpn-113-133.phx2.redhat.com [10.3.113.133]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q2DMwIFA012827 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Tue, 13 Mar 2012 18:58:19 -0400 Date: Tue, 13 Mar 2012 22:58:00 -0000 From: Kevin Buettner To: gdb-patches@sourceware.org Subject: [RFC] symtab.c: Change skip_prologue_sal comparison to match main() too Message-ID: <20120313155817.44b4f280@mesquite.lan> 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/msg00454.txt.bz2 I'm seeing failures in gdb.cp/koenig.exp for targets which define a ``skip_main_prologue'' gdbarch method. It turns out, however, that most other C++ tests which run to main are not running to the correct location either. (The test results don't show this though.) Here is the relevant part of the log file for gdb.cp/koenig.exp for frv-elf showing this behavior: Breakpoint 1, main () at /ironwood1/sourceware-clean/frv-elf/../src/gdb/testsuite/gdb.cp/koenig.cc:246 246 { (gdb) p first(c) No symbol "c" in current context. Note that the breakpoint did not correctly end up at the first line of the function body. When I look at the code in question with gdb, I see that a comparison is being made between "main()" and "main" and is (obviously) failing. Does the patch below look reasonable? Kevin * symtab.c (skip_prologue_sal): Change test to check for "main()" in addition to "main". Index: symtab.c =================================================================== RCS file: /cvs/src/src/gdb/symtab.c,v retrieving revision 1.298 diff -u -p -r1.298 symtab.c --- symtab.c 1 Mar 2012 21:13:59 -0000 1.298 +++ symtab.c 13 Mar 2012 22:32:49 -0000 @@ -2776,7 +2776,7 @@ skip_prologue_sal (struct symtab_and_lin to `__main' in `main' between the prologue and before user code. */ if (gdbarch_skip_main_prologue_p (gdbarch) - && name && strcmp (name, "main") == 0) + && name && strcmp_iw (name, "main") == 0) { pc = gdbarch_skip_main_prologue (gdbarch, pc); /* Recalculate the line number (might not be N+1). */