Skip to content

Commit 9ef3473

Browse files
Start threads (except for CPU) when using IDB
Component threads are necessary for the emulation to work. Closes #18
1 parent d7e7c93 commit 9ef3473

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/AlphaSim.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,8 @@ int main_sim(int argc, char *argv[]) {
332332
}
333333
#endif
334334
#if defined(IDB)
335+
theSystem->start_threads();
336+
335337
if (argc > 1 && argc < 4 && argv[argc - 1][0] == '@')
336338
trc->run_script(argv[argc - 1] + 1);
337339
else

src/System.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2377,8 +2377,15 @@ void CSystem::start_threads() {
23772377
int i;
23782378

23792379
printf("Start threads:");
2380-
for (i = 0; i < iNumComponents; i++)
2380+
for (i = 0; i < iNumComponents; i++) {
2381+
#ifdef IDB
2382+
// When running with IDB, the trace engine takes care of managing the CPU,
2383+
// so its thread shouldn't be started.
2384+
if (dynamic_cast<CAlphaCPU *>(acComponents[i]))
2385+
continue;
2386+
#endif
23812387
acComponents[i]->start_threads();
2388+
}
23822389
printf("\n");
23832390

23842391
for (i = 0; i < iNumCPUs; i++)

0 commit comments

Comments
 (0)