From 1ae0c35e7e2f707cb45c2101e560cca964a8716e Mon Sep 17 00:00:00 2001 From: Yao Qi Date: Fri, 28 Sep 2012 00:25:24 +0000 Subject: [PATCH] gdb/ * mi/mi-main.c (mi_cmd_data_write_memory_bytes): Emit error when the length of content is not an even number. --- gdb/ChangeLog | 5 +++++ gdb/mi/mi-main.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index fe69ce6d134..4a60c081923 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2012-09-28 Yao Qi + + * mi/mi-main.c (mi_cmd_data_write_memory_bytes): Emit error + when the length of content is not an even number. + 2012-09-27 Tom Tromey Fix https://bugzilla.redhat.com/show_bug.cgi?id=849357 diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index f1d21bcf6eb..f73d4f8796b 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -1672,6 +1672,10 @@ mi_cmd_data_write_memory_bytes (char *command, char **argv, int argc) addr = parse_and_eval_address (argv[0]); cdata = argv[1]; + if (strlen (cdata) % 2) + error (_("Hex-encoded '%s' must have an even number of characters."), + cdata); + len = strlen (cdata)/2; data = xmalloc (len); -- 2.30.2