diff options
author | Yao Qi <yao.qi@linaro.org> | 2016-03-30 16:44:24 +0100 |
---|---|---|
committer | Yao Qi <yao.qi@linaro.org> | 2016-03-30 16:44:24 +0100 |
commit | c58b006a7e886f55224901eb5a9d1d619e34c05f (patch) | |
tree | a2536f594581d1221739b7ba63cec545fa3c9434 | |
parent | e6359af3fdda6b9265565ecbd213763244ed8594 (diff) | |
download | gdb-c58b006a7e886f55224901eb5a9d1d619e34c05f.zip gdb-c58b006a7e886f55224901eb5a9d1d619e34c05f.tar.gz gdb-c58b006a7e886f55224901eb5a9d1d619e34c05f.tar.bz2 |
Refactor arm_stack_frame_destroyed_p
This patch is to refactor arm_stack_frame_destroyed_p, so that the code
can be used in both arm_stack_frame_destroyed_p and arm epilogue
unwinder I am going to add in the next patch. In fact, the code
is the same in two places, but checking whether it is thumb mode
is slightly different. arm_stack_frame_destroyed_p uses
arm_pc_is_thumb, and epilogue unwinder should use arm_frame_is_thumb.
gdb:
2016-03-30 Yao Qi <yao.qi@linaro.org>
* arm-tdep.c (arm_stack_frame_destroyed_p): Rename it ...
(arm_stack_frame_destroyed_p_1): ... here. Don't call
arm_pc_is_thumb.
(arm_stack_frame_destroyed_p): Call
thumb_stack_frame_destroyed_p and
arm_stack_frame_destroyed_p_1.
-rw-r--r-- | gdb/ChangeLog | 9 | ||||
-rw-r--r-- | gdb/arm-tdep.c | 17 |
2 files changed, 20 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f1e99d7..efd9da6 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +2016-03-30 Yao Qi <yao.qi@linaro.org> + + * arm-tdep.c (arm_stack_frame_destroyed_p): Rename it ... + (arm_stack_frame_destroyed_p_1): ... here. Don't call + arm_pc_is_thumb. + (arm_stack_frame_destroyed_p): Call + thumb_stack_frame_destroyed_p and + arm_stack_frame_destroyed_p_1. + 2016-03-30 Doug Evans <dje@google.com> * python/py-utils.c (host_string_to_python_string): New function. diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index ad69834..6ede3a9 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -3124,19 +3124,14 @@ thumb_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc) return found_stack_adjust; } -/* Implement the stack_frame_destroyed_p gdbarch method. */ - static int -arm_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc) +arm_stack_frame_destroyed_p_1 (struct gdbarch *gdbarch, CORE_ADDR pc) { enum bfd_endian byte_order_for_code = gdbarch_byte_order_for_code (gdbarch); unsigned int insn; int found_return; CORE_ADDR func_start, func_end; - if (arm_pc_is_thumb (gdbarch, pc)) - return thumb_stack_frame_destroyed_p (gdbarch, pc); - if (!find_pc_partial_function (pc, NULL, &func_start, &func_end)) return 0; @@ -3178,6 +3173,16 @@ arm_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc) return 0; } +/* Implement the stack_frame_destroyed_p gdbarch method. */ + +static int +arm_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc) +{ + if (arm_pc_is_thumb (gdbarch, pc)) + return thumb_stack_frame_destroyed_p (gdbarch, pc); + else + return arm_stack_frame_destroyed_p_1 (gdbarch, pc); +} /* When arguments must be pushed onto the stack, they go on in reverse order. The code below implements a FILO (stack) to do this. */ |