From: Yao Qi Date: Thu, 5 May 2016 08:00:56 +0000 (+0100) Subject: Initialize res in get_next_pcs_read_memory_unsigned_integer X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9e78496443ec1525ee94c54249779639b4cded0b;p=binutils-gdb.git Initialize res in get_next_pcs_read_memory_unsigned_integer 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 * linux-arm-low.c (get_next_pcs_read_memory_unsigned_integer): Initialize res to zero. --- diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 70cd4b0b873..a43f1e1bc18 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,8 @@ +2016-05-05 Yao Qi + + * linux-arm-low.c (get_next_pcs_read_memory_unsigned_integer): + Initialize res to zero. + 2016-05-05 Yao Qi * linux-arm-low.c (arm_sigreturn_next_pc): Change type of cpsr diff --git a/gdb/gdbserver/linux-arm-low.c b/gdb/gdbserver/linux-arm-low.c index 952ec261088..2ffda8731d1 100644 --- a/gdb/gdbserver/linux-arm-low.c +++ b/gdb/gdbserver/linux-arm-low.c @@ -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; }