Initialize res in get_next_pcs_read_memory_unsigned_integer
authorYao Qi <yao.qi@linaro.org>
Thu, 5 May 2016 08:00:56 +0000 (09:00 +0100)
committerYao Qi <yao.qi@linaro.org>
Thu, 5 May 2016 08:00:56 +0000 (09:00 +0100)
This patch initialize res to zero, otherwise, it may have some garbage
bits after the *the_target->read_memory call.

gdb/gdbserver:

2016-05-05  Yao Qi  <yao.qi@linaro.org>

* linux-arm-low.c (get_next_pcs_read_memory_unsigned_integer):
Initialize res to zero.

gdb/gdbserver/ChangeLog
gdb/gdbserver/linux-arm-low.c

index 70cd4b0..a43f1e1 100644 (file)
@@ -1,5 +1,10 @@
 2016-05-05  Yao Qi  <yao.qi@linaro.org>
 
+       * linux-arm-low.c (get_next_pcs_read_memory_unsigned_integer):
+       Initialize res to zero.
+
+2016-05-05  Yao Qi  <yao.qi@linaro.org>
+
        * linux-arm-low.c (arm_sigreturn_next_pc): Change type of cpsr
        to uint32_t.
 
index 952ec26..2ffda87 100644 (file)
@@ -262,6 +262,7 @@ get_next_pcs_read_memory_unsigned_integer (CORE_ADDR memaddr,
 {
   ULONGEST res;
 
+  res = 0;
   (*the_target->read_memory) (memaddr, (unsigned char *) &res, len);
   return res;
 }