remote_gdb.cc (4070:74449a198a44) remote_gdb.cc (4172:141705d83494)
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;

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

162//
163// Translate the kernel debugger register format into
164// the GDB register format.
165void
166RemoteGDB::getregs()
167{
168 memset(gdbregs.regs, 0, gdbregs.size);
169
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;

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

162//
163// Translate the kernel debugger register format into
164// the GDB register format.
165void
166RemoteGDB::getregs()
167{
168 memset(gdbregs.regs, 0, gdbregs.size);
169
170 if (context->readMiscRegWithEffect(MISCREG_PSTATE) &
170 if (context->readMiscReg(MISCREG_PSTATE) &
171 PSTATE::am) {
172 uint32_t *regs;
173 regs = (uint32_t*)gdbregs.regs;
174 regs[Reg32Pc] = htobe((uint32_t)context->readPC());
175 regs[Reg32Npc] = htobe((uint32_t)context->readNextPC());
176 for(int x = RegG0; x <= RegI0 + 7; x++)
177 regs[x] = htobe((uint32_t)context->readIntReg(x - RegG0));
178
179 regs[Reg32Y] = htobe((uint32_t)context->readIntReg(NumIntArchRegs + 1));
171 PSTATE::am) {
172 uint32_t *regs;
173 regs = (uint32_t*)gdbregs.regs;
174 regs[Reg32Pc] = htobe((uint32_t)context->readPC());
175 regs[Reg32Npc] = htobe((uint32_t)context->readNextPC());
176 for(int x = RegG0; x <= RegI0 + 7; x++)
177 regs[x] = htobe((uint32_t)context->readIntReg(x - RegG0));
178
179 regs[Reg32Y] = htobe((uint32_t)context->readIntReg(NumIntArchRegs + 1));
180 regs[Reg32Psr] = htobe((uint32_t)context->readMiscRegWithEffect(MISCREG_PSTATE));
181 regs[Reg32Fsr] = htobe((uint32_t)context->readMiscRegWithEffect(MISCREG_FSR));
180 regs[Reg32Psr] = htobe((uint32_t)context->readMiscReg(MISCREG_PSTATE));
181 regs[Reg32Fsr] = htobe((uint32_t)context->readMiscReg(MISCREG_FSR));
182 regs[Reg32Csr] = htobe((uint32_t)context->readIntReg(NumIntArchRegs + 2));
183 } else {
184 gdbregs.regs[RegPc] = htobe(context->readPC());
185 gdbregs.regs[RegNpc] = htobe(context->readNextPC());
186 for(int x = RegG0; x <= RegI0 + 7; x++)
187 gdbregs.regs[x] = htobe(context->readIntReg(x - RegG0));
188
182 regs[Reg32Csr] = htobe((uint32_t)context->readIntReg(NumIntArchRegs + 2));
183 } else {
184 gdbregs.regs[RegPc] = htobe(context->readPC());
185 gdbregs.regs[RegNpc] = htobe(context->readNextPC());
186 for(int x = RegG0; x <= RegI0 + 7; x++)
187 gdbregs.regs[x] = htobe(context->readIntReg(x - RegG0));
188
189 gdbregs.regs[RegFsr] = htobe(context->readMiscRegWithEffect(MISCREG_FSR));
190 gdbregs.regs[RegFprs] = htobe(context->readMiscRegWithEffect(MISCREG_FPRS));
189 gdbregs.regs[RegFsr] = htobe(context->readMiscReg(MISCREG_FSR));
190 gdbregs.regs[RegFprs] = htobe(context->readMiscReg(MISCREG_FPRS));
191 gdbregs.regs[RegY] = htobe(context->readIntReg(NumIntArchRegs + 1));
192 gdbregs.regs[RegState] = htobe(
191 gdbregs.regs[RegY] = htobe(context->readIntReg(NumIntArchRegs + 1));
192 gdbregs.regs[RegState] = htobe(
193 context->readMiscRegWithEffect(MISCREG_CWP) |
194 context->readMiscRegWithEffect(MISCREG_PSTATE) << 8 |
195 context->readMiscRegWithEffect(MISCREG_ASI) << 24 |
193 context->readMiscReg(MISCREG_CWP) |
194 context->readMiscReg(MISCREG_PSTATE) << 8 |
195 context->readMiscReg(MISCREG_ASI) << 24 |
196 context->readIntReg(NumIntArchRegs + 2) << 32);
197 }
198
199 DPRINTF(GDBRead, "PC=%#x\n", gdbregs.regs[RegPc]);
200
201 //Floating point registers are left at 0 in netbsd
202 //All registers other than the pc, npc and int regs
203 //are ignored as well.

--- 31 unchanged lines hidden ---
196 context->readIntReg(NumIntArchRegs + 2) << 32);
197 }
198
199 DPRINTF(GDBRead, "PC=%#x\n", gdbregs.regs[RegPc]);
200
201 //Floating point registers are left at 0 in netbsd
202 //All registers other than the pc, npc and int regs
203 //are ignored as well.

--- 31 unchanged lines hidden ---