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  <yao.qi@linaro.org>

	* linux-arm-low.c (get_next_pcs_read_memory_unsigned_integer):
	Initialize res to zero.
This commit is contained in:
Yao Qi
2016-05-05 09:00:56 +01:00
parent cf2ebb6e09
commit 9e78496443
2 changed files with 6 additions and 0 deletions

View File

@ -1,3 +1,8 @@
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

View 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;
}