remote_gdb.cc (10600:e60c7758cf69) | remote_gdb.cc (10601:6efb37480d87) |
---|---|
1/* 2 * Copyright 2014 Google, Inc. 3 * Copyright (c) 2007 The Hewlett-Packard Development Company 4 * All rights reserved. 5 * 6 * The license below extends only to copyright in the software and shall 7 * not be construed as granting a license to any other intellectual 8 * property including but not limited to intellectual property relating --- 47 unchanged lines hidden (view full) --- 56#include "cpu/thread_context.hh" 57#include "mem/page_table.hh" 58#include "sim/full_system.hh" 59 60using namespace std; 61using namespace X86ISA; 62 63RemoteGDB::RemoteGDB(System *_system, ThreadContext *c) : | 1/* 2 * Copyright 2014 Google, Inc. 3 * Copyright (c) 2007 The Hewlett-Packard Development Company 4 * All rights reserved. 5 * 6 * The license below extends only to copyright in the software and shall 7 * not be construed as granting a license to any other intellectual 8 * property including but not limited to intellectual property relating --- 47 unchanged lines hidden (view full) --- 56#include "cpu/thread_context.hh" 57#include "mem/page_table.hh" 58#include "sim/full_system.hh" 59 60using namespace std; 61using namespace X86ISA; 62 63RemoteGDB::RemoteGDB(System *_system, ThreadContext *c) : |
64 BaseRemoteGDB(_system, c, GDB_REG_BYTES), singleStepEvent(this) | 64 BaseRemoteGDB(_system, c, GDB_REG_BYTES) |
65{} 66 67bool 68RemoteGDB::acc(Addr va, size_t len) 69{ 70 if (FullSystem) { 71 Walker *walker = context->getDTBPtr()->getWalker(); 72 unsigned logBytes; --- 11 unchanged lines hidden (view full) --- 84 return fault == NoFault; 85 } else { 86 TlbEntry entry; 87 return context->getProcessPtr()->pTable->lookup(va, entry); 88 } 89} 90 91void | 65{} 66 67bool 68RemoteGDB::acc(Addr va, size_t len) 69{ 70 if (FullSystem) { 71 Walker *walker = context->getDTBPtr()->getWalker(); 72 unsigned logBytes; --- 11 unchanged lines hidden (view full) --- 84 return fault == NoFault; 85 } else { 86 TlbEntry entry; 87 return context->getProcessPtr()->pTable->lookup(va, entry); 88 } 89} 90 91void |
92RemoteGDB::SingleStepEvent::process() 93{ 94 if (!gdb->singleStepEvent.scheduled()) 95 gdb->scheduleInstCommitEvent(&gdb->singleStepEvent, 1); 96 gdb->trap(SIGTRAP); 97} 98 99void | |
100RemoteGDB::getregs() 101{ 102 HandyM5Reg m5reg = context->readMiscRegNoEffect(MISCREG_M5_REG); 103 if (m5reg.submode == SixtyFourBitMode) { 104 gdbregs.regs64[GDB64_RAX] = context->readIntReg(INTREG_RAX); 105 gdbregs.regs64[GDB64_RBX] = context->readIntReg(INTREG_RBX); 106 gdbregs.regs64[GDB64_RCX] = context->readIntReg(INTREG_RCX); 107 gdbregs.regs64[GDB64_RDX] = context->readIntReg(INTREG_RDX); --- 118 unchanged lines hidden (view full) --- 226 warn("Remote gdb: Ignoring update to FS.\n"); 227 } 228 if (gdbregs.regs32[GDB32_GS] != 229 context->readMiscRegNoEffect(MISCREG_GS)) { 230 warn("Remote gdb: Ignoring update to GS.\n"); 231 } 232 } 233} | 92RemoteGDB::getregs() 93{ 94 HandyM5Reg m5reg = context->readMiscRegNoEffect(MISCREG_M5_REG); 95 if (m5reg.submode == SixtyFourBitMode) { 96 gdbregs.regs64[GDB64_RAX] = context->readIntReg(INTREG_RAX); 97 gdbregs.regs64[GDB64_RBX] = context->readIntReg(INTREG_RBX); 98 gdbregs.regs64[GDB64_RCX] = context->readIntReg(INTREG_RCX); 99 gdbregs.regs64[GDB64_RDX] = context->readIntReg(INTREG_RDX); --- 118 unchanged lines hidden (view full) --- 218 warn("Remote gdb: Ignoring update to FS.\n"); 219 } 220 if (gdbregs.regs32[GDB32_GS] != 221 context->readMiscRegNoEffect(MISCREG_GS)) { 222 warn("Remote gdb: Ignoring update to GS.\n"); 223 } 224 } 225} |
234 235void 236RemoteGDB::clearSingleStep() 237{ 238 descheduleInstCommitEvent(&singleStepEvent); 239} 240 241void 242RemoteGDB::setSingleStep() 243{ 244 if (!singleStepEvent.scheduled()) 245 scheduleInstCommitEvent(&singleStepEvent, 1); 246} | |