diff -ruN kozos16/i386-stub.c kozos18/i386-stub.c --- kozos16/i386-stub.c Sun Nov 18 21:36:23 2007 +++ kozos18/i386-stub.c Sun Nov 18 23:41:18 2007 @@ -91,6 +91,7 @@ #include #include +#include "thread.h" /************************************************************************ * @@ -923,6 +924,53 @@ m68k-stub.c and sparc-stub.c don't have it. */ BREAKPOINT (); #endif + break; + + case 'q': + switch (*ptr++) + { + case 'L': + { + int startflag, doneflag, countmax, count = 1, i; + unsigned int threadid[2]; + kz_thread *thp; + + startflag = hex(*ptr++); + countmax = hex(*ptr++) << 4; + countmax += hex(*ptr++); + + hex2mem(ptr, threadid, 8, 0); + + doneflag = 1; + for (i = 0; i < THREAD_NUM; i++) { + thp = &threads[i]; + if (!thp->id) continue; + if ((unsigned int)thp->id > threadid[1]) { + /* 前回の次のスレッド */ + doneflag = 0; + break; + } + } + + ptr = remcomOutBuffer; + *ptr++ = 'q'; + *ptr++ = 'M'; + *ptr++ = hexchars[count >> 4]; + *ptr++ = hexchars[count & 0xf]; + *ptr++ = doneflag ? '1' : '0'; + ptr = mem2hex(threadid, ptr, 8, 0); + + if (!doneflag) { + threadid[0] = 0; + threadid[1] = (int)thp->id; + ptr = mem2hex(threadid, ptr, 8, 0); + } + *ptr++ = '\0'; + } + break; + default: + break; + } break; } /* switch */