remote_gdb.cc (9020:14321ce30881) remote_gdb.cc (10595:25ecfc14f73f)
1/*
1/*
2 * Copyright 2014 Google, Inc.
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;
9 * redistributions in binary form must reproduce the above copyright

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

140#include "mem/port.hh"
141#include "sim/system.hh"
142#include "sim/full_system.hh"
143
144using namespace std;
145using namespace AlphaISA;
146
147RemoteGDB::RemoteGDB(System *_system, ThreadContext *tc)
3 * Copyright (c) 2002-2005 The Regents of The University of Michigan
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer;
10 * redistributions in binary form must reproduce the above copyright

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

141#include "mem/port.hh"
142#include "sim/system.hh"
143#include "sim/full_system.hh"
144
145using namespace std;
146using namespace AlphaISA;
147
148RemoteGDB::RemoteGDB(System *_system, ThreadContext *tc)
148 : BaseRemoteGDB(_system, tc, KGDB_NUMREGS)
149 : BaseRemoteGDB(_system, tc, KGDB_NUMREGS * sizeof(uint64_t))
149{
150 memset(gdbregs.regs, 0, gdbregs.bytes());
151}
152
153/*
154 * Determine if the mapping at va..(va+len) is valid.
155 */
156bool

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

206 * Translate the kernel debugger register format into the GDB register
207 * format.
208 */
209void
210RemoteGDB::getregs()
211{
212 memset(gdbregs.regs, 0, gdbregs.bytes());
213
150{
151 memset(gdbregs.regs, 0, gdbregs.bytes());
152}
153
154/*
155 * Determine if the mapping at va..(va+len) is valid.
156 */
157bool

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

207 * Translate the kernel debugger register format into the GDB register
208 * format.
209 */
210void
211RemoteGDB::getregs()
212{
213 memset(gdbregs.regs, 0, gdbregs.bytes());
214
214 gdbregs.regs[KGDB_REG_PC] = context->pcState().pc();
215 gdbregs.regs64[KGDB_REG_PC] = context->pcState().pc();
215
216 // @todo: Currently this is very Alpha specific.
216
217 // @todo: Currently this is very Alpha specific.
217 if (PcPAL(gdbregs.regs[KGDB_REG_PC])) {
218 for (int i = 0; i < NumIntArchRegs; ++i) {
219 gdbregs.regs[i] = context->readIntReg(reg_redir[i]);
220 }
218 if (PcPAL(gdbregs.regs64[KGDB_REG_PC])) {
219 for (int i = 0; i < NumIntArchRegs; ++i)
220 gdbregs.regs64[i] = context->readIntReg(reg_redir[i]);
221 } else {
221 } else {
222 for (int i = 0; i < NumIntArchRegs; ++i) {
223 gdbregs.regs[i] = context->readIntReg(i);
224 }
222 for (int i = 0; i < NumIntArchRegs; ++i)
223 gdbregs.regs64[i] = context->readIntReg(i);
225 }
226
227#ifdef KGDB_FP_REGS
224 }
225
226#ifdef KGDB_FP_REGS
228 for (int i = 0; i < NumFloatArchRegs; ++i) {
229 gdbregs.regs[i + KGDB_REG_F0] = context->readFloatRegBits(i);
230 }
227 for (int i = 0; i < NumFloatArchRegs; ++i)
228 gdbregs.regs64[i + KGDB_REG_F0] = context->readFloatRegBits(i);
231#endif
232}
233
234/*
235 * Translate the GDB register format into the kernel debugger register
236 * format.
237 */
238void
239RemoteGDB::setregs()
240{
241 // @todo: Currently this is very Alpha specific.
229#endif
230}
231
232/*
233 * Translate the GDB register format into the kernel debugger register
234 * format.
235 */
236void
237RemoteGDB::setregs()
238{
239 // @todo: Currently this is very Alpha specific.
242 if (PcPAL(gdbregs.regs[KGDB_REG_PC])) {
240 if (PcPAL(gdbregs.regs64[KGDB_REG_PC])) {
243 for (int i = 0; i < NumIntArchRegs; ++i) {
241 for (int i = 0; i < NumIntArchRegs; ++i) {
244 context->setIntReg(reg_redir[i], gdbregs.regs[i]);
242 context->setIntReg(reg_redir[i], gdbregs.regs64[i]);
245 }
246 } else {
247 for (int i = 0; i < NumIntArchRegs; ++i) {
243 }
244 } else {
245 for (int i = 0; i < NumIntArchRegs; ++i) {
248 context->setIntReg(i, gdbregs.regs[i]);
246 context->setIntReg(i, gdbregs.regs64[i]);
249 }
250 }
251
252#ifdef KGDB_FP_REGS
253 for (int i = 0; i < NumFloatArchRegs; ++i) {
247 }
248 }
249
250#ifdef KGDB_FP_REGS
251 for (int i = 0; i < NumFloatArchRegs; ++i) {
254 context->setFloatRegBits(i, gdbregs.regs[i + KGDB_REG_F0]);
252 context->setFloatRegBits(i, gdbregs.regs64[i + KGDB_REG_F0]);
255 }
256#endif
253 }
254#endif
257 context->pcState(gdbregs.regs[KGDB_REG_PC]);
255 context->pcState(gdbregs.regs64[KGDB_REG_PC]);
258}
259
260void
261RemoteGDB::clearSingleStep()
262{
263 DPRINTF(GDBMisc, "clearSingleStep bt_addr=%#x nt_addr=%#x\n",
264 takenBkpt, notTakenBkpt);
265

--- 56 unchanged lines hidden ---
256}
257
258void
259RemoteGDB::clearSingleStep()
260{
261 DPRINTF(GDBMisc, "clearSingleStep bt_addr=%#x nt_addr=%#x\n",
262 takenBkpt, notTakenBkpt);
263

--- 56 unchanged lines hidden ---