2009-10-29 Sandra Loosemore <sandra@codesourcery.com>
authorSandra Loosemore <sandra@codesourcery.com>
Thu, 29 Oct 2009 20:12:26 +0000 (20:12 +0000)
committerSandra Loosemore <sandra@codesourcery.com>
Thu, 29 Oct 2009 20:12:26 +0000 (20:12 +0000)
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.

gdb/ChangeLog
gdb/gdbserver/ChangeLog
gdb/gdbserver/server.c
gdb/target.c

index fe28f95a72b802e2cc7fe643cefecc9ac5184415..5b02b0e724cae2997677aa6b77aacd758f88f705 100644 (file)
@@ -1,3 +1,10 @@
+2009-10-29  Sandra Loosemore  <sandra@codesourcery.com>
+
+       PR gdb/10783
+
+       * target.c (simple_search_memory): Correct read_addr initialization
+       in loop for searching subsequent chunks.
+
 2009-10-28  Daniel Jacobowitz  <dan@codesourcery.com>
 
        Reported by Antti Hatala <ahatala@nvidia.com>.
index fceb900c4f79e8d6a497344415ad1b0d9764fea7..5a83c8fa636657edac13baf69e0b5ee6bfc25ceb 100644 (file)
@@ -1,3 +1,10 @@
+2009-10-29  Sandra Loosemore  <sandra@codesourcery.com>
+
+       PR gdb/10783
+
+       * server.c (handle_search_memory_1): Correct read_addr initialization
+       in loop for searching subsequent chunks.
+
 2009-10-29  Paul Pluzhnikov  <ppluzhnikov@google.com>
 
        * configure.ac: New --with-libthread-db option.
index 9bf4f3dbd00189b82c1706856057103c11e682e2..14bc7e752ed4c7179a6a29a1bcb156c5f53ea853 100644 (file)
@@ -557,7 +557,7 @@ handle_search_memory_1 (CORE_ADDR start_addr, CORE_ADDR search_space_len,
       if (search_space_len >= pattern_len)
        {
          unsigned keep_len = search_buf_size - chunk_size;
-         CORE_ADDR read_addr = start_addr + keep_len;
+         CORE_ADDR read_addr = start_addr + chunk_size + keep_len;
          int nr_to_read;
 
          /* Copy the trailing part of the previous iteration to the front
index 21db30c35c279e5eaededc402ab8e264cafcee32..fc247309515bdd1e6d111c90098aa9317f52110e 100644 (file)
@@ -2305,7 +2305,7 @@ simple_search_memory (struct target_ops *ops,
       if (search_space_len >= pattern_len)
        {
          unsigned keep_len = search_buf_size - chunk_size;
-         CORE_ADDR read_addr = start_addr + keep_len;
+         CORE_ADDR read_addr = start_addr + chunk_size + keep_len;
          int nr_to_read;
 
          /* Copy the trailing part of the previous iteration to the front