From dfcccd4523716fbdfae3ab184a38fdeb8f36e939 Mon Sep 17 00:00:00 2001 From: ValKmjolnir Date: Sat, 21 Oct 2023 18:00:11 +0800 Subject: [PATCH] :bug: fix invalid debug mode problem --- src/nasal_dbg.cpp | 9 +++++---- test/flush_screen.nas | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/nasal_dbg.cpp b/src/nasal_dbg.cpp index 491a2e1..fd0ac51 100644 --- a/src/nasal_dbg.cpp +++ b/src/nasal_dbg.cpp @@ -181,10 +181,10 @@ void dbg::interact() { if (do_profiling) { return; } - - if ((bytecode[ctx.pc].fidx!=bk_fidx || - bytecode[ctx.pc].line!=bk_line) && // break point - !next) {// next step + + // is not break point and is not next stop command + const auto& code = bytecode[ctx.pc]; + if ((code.fidx!=bk_fidx || code.line!=bk_line) && !next) { return; } @@ -240,6 +240,7 @@ void dbg::run( set_detail_report_info(true); do_profiling = profile || show_all_prof_result; + next = true; const auto& file_list = linker.get_file_list(); fsize = file_list.size(); diff --git a/test/flush_screen.nas b/test/flush_screen.nas index 18e064d..231bfda 100644 --- a/test/flush_screen.nas +++ b/test/flush_screen.nas @@ -24,5 +24,5 @@ while(1) { res ~= "\n"; } print(res); - unix.sleep(1/30); -} \ No newline at end of file + unix.sleep(1/20); +}