[PATCH 4/6] Remove some dead code from handle_search_memory
Tom Tromey
tromey@adacore.com
Thu Jul 23 20:12:14 GMT 2020
handle_search_memory had some code after a call to error. This code
is dead, and this patch removes it.
2020-07-23 Tom Tromey <tromey@adacore.com>
* server.cc (handle_search_memory): Remove dead code.
---
gdbserver/ChangeLog | 4 ++++
gdbserver/server.cc | 8 +-------
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/gdbserver/server.cc b/gdbserver/server.cc
index b050a1d8653..9af747cc0b7 100644
--- a/gdbserver/server.cc
+++ b/gdbserver/server.cc
@@ -1053,11 +1053,7 @@ handle_search_memory (char *own_buf, int packet_len)
pattern = (gdb_byte *) malloc (packet_len);
if (pattern == NULL)
- {
- error ("Unable to allocate memory to perform the search");
- strcpy (own_buf, "E00");
- return;
- }
+ error ("Unable to allocate memory to perform the search");
if (decode_search_memory_packet (own_buf + cmd_name_len,
packet_len - cmd_name_len,
&start_addr, &search_space_len,
@@ -1065,8 +1061,6 @@ handle_search_memory (char *own_buf, int packet_len)
{
free (pattern);
error ("Error in parsing qSearch:memory packet");
- strcpy (own_buf, "E00");
- return;
}
auto read_memory = [=] (CORE_ADDR addr, gdb_byte *result, size_t len)
--
2.26.2
More information about the Gdb-patches
mailing list