diff options
author | Yao Qi <yao@codesourcery.com> | 2014-11-27 11:37:54 +0800 |
---|---|---|
committer | Yao Qi <yao@codesourcery.com> | 2014-12-12 08:46:34 +0800 |
commit | 21daaaaffcbda47b724858dd99ee2082043ef2da (patch) | |
tree | 01b636ad807269afc219b6d4dc3f9f60416c0412 /gdb/ChangeLog | |
parent | f303bc3e6ca29f0413376e38164dc5cdc0893d4b (diff) | |
download | gdb-21daaaaffcbda47b724858dd99ee2082043ef2da.zip gdb-21daaaaffcbda47b724858dd99ee2082043ef2da.tar.gz gdb-21daaaaffcbda47b724858dd99ee2082043ef2da.tar.bz2 |
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 <compdir_missing__ldir_missing__file_basename+40>
0x0000862c <+12>: ldr r3, [r3]
0x00008630 <+16>: add r3, r3, #1
0x00008634 <+20>: ldr r2, [pc, #12] ; 0x8648 <compdir_missing__ldir_missing__file_basename+40>
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
<https://sourceware.org/ml/gdb-patches/2010-03/msg00820.html>
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 <yao@codesourcery.com>
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.
Diffstat (limited to 'gdb/ChangeLog')
-rw-r--r-- | gdb/ChangeLog | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c444ce7..bf1f80b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,14 @@ 2014-12-12 Yao Qi <yao@codesourcery.com> + 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. + +2014-12-12 Yao Qi <yao@codesourcery.com> + * 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 |