added basic functionalities to the debugger mode

This commit is contained in:
cozis
2021-11-02 09:17:03 +00:00
parent 7e04b0fc6d
commit 022610bb71
7 changed files with 267 additions and 22 deletions
+22
View File
@@ -141,6 +141,28 @@ Source *Executable_GetSource(Executable *exe)
return exe->src;
}
int Executable_GetInstrOffset(Executable *exe, int index)
{
if(index < 0 || index >= exe->bodyl)
return -1;
if(exe->src)
return exe->body[index].offset;
else
return -1;
}
int Executable_GetInstrLength(Executable *exe, int index)
{
if(index < 0 || index >= exe->bodyl)
return -1;
if(exe->src)
return exe->body[index].length;
else
return -1;
}
_Bool Executable_Fetch(Executable *exe, int index, Opcode *opcode, Operand *ops, int *opc)
{
assert(index >= 0);