* PATCH: fix PR gdb/10783
@ 2009-10-29 18:27 Sandra Loosemore
2009-10-29 19:15 ` Pedro Alves
0 siblings, 1 reply; 2+ messages in thread
From: Sandra Loosemore @ 2009-10-29 18:27 UTC (permalink / raw)
To: gdb-patches; +Cc: Chris Mears, Pedro Alves
[-- Attachment #1: Type: text/plain, Size: 1129 bytes --]
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 <sandra@codesourcery.com>
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.
[-- Attachment #2: gdb.patch --]
[-- Type: text/x-patch, Size: 1231 bytes --]
Index: gdb/target.c
===================================================================
RCS file: /cvs/src/src/gdb/target.c,v
retrieving revision 1.230
diff -u -r1.230 target.c
--- gdb/target.c 26 Oct 2009 18:28:13 -0000 1.230
+++ gdb/target.c 29 Oct 2009 17:58:39 -0000
@@ -2305,7 +2305,7 @@
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: gdb/gdbserver/server.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/server.c,v
retrieving revision 1.103
diff -u -r1.103 server.c
--- gdb/gdbserver/server.c 9 Oct 2009 00:31:01 -0000 1.103
+++ gdb/gdbserver/server.c 29 Oct 2009 17:58:39 -0000
@@ -557,7 +557,7 @@
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: PATCH: fix PR gdb/10783
2009-10-29 18:27 PATCH: fix PR gdb/10783 Sandra Loosemore
@ 2009-10-29 19:15 ` Pedro Alves
0 siblings, 0 replies; 2+ messages in thread
From: Pedro Alves @ 2009-10-29 19:15 UTC (permalink / raw)
To: Sandra Loosemore; +Cc: gdb-patches, Chris Mears
On Thursday 29 October 2009 18:27:22, Sandra Loosemore wrote:
> 2009-10-29 Sandra Loosemore <sandra@codesourcery.com>
>
> 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.
>
Thanks. Please apply.
--
Pedro Alves
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-10-29 19:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-29 18:27 PATCH: fix PR gdb/10783 Sandra Loosemore
2009-10-29 19:15 ` Pedro Alves
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox