Skip to contentSkip to conversation

sparc gdbserver: fix number of regs

PATCH In review Tristan Gingold 2 participants 5 messages Jan 13, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sparc gdbserver: fix number of regs

Hi,

gdbstubs.c set the number of regs for sparc32 to 73 but gdb expects only 72. As a consequence, gdb doesn't accept 'g' packets (packets too long).
This patch reduces the number of registers to 72. This is harmless as the 72nd register is not used and gdb accepts packets that contains less registers.

Tristan.

gdbstub.c +2 -2
@@ -694,7 +694,7 @@
 #if defined(TARGET_SPARC64) && !defined(TARGET_ABI32)
 #define NUM_CORE_REGS 86
 #else
-#define NUM_CORE_REGS 73
+#define NUM_CORE_REGS 72
 #endif
 
 #ifdef TARGET_ABI32
@@ -728,7 +728,7 @@
     case 69: GET_REGA(env->npc);
     case 70: GET_REGA(env->fsr);
     case 71: GET_REGA(0); /* csr */
-    case 72: GET_REGA(0);
+    default: GET_REGA(0);
     }
 #else
     if (n < 64) {
#1 lore raw
Quoted 8 lines · Tristan Gingold

Hi,

gdbstubs.c set the number of regs for sparc32 to 73 but gdb expects only
72. As a consequence, gdb
doesn't accept 'g' packets (packets too long).
This patch reduces the number of registers to 72. This is harmless as the
72nd register is not used and
gdb accepts packets that contains less registers.

Excellent! Now my cross-gdb also works. The patch didn't apply but I fixed it manually and then applied.

Maybe Sparc64 has the same problem?

#2 lore raw
In reply to Tristan Gingold
Quoted 8 lines · Tristan Gingold

Hi,

gdbstubs.c set the number of regs for sparc32 to 73 but gdb expects only
72. As a consequence, gdb
doesn't accept 'g' packets (packets too long).
This patch reduces the number of registers to 72. This is harmless as the
72nd register is not used and
gdb accepts packets that contains less registers.

Excellent! Now my cross-gdb also works. The patch didn't apply but I fixed it manually and then applied.

Maybe Sparc64 has the same problem?

#3 lore raw
Quoted 1 line · Blue Swirl

Excellent! Now my cross-gdb also works.

You're welcome.

Quoted 1 line

Maybe Sparc64 has the same problem?

I haven't built sparc64 but I can check gdbserver.c with gdb code.

Tristan.

#4 lore raw
Quoted 7 lines · Tristan Gingold
Quoted 2 lines · Blue Swirl

Excellent! Now my cross-gdb also works.

Quoted 7 lines

You're welcome.

Quoted 2 lines

Maybe Sparc64 has the same problem?

I haven't built sparc64 but I can check gdbserver.c with gdb code.

It looks like Sparc64 is correct. The number is defined in gdb sources in gdb/sparc64-tdep.c (SPARC64_NUM_REGS).