Fix '-data-read-memory-bytes' typo/assertion
authorDon Breazeal <donb@codesourcery.com>
Fri, 20 Nov 2015 17:45:44 +0000 (09:45 -0800)
committerDon Breazeal <donb@codesourcery.com>
Fri, 20 Nov 2015 17:45:44 +0000 (09:45 -0800)
commite084c964d61e6f8582711c73738c4df132410597
tree2eefd5014f8be27ca398532ca8e7f15d63303284
parent314cf376c5b5493eeea6d3b2a357a5c832943b30
Fix '-data-read-memory-bytes' typo/assertion

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
This page took 0.027697 seconds and 4 git commands to generate.