From 9cb767d1ec4078bc67f4dc25f8ecbab87b28d940 Mon Sep 17 00:00:00 2001 From: Horde Nicolas Date: Fri, 16 Jul 2021 18:27:29 +0200 Subject: [PATCH] =?UTF-8?q?Correction=20du=20fonctionnement=20du=20debogua?= =?UTF-8?q?ge=20:=20breakpoint=20&=20pas=20=C3=A0=20pas=20fonctionnel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ia86.cpp | 24 +++++++++++++++--------- start.sh | 4 ++-- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/ia86.cpp b/ia86.cpp index 685e393..402f106 100644 --- a/ia86.cpp +++ b/ia86.cpp @@ -853,9 +853,9 @@ std::vector VMEngine::getBreapoints() int line=0; for(std::array item: items) { - if (item[0]==intToHexString(bp[1],8))// && getCS()==bp[0]) + if (item[0]==intToHexString(bp[1],8) && getCS()==bp[0]) { - ((Menu*)widget)->tolog(to_string(line)); + //((Menu*)widget)->tolog(to_string(line)); list.push_back(line); break; } @@ -889,15 +889,20 @@ static void hook_code (uc_engine *uc, uint64_t address, uint32_t size, void *use throw Error("VM IA86 - hook instructions.......................[ERREUR]"); //((Menu *)user_data)->tolog(intToHexString(code[0],2)); //((Menu *)user_data)->tolog(intToHexString(code[1],2)); + bool breakp=false; + for(std::array bp: breakpoints) + if (address==bp[0]*16+bp[1]) + { + breakp=true; + break; + } + if (!breakp && (!step || (hadcall>0 && !call))) return; if (code[0]==0xF4) executed=false; else if (step && (code[0]==0xE8 || code[0]==0xFF || code[0]==0x9A || (code[0]==0x66 && (code[1]==0xE8 || code[1]==0xFF || code[1]==0x9A)))) hadcall=address+size; - bool breakp=false; - for(std::array bp: breakpoints) - if (address==bp[0]*16+bp[1]) - breakp=true; - if ((!step && !breakp) || (hadcall>0 && !call && !breakp)) return; + else + hadcall=0; uc_emu_stop(uc); } @@ -1578,6 +1583,7 @@ void Menu::loadLevel(int alevel) debug.clear(); vm.setRights(level.rights); AdjustWindows(); + showInstr(); } void Menu::end() @@ -1683,9 +1689,9 @@ void Menu::refresh() { finalcut::FApplication::setDefaultTheme(); } - /*auto root_widget = getRootWidget(); + auto root_widget = getRootWidget(); root_widget->resetColors(); - root_widget->redraw();*/ + root_widget->redraw(); } void Menu::exec() diff --git a/start.sh b/start.sh index 1859f3f..0d52196 100755 --- a/start.sh +++ b/start.sh @@ -5,7 +5,7 @@ KITTY=$(kitty -v|grep created) if [ "${KITTY}" != "" ]; then echo "Kitty installé" if [ ${X} -ge 1920 ]; then - kitty --start-as fullscreen bash -c "docker run -it -e COLUMNS=213 -e LINES=58 --name maker --rm -v $(pwd):/data maker ./ia86" + kitty --start-as fullscreen ./ia86 exit fi fi @@ -22,4 +22,4 @@ elif [ ${X} -ge 1280 ]; then else SIZE=6 fi -xterm -fullscreen -fa monaco -fs ${SIZE} -bg black -fg green -e bash -c "docker run -it -e COLUMNS=213 -e LINES=58 --name maker --rm -v $(pwd):/data maker ./ia86" +xterm -fullscreen -fa monaco -fs ${SIZE} -bg black -fg green -e ./ia86