diff -r b28e7286990c -r b1f222887c0c src/sim/syscall_emul.cc --- a/src/sim/syscall_emul.cc Tue Jul 27 20:00:38 2010 -0700 +++ b/src/sim/syscall_emul.cc Thu Jul 29 21:42:12 2010 +0100 @@ -118,12 +118,16 @@ exitGroupFunc(SyscallDesc *desc, int callnum, LiveProcess *process, ThreadContext *tc) { - // really should just halt all thread contexts belonging to this - // process in case there's another process running... - int index = 0; - exitSimLoop("target called exit()", - process->getSyscallArg(tc, index) & 0xff); - + ThreadContext *ptc; + for(unsigned i = 0; i < process->contextIds.size(); ++i) { + ptc = process->system->getThreadContext(process->contextIds[i]); + ptc->halt(); + } + if(process->system->numRunningContexts() == 0) { + int index = 0; + exitSimLoop("target called exit()", + process->getSyscallArg(tc, index) & 0xff); + } return 1; }