Skip to contentSkip to conversation

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

PATCH Applied Kazu Hirata 2 participants 2 messages Jan 14, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix a typo in 'P' packet processing for M68K.

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) {
---
 gdbstub.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
gdbstub.c +1 -1
index 6180171..80477be 100644
@@ -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 {
Signature · 1 line
1.6.2.4
#1 lore raw
Quoted 7 lines · Kazu Hirata

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).

Quoted 8 lines

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) {

Thanks, applied.

Quoted 23 lines
---
 gdbstub.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
gdbstub.c +1 -1
index 6180171..80477be 100644
@@ -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 {
Signature · 1 line
1.6.2.4
Signature · 2 lines
Aurelien Jarno                          GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net