]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Fix '-data-read-memory-bytes' typo/assertion gdb-7.10-branch
authorDon Breazeal <donb@codesourcery.com>
Wed, 10 Feb 2016 23:41:55 +0000 (15:41 -0800)
committerDon Breazeal <donb@codesourcery.com>
Wed, 10 Feb 2016 23:42:15 +0000 (15:42 -0800)
commit718b36fead887693158396b948d7f409b987c053
tree12a0530f95c0af1dcec1370e41177313240d10d7
parent9939a5ae6e80626c29fe602d366e9eece9652d06
Fix '-data-read-memory-bytes' typo/assertion

Backported to the 7.10 branch per this thread:
https://www.sourceware.org/ml/gdb-patches/2016-02/msg00134.html

This patch fixes a typo in target.c:read_memory_robust, where
it calls read_whatever_is_readable with the function arguments
in the wrong order.  Depending on the address being read, it
can cause an xmalloc with a huge size, resulting in an assertion
failure, or just read something other than what was requested.

The problem only arises when GDB is handling an MI
"-data-read-memory-bytes" request and the initial target_read returns
an error status.  Note that read_memory_robust is only called from
the MI code.

gdb/ChangeLog:

* gdb/target.c (read_memory_robust): Call
read_whatever_is_readable with arguments in the correct order.
gdb/ChangeLog
gdb/target.c