Correction du fonctionnement du deboguage : breakpoint & pas à pas fonctionnel

This commit is contained in:
Horde Nicolas 2021-07-16 18:27:29 +02:00
parent 62678bdd67
commit 9cb767d1ec
2 changed files with 17 additions and 11 deletions

View File

@ -853,9 +853,9 @@ std::vector<int> VMEngine::getBreapoints()
int line=0; int line=0;
for(std::array<std::string, 4> item: items) for(std::array<std::string, 4> 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); list.push_back(line);
break; 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]"); throw Error("VM IA86 - hook instructions.......................[ERREUR]");
//((Menu *)user_data)->tolog(intToHexString(code[0],2)); //((Menu *)user_data)->tolog(intToHexString(code[0],2));
//((Menu *)user_data)->tolog(intToHexString(code[1],2)); //((Menu *)user_data)->tolog(intToHexString(code[1],2));
bool breakp=false;
for(std::array<uint32_t,2> bp: breakpoints)
if (address==bp[0]*16+bp[1])
{
breakp=true;
break;
}
if (!breakp && (!step || (hadcall>0 && !call))) return;
if (code[0]==0xF4) if (code[0]==0xF4)
executed=false; 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)))) 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; hadcall=address+size;
bool breakp=false; else
for(std::array<uint32_t,2> bp: breakpoints) hadcall=0;
if (address==bp[0]*16+bp[1])
breakp=true;
if ((!step && !breakp) || (hadcall>0 && !call && !breakp)) return;
uc_emu_stop(uc); uc_emu_stop(uc);
} }
@ -1578,6 +1583,7 @@ void Menu::loadLevel(int alevel)
debug.clear(); debug.clear();
vm.setRights(level.rights); vm.setRights(level.rights);
AdjustWindows(); AdjustWindows();
showInstr();
} }
void Menu::end() void Menu::end()
@ -1683,9 +1689,9 @@ void Menu::refresh()
{ {
finalcut::FApplication::setDefaultTheme(); finalcut::FApplication::setDefaultTheme();
} }
/*auto root_widget = getRootWidget(); auto root_widget = getRootWidget();
root_widget->resetColors(); root_widget->resetColors();
root_widget->redraw();*/ root_widget->redraw();
} }
void Menu::exec() void Menu::exec()

View File

@ -5,7 +5,7 @@ KITTY=$(kitty -v|grep created)
if [ "${KITTY}" != "" ]; then if [ "${KITTY}" != "" ]; then
echo "Kitty installé" echo "Kitty installé"
if [ ${X} -ge 1920 ]; then 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 exit
fi fi
fi fi
@ -22,4 +22,4 @@ elif [ ${X} -ge 1280 ]; then
else else
SIZE=6 SIZE=6
fi 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