Deleted Added
sdiff udiff text old ( 7678:f19b6a3a8cec ) new ( 7720:65d338a8dba4 )
full compact
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;

--- 165 unchanged lines hidden (view full) ---

174//
175// Translate the kernel debugger register format into
176// the GDB register format.
177void
178RemoteGDB::getregs()
179{
180 memset(gdbregs.regs, 0, gdbregs.size);
181
182 if (context->readMiscReg(MISCREG_PSTATE) &
183 PSTATE::am) {
184 uint32_t *regs;
185 regs = (uint32_t*)gdbregs.regs;
186 regs[Reg32Pc] = htobe((uint32_t)context->readPC());
187 regs[Reg32Npc] = htobe((uint32_t)context->readNextPC());
188 for(int x = RegG0; x <= RegI0 + 7; x++)
189 regs[x] = htobe((uint32_t)context->readIntReg(x - RegG0));
190
191 regs[Reg32Y] = htobe((uint32_t)context->readIntReg(NumIntArchRegs + 1));
192 regs[Reg32Psr] = htobe((uint32_t)context->readMiscReg(MISCREG_PSTATE));
193 regs[Reg32Fsr] = htobe((uint32_t)context->readMiscReg(MISCREG_FSR));
194 regs[Reg32Csr] = htobe((uint32_t)context->readIntReg(NumIntArchRegs + 2));
195 } else {
196 gdbregs.regs[RegPc] = htobe(context->readPC());
197 gdbregs.regs[RegNpc] = htobe(context->readNextPC());
198 for(int x = RegG0; x <= RegI0 + 7; x++)
199 gdbregs.regs[x] = htobe(context->readIntReg(x - RegG0));
200
201 gdbregs.regs[RegFsr] = htobe(context->readMiscReg(MISCREG_FSR));
202 gdbregs.regs[RegFprs] = htobe(context->readMiscReg(MISCREG_FPRS));
203 gdbregs.regs[RegY] = htobe(context->readIntReg(NumIntArchRegs + 1));
204 gdbregs.regs[RegState] = htobe(
205 context->readMiscReg(MISCREG_CWP) |

--- 13 unchanged lines hidden (view full) ---

219// RemoteGDB::setregs
220//
221// Translate the GDB register format into the kernel
222// debugger register format.
223//
224void
225RemoteGDB::setregs()
226{
227 context->setPC(gdbregs.regs[RegPc]);
228 context->setNextPC(gdbregs.regs[RegNpc]);
229 for(int x = RegG0; x <= RegI0 + 7; x++)
230 context->setIntReg(x - RegG0, gdbregs.regs[x]);
231 //Only the integer registers, pc and npc are set in netbsd
232}
233
234void
235RemoteGDB::clearSingleStep()
236{
237 if (nextBkpt)
238 clearTempBreakpoint(nextBkpt);
239}
240
241void
242RemoteGDB::setSingleStep()
243{
244 nextBkpt = context->readNextPC();
245 setTempBreakpoint(nextBkpt);
246}