Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Game Debugger" <gameDebugger2@gmx.com>
To: "gdb patches" <gdb-patches@sourceware.org>
Subject: patch for search bug in gdbserver
Date: Sat, 24 Mar 2018 10:41:00 -0000	[thread overview]
Message-ID: <trinity-e5fe4eb7-c071-462b-a758-ab4b4c303652-1521888106966@3c-app-mailcom-bs13> (raw)

$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$


             reply	other threads:[~2018-03-24 10:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-24 10:41 Game Debugger [this message]
2018-03-24 10:54 ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=trinity-e5fe4eb7-c071-462b-a758-ab4b4c303652-1521888106966@3c-app-mailcom-bs13 \
    --to=gamedebugger2@gmx.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox