Remove free_memory_read_result_vector
authorTom Tromey <tom@tromey.com>
Sat, 23 Sep 2017 17:21:58 +0000 (11:21 -0600)
committerTom Tromey <tom@tromey.com>
Sat, 30 Sep 2017 03:12:19 +0000 (21:12 -0600)
commit386c8614d5e65431e977b1b20cc4642f944faca1
tree22cdc54c0b8c61dfc6aa1da002e2fa7b2e7bdc40
parent789c4b5ea14b0c441e6021f07503e61ccfacb427
Remove free_memory_read_result_vector

This changes read_memory_robust to return a std::vector, allowing the
removal of free_memory_read_result_vector and associated cleanups.
This patch also changes the functions it touches to be a bit more
robust with regards to deallocation; it's perhaps possible that
read_memory_robust could have leaked in some situations.

This patch is based on my earlier series to remove some MI cleanups.
Regression tested by the buildbot.

gdb/ChangeLog
2017-09-29  Tom Tromey  <tom@tromey.com>

* target.c (read_whatever_is_readable): Change type of "result".
Update.
(free_memory_read_result_vector): Remove.
(read_memory_robust): Change return type.  Update.
* mi/mi-main.c (mi_cmd_data_read_memory_bytes): Update.  Use
bin2hex, std::string.
* target.h (memory_read_result_s): Remove typedef.
(free_memory_read_result_vector): Remove.
(read_memory_robust): Return std::vector.
gdb/ChangeLog
gdb/mi/mi-main.c
gdb/target.c
gdb/target.h