This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] [ARM] Read memory as unsigned integer


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7913a64cab3930fe524f0e38f85cfca11bd52dcb

commit 7913a64cab3930fe524f0e38f85cfca11bd52dcb
Author: Yao Qi <yao.qi@linaro.org>
Date:   Wed Nov 30 11:55:56 2016 +0000

    [ARM] Read memory as unsigned integer
    
    When GDB read inferior memory as an address or an instruction,
    it should be unsigned.
    
    gdb:
    
    2016-11-30  Yao Qi  <yao.qi@linaro.org>
    
    	* arm-tdep.c (arm_scan_prologue): Read memory as unsigned integer.
    	(arm_exidx_unwind_sniffer): Likewise.

Diff:
---
 gdb/ChangeLog  |  5 +++++
 gdb/arm-tdep.c | 17 +++++++++--------
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 59c39fe..03e5f0f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2016-11-30  Yao Qi  <yao.qi@linaro.org>
+
+	* arm-tdep.c (arm_scan_prologue): Read memory as unsigned integer.
+	(arm_exidx_unwind_sniffer): Likewise.
+
 2016-11-28  Simon Marchi  <simon.marchi@polymtl.ca>
 
 	* record-full.c (record_full_open_1): Fix debug output.
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 0b93df7..fd5d0de 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -1807,10 +1807,11 @@ arm_scan_prologue (struct frame_info *this_frame,
 	 the callee (or at the present moment if this is the innermost frame).
 	 The value stored there should be the address of the stmfd + 8.  */
       CORE_ADDR frame_loc;
-      LONGEST return_value;
+      ULONGEST return_value;
 
       frame_loc = get_frame_register_unsigned (this_frame, ARM_FP_REGNUM);
-      if (!safe_read_memory_integer (frame_loc, 4, byte_order, &return_value))
+      if (!safe_read_memory_unsigned_integer (frame_loc, 4, byte_order,
+					      &return_value))
         return;
       else
         {
@@ -2659,19 +2660,19 @@ arm_exidx_unwind_sniffer (const struct frame_unwind *self,
 	 ensure this, so that e.g. pthread cancellation works.  */
       if (arm_frame_is_thumb (this_frame))
 	{
-	  LONGEST insn;
+	  ULONGEST insn;
 
-	  if (safe_read_memory_integer (get_frame_pc (this_frame) - 2, 2,
-					byte_order_for_code, &insn)
+	  if (safe_read_memory_unsigned_integer (get_frame_pc (this_frame) - 2,
+						 2, byte_order_for_code, &insn)
 	      && (insn & 0xff00) == 0xdf00 /* svc */)
 	    exc_valid = 1;
 	}
       else
 	{
-	  LONGEST insn;
+	  ULONGEST insn;
 
-	  if (safe_read_memory_integer (get_frame_pc (this_frame) - 4, 4,
-					byte_order_for_code, &insn)
+	  if (safe_read_memory_unsigned_integer (get_frame_pc (this_frame) - 4,
+						 4, byte_order_for_code, &insn)
 	      && (insn & 0x0f000000) == 0x0f000000 /* svc */)
 	    exc_valid = 1;
 	}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]