From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22471 invoked by alias); 23 Oct 2010 14:51:39 -0000 Received: (qmail 22445 invoked by uid 22791); 23 Oct 2010 14:51:38 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_BJ X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 23 Oct 2010 14:51:32 +0000 From: "chantry.xavier at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug breakpoints/12156] New: cannot break on static functions with gcc flto (link time optimization) X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: breakpoints X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: chantry.xavier at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Sat, 23 Oct 2010 14:51:00 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org X-SW-Source: 2010-q4/txt/msg00071.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=12156 Summary: cannot break on static functions with gcc flto (link time optimization) Product: gdb Version: unknown Status: NEW Severity: normal Priority: P2 Component: breakpoints AssignedTo: unassigned@sourceware.org ReportedBy: chantry.xavier@gmail.com Created attachment 5082 --> http://sourceware.org/bugzilla/attachment.cgi?id=5082 minimal test case with one static function foo When compiling with gcc -flto, static symbols get a number suffix/extension. e.g. foo becomes foo.2043 break foo expands to break foo.2043, but neither works. The only way to actually set the break point is to specify the address directly. [xavier@xps-m1530 ~]$ gcc -flto test.c [xavier@xps-m1530 ~]$ objdump -d a.out | grep foo 00000000004004c4 : 4004d8: e8 e7 ff ff ff callq 4004c4 [xavier@xps-m1530 ~]$ gdb a.out GNU gdb (GDB) 7.2.50.20101022-cvs Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-unknown-linux-gnu". For bug reporting instructions, please see: ... Reading symbols from /home/xavier/a.out...(no debugging symbols found)...done. (gdb) break foo.2043 Can't find member of namespace, class, struct, or union named "foo.2043" Hint: try 'foo.2043 or 'foo.2043 (Note leading single quote.) Make breakpoint pending on future shared library load? (y or [n]) y Breakpoint 1 (foo.2043) pending. (gdb) break foo Function "foo" not defined. Make breakpoint pending on future shared library load? (y or [n]) y Breakpoint 2 (foo) pending. (gdb) run Starting program: /home/xavier/a.out bar Program exited with code 04. (gdb) break *0x4004c4 Breakpoint 3 at 0x4004c4 (gdb) run Starting program: /home/xavier/a.out Breakpoint 3, 0x00000000004004c4 in foo.2043 () (gdb) c Continuing. bar Program exited with code 04. (gdb) -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.