Skip to content

Commit

Permalink
target/hppa: Drop attempted gdbstub support for hppa64
Browse files Browse the repository at this point in the history
There is no support for hppa64 in gdb.  Any attempt to provide the
data for the larger hppa64 registers results in an error from gdb.
Mask CR_SAR writes to the width of the register: 5 or 6 bits.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed Nov 7, 2023
1 parent 0c01f9b commit e207b4a
Showing 1 changed file with 13 additions and 19 deletions.
32 changes: 13 additions & 19 deletions target/hppa/gdbstub.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,16 @@
#include "cpu.h"
#include "gdbstub/helpers.h"

/*
* GDB 15 only supports PA1.0 via the remote protocol, and ignores
* any provided xml. Which means that any attempt to provide more
* data results in "Remote 'g' packet reply is too long".
*/

int hppa_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
{
HPPACPU *cpu = HPPA_CPU(cs);
CPUHPPAState *env = &cpu->env;
target_ureg val;
CPUHPPAState *env = cpu_env(cs);
uint32_t val;

switch (n) {
case 0:
Expand Down Expand Up @@ -139,24 +144,13 @@ int hppa_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
break;
}

if (TARGET_REGISTER_BITS == 64) {
return gdb_get_reg64(mem_buf, val);
} else {
return gdb_get_reg32(mem_buf, val);
}
return gdb_get_reg32(mem_buf, val);
}

int hppa_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
{
HPPACPU *cpu = HPPA_CPU(cs);
CPUHPPAState *env = &cpu->env;
target_ureg val;

if (TARGET_REGISTER_BITS == 64) {
val = ldq_p(mem_buf);
} else {
val = ldl_p(mem_buf);
}
CPUHPPAState *env = cpu_env(cs);
uint32_t val = ldl_p(mem_buf);

switch (n) {
case 0:
Expand All @@ -166,7 +160,7 @@ int hppa_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
env->gr[n] = val;
break;
case 32:
env->cr[CR_SAR] = val;
env->cr[CR_SAR] = val & (hppa_is_pa20(env) ? 63 : 31);
break;
case 33:
env->iaoq_f = val;
Expand Down Expand Up @@ -278,5 +272,5 @@ int hppa_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
}
break;
}
return sizeof(target_ureg);
return 4;
}

0 comments on commit e207b4a

Please sign in to comment.