Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Fix length arg in call to breakpoint_xfer_memory
@ 2014-02-21 13:05 Andreas Arnez
  2014-02-21 13:22 ` Yao Qi
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andreas Arnez @ 2014-02-21 13:05 UTC (permalink / raw)
  To: gdb-patches; +Cc: Ulrich Weigand, Andreas Krebbel, Yao Qi

The patch "return target_xfer_status in to_xfer_partial" caused a
regression in various s390(x) test cases, because memory_xfer_partial
filled only the first byte of the read buffer from a breakpoint shadow:

    https://sourceware.org/ml/gdb-patches/2014-01/msg01071.html

This patch fixes the regression.

ChangeLog/
	* target.c (memory_xfer_partial): Fix length arg in call to
	breakpoint_xfer_memory.
---
 gdb/target.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/target.c b/gdb/target.c
index 4adc094..0f3bd30 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -1348,7 +1348,7 @@ memory_xfer_partial (struct target_ops *ops, enum target_object object,
 				   xfered_len);
 
       if (res == TARGET_XFER_OK && !show_memory_breakpoints)
-	breakpoint_xfer_memory (readbuf, NULL, NULL, memaddr, res);
+	breakpoint_xfer_memory (readbuf, NULL, NULL, memaddr, *xfered_len);
     }
   else
     {
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix length arg in call to breakpoint_xfer_memory
  2014-02-21 13:05 [PATCH] Fix length arg in call to breakpoint_xfer_memory Andreas Arnez
@ 2014-02-21 13:22 ` Yao Qi
  2014-02-21 13:56 ` Pedro Alves
  2014-02-21 15:02 ` Andreas Krebbel
  2 siblings, 0 replies; 4+ messages in thread
From: Yao Qi @ 2014-02-21 13:22 UTC (permalink / raw)
  To: Andreas Arnez; +Cc: gdb-patches, Ulrich Weigand, Andreas Krebbel

On 02/21/2014 09:05 PM, Andreas Arnez wrote:
> @@ -1348,7 +1348,7 @@ memory_xfer_partial (struct target_ops *ops, enum target_object object,
>  				   xfered_len);
>  
>        if (res == TARGET_XFER_OK && !show_memory_breakpoints)
> -	breakpoint_xfer_memory (readbuf, NULL, NULL, memaddr, res);
> +	breakpoint_xfer_memory (readbuf, NULL, NULL, memaddr, *xfered_len);

Ah, it should be "*xfered_len" instead of "res".  The patch looks good
to me, but I can't approve it.

-- 
Yao (齐尧)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix length arg in call to breakpoint_xfer_memory
  2014-02-21 13:05 [PATCH] Fix length arg in call to breakpoint_xfer_memory Andreas Arnez
  2014-02-21 13:22 ` Yao Qi
@ 2014-02-21 13:56 ` Pedro Alves
  2014-02-21 15:02 ` Andreas Krebbel
  2 siblings, 0 replies; 4+ messages in thread
From: Pedro Alves @ 2014-02-21 13:56 UTC (permalink / raw)
  To: Andreas Arnez; +Cc: gdb-patches, Ulrich Weigand, Andreas Krebbel, Yao Qi

On 02/21/2014 01:05 PM, Andreas Arnez wrote:
> The patch "return target_xfer_status in to_xfer_partial" caused a
> regression in various s390(x) test cases, because memory_xfer_partial
> filled only the first byte of the read buffer from a breakpoint shadow:

Ah.  Breakpoints on x86 happen to be 1 byte long.  How lucky.  :-)

> 
>     https://sourceware.org/ml/gdb-patches/2014-01/msg01071.html
> 
> This patch fixes the regression.
> 
> ChangeLog/
> 	* target.c (memory_xfer_partial): Fix length arg in call to
> 	breakpoint_xfer_memory.

OK.

Thanks,
-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix length arg in call to breakpoint_xfer_memory
  2014-02-21 13:05 [PATCH] Fix length arg in call to breakpoint_xfer_memory Andreas Arnez
  2014-02-21 13:22 ` Yao Qi
  2014-02-21 13:56 ` Pedro Alves
@ 2014-02-21 15:02 ` Andreas Krebbel
  2 siblings, 0 replies; 4+ messages in thread
From: Andreas Krebbel @ 2014-02-21 15:02 UTC (permalink / raw)
  To: Andreas Arnez, gdb-patches; +Cc: Ulrich Weigand, Yao Qi

On 21/02/14 14:05, Andreas Arnez wrote:
> ChangeLog/
> 	* target.c (memory_xfer_partial): Fix length arg in call to
> 	breakpoint_xfer_memory.

Applied. Thanks!

Bye,

-Andreas-


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-02-21 15:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-21 13:05 [PATCH] Fix length arg in call to breakpoint_xfer_memory Andreas Arnez
2014-02-21 13:22 ` Yao Qi
2014-02-21 13:56 ` Pedro Alves
2014-02-21 15:02 ` Andreas Krebbel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox