remote_gdb.cc (4002:024f9770a69e) | remote_gdb.cc (4060:aa97f9f77e2a) |
---|---|
1/* 2 * Copyright (c) 2002-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 124 unchanged lines hidden (view full) --- 133#include "mem/physical.hh" 134#include "mem/port.hh" 135#include "sim/system.hh" 136 137using namespace std; 138using namespace TheISA; 139 140RemoteGDB::RemoteGDB(System *_system, ThreadContext *c) | 1/* 2 * Copyright (c) 2002-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 124 unchanged lines hidden (view full) --- 133#include "mem/physical.hh" 134#include "mem/port.hh" 135#include "sim/system.hh" 136 137using namespace std; 138using namespace TheISA; 139 140RemoteGDB::RemoteGDB(System *_system, ThreadContext *c) |
141 : BaseRemoteGDB(_system, c, NumGDBRegs) | 141 : BaseRemoteGDB(_system, c, NumGDBRegs), nextBkpt(0) |
142{} 143 144/////////////////////////////////////////////////////////// 145// RemoteGDB::acc 146// 147// Determine if the mapping at va..(va+len) is valid. 148// 149bool --- 10 unchanged lines hidden (view full) --- 160// 161// Translate the kernel debugger register format into 162// the GDB register format. 163void 164RemoteGDB::getregs() 165{ 166 memset(gdbregs.regs, 0, gdbregs.size); 167 | 142{} 143 144/////////////////////////////////////////////////////////// 145// RemoteGDB::acc 146// 147// Determine if the mapping at va..(va+len) is valid. 148// 149bool --- 10 unchanged lines hidden (view full) --- 160// 161// Translate the kernel debugger register format into 162// the GDB register format. 163void 164RemoteGDB::getregs() 165{ 166 memset(gdbregs.regs, 0, gdbregs.size); 167 |
168 gdbregs.regs[RegPc] = context->readPC(); 169 gdbregs.regs[RegNpc] = context->readNextPC(); | 168 if (context->readMiscRegWithEffect(MISCREG_PSTATE) & 169 PSTATE::am) 170 panic("In 32bit mode\n"); 171 172 gdbregs.regs[RegPc] = htobe(context->readPC()); 173 gdbregs.regs[RegNpc] = htobe(context->readNextPC()); |
170 for(int x = RegG0; x <= RegI0 + 7; x++) | 174 for(int x = RegG0; x <= RegI0 + 7; x++) |
171 gdbregs.regs[x] = context->readIntReg(x - RegG0); | 175 gdbregs.regs[x] = htobe(context->readIntReg(x - RegG0)); 176 177 gdbregs.regs[RegFsr] = htobe(context->readMiscRegWithEffect(MISCREG_FSR)); 178 gdbregs.regs[RegFprs] = htobe(context->readMiscRegWithEffect(MISCREG_FPRS)); 179 gdbregs.regs[RegY] = htobe(context->readIntReg(NumIntArchRegs + 1)); 180 gdbregs.regs[RegState] = htobe( 181 context->readMiscRegWithEffect(MISCREG_CWP) | 182 context->readMiscRegWithEffect(MISCREG_PSTATE) << 8 | 183 context->readMiscRegWithEffect(MISCREG_ASI) << 24 | 184 context->readIntReg(NumIntArchRegs + 2) << 32); 185 186 187 DPRINTF(GDBRead, "PC=%#x\n", gdbregs.regs[RegPc]); 188 |
172 //Floating point registers are left at 0 in netbsd 173 //All registers other than the pc, npc and int regs 174 //are ignored as well. 175} 176 177/////////////////////////////////////////////////////////// 178// RemoteGDB::setregs 179// --- 8 unchanged lines hidden (view full) --- 188 for(int x = RegG0; x <= RegI0 + 7; x++) 189 context->setIntReg(x - RegG0, gdbregs.regs[x]); 190 //Only the integer registers, pc and npc are set in netbsd 191} 192 193void 194RemoteGDB::clearSingleStep() 195{ | 189 //Floating point registers are left at 0 in netbsd 190 //All registers other than the pc, npc and int regs 191 //are ignored as well. 192} 193 194/////////////////////////////////////////////////////////// 195// RemoteGDB::setregs 196// --- 8 unchanged lines hidden (view full) --- 205 for(int x = RegG0; x <= RegI0 + 7; x++) 206 context->setIntReg(x - RegG0, gdbregs.regs[x]); 207 //Only the integer registers, pc and npc are set in netbsd 208} 209 210void 211RemoteGDB::clearSingleStep() 212{ |
196 warn("SPARC single stepping not implemented, " 197 "but clearSingleStep called\n"); | 213 if (nextBkpt) 214 clearTempBreakpoint(nextBkpt); |
198} 199 200void 201RemoteGDB::setSingleStep() 202{ | 215} 216 217void 218RemoteGDB::setSingleStep() 219{ |
203 panic("SPARC single stepping not implemented.\n"); | 220 nextBkpt = context->readNextPC(); 221 setTempBreakpoint(nextBkpt); |
204} | 222} |