]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Restrict matching add/sub sp, #imm
authorYao Qi <yao@codesourcery.com>
Tue, 1 Jul 2014 07:36:44 +0000 (15:36 +0800)
committerYao Qi <yao@codesourcery.com>
Fri, 11 Jul 2014 13:33:50 +0000 (21:33 +0800)
commit1db01f22f58cc01768dc921a7443a1bad4e48eb5
treef75b3763a6917069845e9019f3e7dec4eae17a14
parent3116063bd617de56fbc3bad046a692b1fb363a9d
Restrict matching add/sub sp, #imm

Currently, GDB matches both add/sub sp, #imm in prologue and epilogue,
which is not very precise.  On the instruction level, the immediate
number in both instruction can't be negative, so 'sub sp, #imm' only
appears in prologue while 'add sp, #imm' only appears in epilogue.
Note that on assembly level, we can write 'add sp, -8', but gas will
translate to 'sub sp, 8' instruction.

This patch is to only match 'sub sp, #imm' in prologue and match
'add sp, #immm' in epilogue.  It paves the way for the following
patch.

gdb:

2014-07-11  Yao Qi  <yao@codesourcery.com>

* arm-tdep.c (thumb_analyze_prologue): Don't match instruction
'add sp, #imm'.
(thumb_in_function_epilogue_p): Don't match 'sub sp, #imm'.
gdb/ChangeLog
gdb/arm-tdep.c