- exitの場合、casl2 -mのmonitor終了時にメモリーリーク発生するため
- monitor終了時、execmode.monitorとexecmode.stepをfalseにする
- exec側の処理
-- execmode.monitorがfalseでexecptr->startがfalseかexecptr->endがtrueuの場合は即時終了
-- それ以外の場合は、execmode.monitorがfalseのままCOMET IIを実行
/**
* @brief モニター終了時の処理をする
*
- * @return エラーがない場合は0、エラーがある場合は1
*/
-int monquit();
+void monquit();
/**
* @brief COMET IIモニターを起動する
fprintf(stdout, "%s", monmsg);
}
monitor();
+ if(execmode.monitor == false && (execptr->start == false || execptr->stop == true)) {
+ break;
+ }
}
/* プログラムレジスタをチェック */
if(sys->cpu->pr >= sys->memsize) {
}
}
-int monquit()
+void monquit()
{
- int stat = 0;
-
- comet2_shutdown();
+ execmode.monitor = false;
+ execmode.step = false;
freebps();
- free_cmdtable(HASH_CMDTYPE);
- free_cmdtable(HASH_CODE);
-
- if(cerr->num > 0) {
- stat = 1;
- }
- freecerr();
- return stat;
}
void monitor()
/* EOFの処理 */
if(buf == NULL) {
FREE(last_buf);
- exit(monquit());
+ monquit();
+ break;
}
/* 空行(Enterだけ)の場合は、前回のコマンドをリピート */
if(buf[0] == '\0') {
if(cmdtype == MONQUIT) {
FREE(buf);
FREE(last_buf);
- exit(monquit());
+ monquit();
+ break;
}
} while(cmdtype == MONREPEAT);
FREE(buf);
WORD gr = 0;
if(cmdtype == R_ADR_X || cmdtype == R1_R2 || cmdtype == R_) {
gr = (code & 0x00F0) >> 4;
- if(gr < 0 || GRSIZE <= gr) {
+ if(gr >= GRSIZE) {
res = false;
}
}