From: Yao Qi <qiyaoltc@gmail.com>
To: gdb-patches@sourceware.org
Subject: [pushed] Initialize res in get_next_pcs_read_memory_unsigned_integer
Date: Thu, 05 May 2016 08:03:00 -0000 [thread overview]
Message-ID: <1462435380-20334-1-git-send-email-yao.qi@linaro.org> (raw)
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 | 5 +++++
gdb/gdbserver/linux-arm-low.c | 1 +
2 files changed, 6 insertions(+)
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 70cd4b0..a43f1e1 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -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.
diff --git a/gdb/gdbserver/linux-arm-low.c b/gdb/gdbserver/linux-arm-low.c
index 952ec26..2ffda87 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;
}
--
1.9.1
reply other threads:[~2016-05-05 8:03 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1462435380-20334-1-git-send-email-yao.qi@linaro.org \
--to=qiyaoltc@gmail.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).