We had a customer bug report that the GDB find command was not correctly finding things given a large search range. This was using gdbserver on an arm-none-linux-gnueabi target. I independently tracked this down to the same problem reported in PR 10783 -- it affects the target-side gdbserver search code as well as the server-side simple_search_memory function. The attached patch fixes both places. Note that the version of the patch attached to the issue also didn't correctly handle the keep_len != 0 case (e.g., find/w instead of find/b). I tested this with the arm-none-linux-gnueabi gdbserver case using lots of different combinations of search ranges to verify that it was correctly finding and reporting the match no matter what the offset within the range. OK to check in? -Sandra 2009-10-29 Sandra Loosemore PR gdb/10783 gdb/ * target.c (simple_search_memory): Correct read_addr initialization in loop for searching subsequent chunks. gdb/gdbserver/ * server.c (handle_search_memory_1): Correct read_addr initialization in loop for searching subsequent chunks.