patch for search bug in gdbserver

Game Debugger gameDebugger2@gmx.com
Sat Mar 24 10:41:00 GMT 2018


$greeting$
 
found while trying to search memory via gdbserver
it just doesn't work except when target pattern is in the first block read
 
 
patch was obvious once i dug into the code; and is tested
looks like original bug was a copy and paste error from top of loop
 
 
 
pls let me know if you ise it
 
 
 
ty
$name$
 
 
============= PATCH FOLLOWS
 
 
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index 64c72bd..943dfb2 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -1123,7 +1123,7 @@ handle_search_memory_1 (CORE_ADDR start_addr, CORE_ADDR search_space_len,
                        : chunk_size);
 
          if (gdb_read_memory (read_addr, search_buf + keep_len,
-                              nr_to_read) != search_buf_size)
+                              nr_to_read) != nr_to_read)
            {
              warning ("Unable to access %ld bytes of target memory "
                       "at 0x%lx, halting search.",
 
 
 
=============== PATCH FINISHED :)
 
 
$signature$



More information about the Gdb-patches mailing list