This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: patch for search bug in gdbserver
- From: Pedro Alves <palves at redhat dot com>
- To: Game Debugger <gameDebugger2 at gmx dot com>, gdb patches <gdb-patches at sourceware dot org>
- Date: Sat, 24 Mar 2018 10:54:31 +0000
- Subject: Re: patch for search bug in gdbserver
- References: <trinity-e5fe4eb7-c071-462b-a758-ab4b4c303652-1521888106966@3c-app-mailcom-bs13>
Hi!
Thanks much for finding the program and for the patch.
On 03/24/2018 10:41 AM, Game Debugger wrote:
> 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 :)
Close, but not yet :-) It'd be really good to add a test to the
testsuite to exercise this and make sure we don't break the fix
ever again. Clearly we don't have a test yet that covers
this scenario otherwise we'd have noticed the problem before!
Maybe add it to gdb/testsuite/gdb.base/find.{c,exp}?
Thanks,
Pedro Alves