remote_gdb.cc (13611:c8b7847b4171) | remote_gdb.cc (14186:146c010fa764) |
---|---|
1/* 2 * Copyright 2015 LabWare 3 * Copyright 2014 Google, Inc. 4 * Copyright (c) 2010 ARM Limited 5 * All rights reserved 6 * 7 * The license below extends only to copyright in the software and shall 8 * not be construed as granting a license to any other intellectual --- 153 unchanged lines hidden (view full) --- 162 163void 164RemoteGDB::RiscvGdbRegCache::getRegs(ThreadContext *context) 165{ 166 DPRINTF(GDBAcc, "getregs in remotegdb, size %lu\n", size()); 167 for (int i = 0; i < NumIntArchRegs; i++) 168 r.gpr[i] = context->readIntReg(i); 169 r.pc = context->pcState().pc(); | 1/* 2 * Copyright 2015 LabWare 3 * Copyright 2014 Google, Inc. 4 * Copyright (c) 2010 ARM Limited 5 * All rights reserved 6 * 7 * The license below extends only to copyright in the software and shall 8 * not be construed as granting a license to any other intellectual --- 153 unchanged lines hidden (view full) --- 162 163void 164RemoteGDB::RiscvGdbRegCache::getRegs(ThreadContext *context) 165{ 166 DPRINTF(GDBAcc, "getregs in remotegdb, size %lu\n", size()); 167 for (int i = 0; i < NumIntArchRegs; i++) 168 r.gpr[i] = context->readIntReg(i); 169 r.pc = context->pcState().pc(); |
170 for (int i = 0; i < NumFloatRegs; i++) 171 r.fpr[i] = context->readFloatReg(i); 172 173 r.csr_base = context->readMiscReg(0); 174 r.fflags = context->readMiscReg(CSR_FFLAGS); 175 r.frm = context->readMiscReg(CSR_FRM); 176 r.fcsr = context->readMiscReg(CSR_FCSR); 177 for (int i = ExplicitCSRs; i < NumMiscRegs; i++) 178 r.csr[i - ExplicitCSRs] = context->readMiscReg(i); | |
179} 180 181void 182RemoteGDB::RiscvGdbRegCache::setRegs(ThreadContext *context) const 183{ 184 DPRINTF(GDBAcc, "setregs in remotegdb \n"); 185 for (int i = 0; i < NumIntArchRegs; i++) 186 context->setIntReg(i, r.gpr[i]); 187 context->pcState(r.pc); | 170} 171 172void 173RemoteGDB::RiscvGdbRegCache::setRegs(ThreadContext *context) const 174{ 175 DPRINTF(GDBAcc, "setregs in remotegdb \n"); 176 for (int i = 0; i < NumIntArchRegs; i++) 177 context->setIntReg(i, r.gpr[i]); 178 context->pcState(r.pc); |
188 for (int i = 0; i < NumFloatRegs; i++) 189 context->setFloatReg(i, r.fpr[i]); 190 191 context->setMiscReg(0, r.csr_base); 192 context->setMiscReg(CSR_FFLAGS, r.fflags); 193 context->setMiscReg(CSR_FRM, r.frm); 194 context->setMiscReg(CSR_FCSR, r.fcsr); 195 for (int i = ExplicitCSRs; i < NumMiscRegs; i++) 196 context->setMiscReg(i, r.csr[i - ExplicitCSRs]); | |
197} 198 199BaseGdbRegCache* 200RemoteGDB::gdbRegs() 201{ 202 return ®Cache; 203} | 179} 180 181BaseGdbRegCache* 182RemoteGDB::gdbRegs() 183{ 184 return ®Cache; 185} |