From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30444 invoked by alias); 5 Oct 2011 16:09:38 -0000 Received: (qmail 30404 invoked by uid 22791); 5 Oct 2011 16:09:34 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 05 Oct 2011 16:09:20 +0000 From: "christian.prochaska@genode-labs.com" To: gdb-prs@sourceware.org Subject: [Bug breakpoints/13247] Wrong breakpoint address for ARM binary built with -O2 Date: Wed, 05 Oct 2011 16:09:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: breakpoints X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: christian.prochaska@genode-labs.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: In-Reply-To: References: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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: 2011-q4/txt/msg00013.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=13247 --- Comment #1 from Christian Prochaska 2011-10-05 16:09:15 UTC --- I'm still quite new to DWARF, but noted a difference in the line number information for the two binaries: -O0 binary ---------- The File Name Table: Entry Dir Time Size Name 1 0 0 0 func1.c 2 0 0 0 func1.h Line Number Statements: Extended opcode 2: set Address to 0x83a4 Special opcode 8: advance Address by 0 to 0x83a4 and Line by 3 to 4 Special opcode 146: advance Address by 20 to 0x83b8 and Line by 1 to 5 Advance PC by 16 to 0x83c8 Extended opcode 1: End of Sequence -O2 binary ---------- The File Name Table: Entry Dir Time Size Name 1 0 0 0 func1.c 2 0 0 0 func1.h Line Number Statements: Extended opcode 2: set Address to 0x838c Special opcode 8: advance Address by 0 to 0x838c and Line by 3 to 4 Special opcode 33: advance Address by 4 to 0x8390 and Line by 0 to 4 Special opcode 62: advance Address by 8 to 0x8398 and Line by 1 to 5 Advance PC by 8 to 0x83a0 Extended opcode 1: End of Sequence ------------- I wonder about the line with opcode 33 in the output for the -O2 binary, it seems superfluous to me? Also, the next line with opcode 62 contains the correct breakpoint address 0x8398 which was not chosen by GDB. After looking at the assembly files, I guess the line number statements are related to the ".loc" statements? In func1.s for the -O2 build there appears two times ".loc 1 4 0", which is not the case for the -O0 build. func1: .LFB0: .file 1 "func1.c" .loc 1 4 0 .cfi_startproc @ args = 20, pretend = 16, frame = 0 @ frame_needed = 0, uses_anonymous_args = 0 @ link register save eliminated. sub sp, sp, #16 .LCFI0: .cfi_def_cfa_offset 16 .loc 1 4 0 sub ip, sp, #4 stmib ip, {r0, r1, r2, r3} .loc 1 5 0 add sp, sp, #16 bx lr .cfi_endproc -- 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.