Patchwork Fix a typo in 'P' packet processing for M68K.

login
register
mail settings
Submitter Kazu Hirata
Date Jan. 14, 2010, 5:08 p.m.
Message ID <20100114170800.95B595664C4@henry1.codesourcery.com>
Download mbox | patch
Permalink /patch/42920/
State New
Headers show

Comments

Kazu Hirata - Jan. 14, 2010, 5:08 p.m.
Hi,

Attached is a patch to fix a typo in 'P' packet processing for M68K.

Without this patch, QEMU fails to honor GDB's P packets from GDB
(writing to registers) for the address registers (A0 - A7).

The problem is because of an obvious typo.  Notice that the second
"if" condition is meant to be n < 16 in:

  if (n < 8) {
    :
  } else if (n < 8) {

Signed-off-by: Kazu Hirata <kazu@codesourcery.com>
---
 gdbstub.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Aurelien Jarno - Jan. 14, 2010, 7:06 p.m.
On Thu, Jan 14, 2010 at 09:08:00AM -0800, Kazu Hirata wrote:
> Hi,
> 
> Attached is a patch to fix a typo in 'P' packet processing for M68K.
> 
> Without this patch, QEMU fails to honor GDB's P packets from GDB
> (writing to registers) for the address registers (A0 - A7).
> 
> The problem is because of an obvious typo.  Notice that the second
> "if" condition is meant to be n < 16 in:
> 
>   if (n < 8) {
>     :
>   } else if (n < 8) {
> 
> Signed-off-by: Kazu Hirata <kazu@codesourcery.com>

Thanks, applied.

> ---
>  gdbstub.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/gdbstub.c b/gdbstub.c
> index 6180171..80477be 100644
> --- a/gdbstub.c
> +++ b/gdbstub.c
> @@ -1014,7 +1014,7 @@ static int cpu_gdb_write_register(CPUState *env, uint8_t *mem_buf, int n)
>      if (n < 8) {
>          /* D0-D7 */
>          env->dregs[n] = tmp;
> -    } else if (n < 8) {
> +    } else if (n < 16) {
>          /* A0-A7 */
>          env->aregs[n - 8] = tmp;
>      } else {
> -- 
> 1.6.2.4
> 
> 
> 
>

Patch

diff --git a/gdbstub.c b/gdbstub.c
index 6180171..80477be 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1014,7 +1014,7 @@  static int cpu_gdb_write_register(CPUState *env, uint8_t *mem_buf, int n)
     if (n < 8) {
         /* D0-D7 */
         env->dregs[n] = tmp;
-    } else if (n < 8) {
+    } else if (n < 16) {
         /* A0-A7 */
         env->aregs[n - 8] = tmp;
     } else {