diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 09937a917c8..e85023e0627 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2016-04-15 Yao Qi + + * arm-tdep.c (thumb_stack_frame_destroyed_p): Return zero if + PC is far from the end of function. + 2016-04-14 Pedro Alves * cli/cli-cmds.c (alias_usage_error): New function. diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 0412f71d24a..36b0bcda341 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -3135,6 +3135,14 @@ thumb_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc) if (!find_pc_partial_function (pc, NULL, &func_start, &func_end)) return 0; + if (func_end - pc > 4 * 4) + { + /* There shouldn't be more than four instructions in epilogue. + If PC is still 16 bytes away from FUNC_END, it isn't in + epilogue. */ + return 0; + } + /* The epilogue is a sequence of instructions along the following lines: - add stack frame size to SP or FP