system.cc (6658:f4de76601762) system.cc (7445:dfd04ffc1773)
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;

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

146 delete kernelSymtab;
147 delete kernel;
148#else
149 panic("System::fixFuncEventAddr needs to be rewritten "
150 "to work with syscall emulation");
151#endif // FULL_SYSTEM}
152}
153
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;

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

146 delete kernelSymtab;
147 delete kernel;
148#else
149 panic("System::fixFuncEventAddr needs to be rewritten "
150 "to work with syscall emulation");
151#endif // FULL_SYSTEM}
152}
153
154int rgdb_wait = -1;
155int rgdb_enable = true;
156
157void
158System::setMemoryMode(Enums::MemoryMode mode)
159{
160 assert(getState() == Drained);
161 memoryMode = mode;
162}
163
164bool System::breakpoint()
165{
166 if (remoteGDB.size())
167 return remoteGDB[0]->breakpoint();
168 return false;
169}
170
154void
155System::setMemoryMode(Enums::MemoryMode mode)
156{
157 assert(getState() == Drained);
158 memoryMode = mode;
159}
160
161bool System::breakpoint()
162{
163 if (remoteGDB.size())
164 return remoteGDB[0]->breakpoint();
165 return false;
166}
167
168/**
169 * Setting rgdb_wait to a positive integer waits for a remote debugger to
170 * connect to that context ID before continuing. This should really
171 be a parameter on the CPU object or something...
172 */
173int rgdb_wait = -1;
174
171int
172System::registerThreadContext(ThreadContext *tc, int assigned)
173{
174 int id;
175 if (assigned == -1) {
176 for (id = 0; id < threadContexts.size(); id++) {
177 if (!threadContexts[id])
178 break;

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

188
189 if (threadContexts[id])
190 fatal("Cannot have two CPUs with the same id (%d)\n", id);
191
192 threadContexts[id] = tc;
193 _numContexts++;
194
195 int port = getRemoteGDBPort();
175int
176System::registerThreadContext(ThreadContext *tc, int assigned)
177{
178 int id;
179 if (assigned == -1) {
180 for (id = 0; id < threadContexts.size(); id++) {
181 if (!threadContexts[id])
182 break;

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

192
193 if (threadContexts[id])
194 fatal("Cannot have two CPUs with the same id (%d)\n", id);
195
196 threadContexts[id] = tc;
197 _numContexts++;
198
199 int port = getRemoteGDBPort();
196 if (rgdb_enable && port) {
200 if (port) {
197 RemoteGDB *rgdb = new RemoteGDB(this, tc);
198 GDBListener *gdbl = new GDBListener(rgdb, port + id);
199 gdbl->listen();
201 RemoteGDB *rgdb = new RemoteGDB(this, tc);
202 GDBListener *gdbl = new GDBListener(rgdb, port + id);
203 gdbl->listen();
200 /**
201 * Uncommenting this line waits for a remote debugger to
202 * connect to the simulator before continuing.
203 */
204
204 if (rgdb_wait != -1 && rgdb_wait == id)
205 gdbl->accept();
206
207 if (remoteGDB.size() <= id) {
208 remoteGDB.resize(id + 1);
209 }
210
211 remoteGDB[id] = rgdb;

--- 114 unchanged lines hidden ---
205 if (rgdb_wait != -1 && rgdb_wait == id)
206 gdbl->accept();
207
208 if (remoteGDB.size() <= id) {
209 remoteGDB.resize(id + 1);
210 }
211
212 remoteGDB[id] = rgdb;

--- 114 unchanged lines hidden ---