sparc gdbserver: fix number of regs
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 ) {
Quoted 8 lines · Tristan Gingold
Hi,
gdbstubs.cset 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?
Quoted 8 lines · Tristan Gingold
Hi,
gdbstubs.cset 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?
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.
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.cwith gdb code.
It looks like Sparc64 is correct. The number is defined in gdb sources in gdb/sparc64-tdep.c (SPARC64_NUM_REGS).