From 745844cc9b21c3cedbc8dd9b2d418c51e0325175 Mon Sep 17 00:00:00 2001 From: Dnomd343 Date: Thu, 12 Jan 2023 10:21:34 +0800 Subject: [PATCH] feat: test global break point --- src/fast_cal.cc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/fast_cal.cc b/src/fast_cal.cc index acb504d..b79d507 100644 --- a/src/fast_cal.cc +++ b/src/fast_cal.cc @@ -17,8 +17,14 @@ std::queue cache; std::unordered_map cases; +//bool stop_flag; + void add_new_case(uint64_t code, uint64_t mask) { +// if (stop_flag) { +// return; +// } + auto exist_case = cases.find(code); if (exist_case != cases.end()) { // find existed case @@ -30,12 +36,19 @@ void add_new_case(uint64_t code, uint64_t mask) { cases[code] = fast_cal_t { .code = code, .mask = mask, +// .step = cache.front()->step + 1, .last = cache.front(), };; cache.emplace(&cases[code]); // TODO: try to check head address = 0xD at here +// if (((code >> (3 * 0xD)) & 0b111) == B_2x2) { +// std::cout << "Resolved" << std::endl; +// std::cout << RawCode(cache.front()->code).dump_case() << std::endl; +// stop_flag = true; +// } + } uint32_t fast_cal(uint64_t code) { @@ -46,21 +59,29 @@ uint32_t fast_cal(uint64_t code) { cache.empty(); +// stop_flag = false; + cases[code] = fast_cal_t { .code = code, .mask = 0, +// .step = 0, .last = nullptr, }; cache.emplace(&cases[code]); while (!cache.empty()) { + // break check point if (((cache.front()->code >> (3 * 0xD)) & 0b111) == B_2x2) { std::cout << "Resolved" << std::endl; // std::cout << RawCode(cache.front()->code).dump_case() << std::endl; break; } +// if (stop_flag) { +// break; +// } + core.next_step(cache.front()->code, cache.front()->mask); cache.pop(); }