for (int i = 0; i < NumIntArchRegs; i++)
r.gpr[i] = context->readIntReg(i);
r.pc = context->pcState().pc();
- for (int i = 0; i < NumFloatRegs; i++)
- r.fpr[i] = context->readFloatReg(i);
-
- r.csr_base = context->readMiscReg(0);
- r.fflags = context->readMiscReg(CSR_FFLAGS);
- r.frm = context->readMiscReg(CSR_FRM);
- r.fcsr = context->readMiscReg(CSR_FCSR);
- for (int i = ExplicitCSRs; i < NumMiscRegs; i++)
- r.csr[i - ExplicitCSRs] = context->readMiscReg(i);
}
void
for (int i = 0; i < NumIntArchRegs; i++)
context->setIntReg(i, r.gpr[i]);
context->pcState(r.pc);
- for (int i = 0; i < NumFloatRegs; i++)
- context->setFloatReg(i, r.fpr[i]);
-
- context->setMiscReg(0, r.csr_base);
- context->setMiscReg(CSR_FFLAGS, r.fflags);
- context->setMiscReg(CSR_FRM, r.frm);
- context->setMiscReg(CSR_FCSR, r.fcsr);
- for (int i = ExplicitCSRs; i < NumMiscRegs; i++)
- context->setMiscReg(i, r.csr[i - ExplicitCSRs]);
}
BaseGdbRegCache*
class RemoteGDB : public BaseRemoteGDB
{
protected:
- static const int ExplicitCSRs = 4;
+ static const int NumGDBRegs = 4162;
+ static const int NumCSRs = 4096;
bool acc(Addr addr, size_t len);
+ // A breakpoint will be 2 bytes if it is compressed and 4 if not
+ bool checkBpLen(size_t len) override { return len == 2 || len == 4; }
class RiscvGdbRegCache : public BaseGdbRegCache
{
struct {
uint64_t gpr[NumIntArchRegs];
uint64_t pc;
- uint64_t fpr[NumFloatRegs];
-
- uint64_t csr_base;
- uint32_t fflags;
- uint32_t frm;
- uint32_t fcsr;
- uint64_t csr[NumMiscRegs - ExplicitCSRs];
- } __attribute__((__packed__)) r;
+ } r;
public:
char *data() const { return (char *)&r; }
size_t size() const { return sizeof(r); }