From 51370a3384dd01bdb0e31816588a1fa74962c5ce Mon Sep 17 00:00:00 2001 From: Yao Qi Date: Tue, 11 Oct 2011 07:31:29 +0000 Subject: [PATCH] gdb/ * arm-tdep.c (arm_get_next_pc_raw): Use read_memory_unsigned_integer to get address. --- gdb/ChangeLog | 5 +++++ gdb/arm-tdep.c | 21 ++++++++++----------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index db214d2d2d7..1458bbcd14d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2011-10-11 Yao Qi + + * arm-tdep.c (arm_get_next_pc_raw): Use read_memory_unsigned_integer + to get address. + 2011-10-10 Doug Evans * linux-thread-db.c (thread_db_new_objfile): Only try to load diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 278e6e94091..add6be871d7 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -4779,8 +4779,9 @@ arm_get_next_pc_raw (struct frame_info *frame, CORE_ADDR pc) else base -= offset; } - nextpc = (CORE_ADDR) read_memory_integer ((CORE_ADDR) base, - 4, byte_order); + nextpc = + (CORE_ADDR) read_memory_unsigned_integer ((CORE_ADDR) base, + 4, byte_order); } } break; @@ -4794,6 +4795,9 @@ arm_get_next_pc_raw (struct frame_info *frame, CORE_ADDR pc) { /* loading pc */ int offset = 0; + unsigned long rn_val + = get_frame_register_unsigned (frame, + bits (this_instr, 16, 19)); if (bit (this_instr, 23)) { @@ -4806,15 +4810,10 @@ arm_get_next_pc_raw (struct frame_info *frame, CORE_ADDR pc) else if (bit (this_instr, 24)) offset = -4; - { - unsigned long rn_val = - get_frame_register_unsigned (frame, - bits (this_instr, 16, 19)); - nextpc = - (CORE_ADDR) read_memory_integer ((CORE_ADDR) (rn_val - + offset), - 4, byte_order); - } + nextpc = + (CORE_ADDR) read_memory_unsigned_integer ((CORE_ADDR) + (rn_val + offset), + 4, byte_order); } } break; -- 2.30.2