1/* 2 * Copyright (c) 2003-2006 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; --- 18 unchanged lines hidden (view full) --- 27 * 28 * Authors: Steve Reinhardt 29 * Lisa Hsu 30 * Nathan Binkert 31 * Ali Saidi 32 */ 33 34#include "arch/isa_traits.hh" |
35#include "arch/remote_gdb.hh" |
36#include "base/loader/object_file.hh" 37#include "base/loader/symtab.hh" 38#include "base/trace.hh" 39#include "cpu/thread_context.hh" 40#include "mem/mem_object.hh" 41#include "mem/physical.hh" 42#include "sim/builder.hh" 43#include "sim/byteswap.hh" 44#include "sim/system.hh" 45#if FULL_SYSTEM 46#include "arch/vtophys.hh" |
47#include "kern/kernel_stats.hh" 48#endif 49 50using namespace std; 51using namespace TheISA; 52 53vector<System *> System::systemList; 54 --- 81 unchanged lines hidden (view full) --- 136 delete kernelSymtab; 137 delete kernel; 138#else 139 panic("System::fixFuncEventAddr needs to be rewritten " 140 "to work with syscall emulation"); 141#endif // FULL_SYSTEM} 142} 143 |
144int rgdb_wait = -1; 145 |
146void 147System::setMemoryMode(MemoryMode mode) 148{ 149 assert(getState() == Drained); 150 memoryMode = mode; 151} 152 |
153bool System::breakpoint() 154{ 155 return remoteGDB[0]->breakpoint(); 156} 157 |
158int 159System::registerThreadContext(ThreadContext *tc, int id) 160{ 161 if (id == -1) { 162 for (id = 0; id < threadContexts.size(); id++) { 163 if (!threadContexts[id]) 164 break; 165 } 166 } 167 168 if (threadContexts.size() <= id) 169 threadContexts.resize(id + 1); 170 171 if (threadContexts[id]) 172 panic("Cannot have two CPUs with the same id (%d)\n", id); 173 174 threadContexts[id] = tc; 175 numcpus++; 176 |
177 RemoteGDB *rgdb = new RemoteGDB(this, tc); 178 GDBListener *gdbl = new GDBListener(rgdb, 7000 + id); 179 gdbl->listen(); 180 /** 181 * Uncommenting this line waits for a remote debugger to connect 182 * to the simulator before continuing. 183 */ 184 if (rgdb_wait != -1 && rgdb_wait == id) 185 gdbl->accept(); 186 187 if (remoteGDB.size() <= id) { 188 remoteGDB.resize(id + 1); 189 } 190 191 remoteGDB[id] = rgdb; |
192 193 return id; 194} 195 196void 197System::startup() 198{ 199 int i; --- 5 unchanged lines hidden (view full) --- 205System::replaceThreadContext(ThreadContext *tc, int id) 206{ 207 if (id >= threadContexts.size()) { 208 panic("replaceThreadContext: bad id, %d >= %d\n", 209 id, threadContexts.size()); 210 } 211 212 threadContexts[id] = tc; |
213 remoteGDB[id]->replaceThreadContext(tc); |
214} 215 216#if !FULL_SYSTEM 217Addr 218System::new_page() 219{ 220 Addr return_addr = page_ptr << LogVMPageSize; 221 ++page_ptr; --- 79 unchanged lines hidden --- |