From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31182 invoked by alias); 12 Dec 2014 00:52:11 -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 Received: (qmail 31144 invoked by uid 55); 12 Dec 2014 00:52:09 -0000 From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug tdep/14261] Break point not set at the 1st executable instruction in case of code compiled with clang on ARM Architecture. Date: Fri, 12 Dec 2014 00:52:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: tdep X-Bugzilla-Version: 7.4 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: WAITING X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-q4/txt/msg00373.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=14261 --- Comment #5 from cvs-commit at gcc dot gnu.org --- This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "gdb and binutils". The branch, master has been updated via 21daaaaffcbda47b724858dd99ee2082043ef2da (commit) via f303bc3e6ca29f0413376e38164dc5cdc0893d4b (commit) from 65840e31a7a7cd64c81ac47bcb17319536ce3ba2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=21daaaaffcbda47b724858dd99ee2082043ef2da commit 21daaaaffcbda47b724858dd99ee2082043ef2da Author: Yao Qi Date: Thu Nov 27 11:37:54 2014 +0800 Improve arm_skip_prologue by using arm_analyze_prologue Hi, I see many fails in dw2-dir-file-name.exp on arm target when test case is compiled with -marm, however, these fails are disappeared when test case is compiled with -mthumb. The difference of pass and fail shown below is that "0x000085d4 in" isn't printed out, but test case expects to see it. -Breakpoint 2, compdir_missing__ldir_missing__file_basename () at tmp-dw2-dir-file-name.c:999^M -(gdb) FAIL: gdb.dwarf2/dw2-dir-file-name.exp: compdir_missing__ldir_missing__file_basename: continue to breakpoint: compdir_missing__ldir_missing__file_basename +Breakpoint 2, 0x000085d4 in compdir_missing__ldir_missing__file_basename () at tmp-dw2-dir-file-name.c:999^M +(gdb) PASS: gdb.dwarf2/dw2-dir-file-name.exp: compdir_missing__ldir_missing__file_basename: continue to breakpoint: compdir_missing__ldir_missing__file_basename This difference is caused by setting breakpoint at the first instruction in the function (actually, the first instruction in prologue, at [1]), so that frame_show_address returns false, and print_frame doesn't print the address. 0x00008620 <+0>: push {r11} ; (str r11, [sp, #-4]!) <--[1] 0x00008624 <+4>: add r11, sp, #0 0x00008628 <+8>: ldr r3, [pc, #24] ; 0x8648 0x0000862c <+12>: ldr r3, [r3] 0x00008630 <+16>: add r3, r3, #1 0x00008634 <+20>: ldr r2, [pc, #12] ; 0x8648 Then, it must be the arm_skip_prologue's fault that unable to skip instructions in prologue. At the end of arm_skip_prologue, it matches several instructions, such as "str r(0123),[r11,#-nn]" and "str r(0123),[sp,#nn]", but "push {r11}" isn't handled. These instruction matching code in arm_skip_prologue, which can be regarded as leftover of development for many years, should be merged to arm_analyze_prologue and use arm_analyze_prologue in arm_skip_prologue. Here is the something like the history of arm_{skip,scan,analyze}_prologue. Around 2002, there are arm_skip_prologue and arm_scan_prologue, but code are duplicated to some extent. When match an instruction, both functions should be modified, for example in Michael Snyder's patch https://sourceware.org/ml/gdb-patches/2002-05/msg00205.html and Michael expressed the willingness to merge both into one. Daniel added code call thumb_analyze_prologue in arm_skip_prologue in 2006, but didn't handle its counterpart arm_analyze_prologue, which is added in 2010 however, the instructions matching at the bottom of arm_skip_prologue wasn't cleaned up. This patch is to merge them into arm_analyze_prologue. gdb: 2014-12-12 Yao Qi PR tdep/14261 * arm-tdep.c (arm_skip_prologue): Remove unused local variable 'skip_pc'. Remove code skipping prologue instructions, use arm_analyze_prologue instead. (arm_analyze_prologue): Stop the scanning for unrecognized instruction when skipping prologue. https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f303bc3e6ca29f0413376e38164dc5cdc0893d4b commit f303bc3e6ca29f0413376e38164dc5cdc0893d4b Author: Yao Qi Date: Fri Nov 28 15:19:12 2014 +0800 Don't scan prologue past epilogue This patch is to stop prologue analysis past epilogue in for arm mode, while we've already had done the same to thumb mode (see thumb_instruction_restores_sp). This is useful to parse functions with empty body (epilogue follows prologue). gdb: 2014-12-12 Yao Qi * arm-tdep.c (arm_instruction_restores_sp): New function. (arm_analyze_prologue): Call arm_instruction_restores_sp. (arm_in_function_epilogue_p): Move code to arm_instruction_restores_sp. ----------------------------------------------------------------------- Summary of changes: gdb/ChangeLog | 16 +++++++ gdb/arm-tdep.c | 128 +++++++++++++++++++------------------------------------- 2 files changed, 59 insertions(+), 85 deletions(-) -- You are receiving this mail because: You are on the CC list for the bug.