After trying on the break point implementation last week, I decided to work on interface with Sumia and Islam’s code. As pre-discussed with my supervisor, the simulator should be the back-end engine and should not have any visible interface in the Web Application.
The Web Worker
The Prediction Algorithm
The Step In debugger is a prediction algorithm, as it is implemented using the starting and ending address that obtained from the GDB (GNU Project Debugger). By using the addresses, I am creating an algorithm to predict whether the instructions of each line of the C code is executed and they should be stopped once they detected the it is reaching the next line or any other lines in the C program. And it should be stopped until the user triggers another step in function. I think this algorithm should be working and fine with any programs as each address will be storing different instructions, and these instructions are derived from each line of the C program.
The Undefined Error 0
I was horrified by the error when I saw it again. It is the execution of instruction from address 0. This error appears again when I tried out the simulator on C++ executable file. I found out that I did a mistake last week, that I manually added the stack pointer initialization instruction without adjusting the program counter back to the original entry address. Thus, the program counter actually skipped the first entry address, and eventually this is able to run all the instruction in the main section. However, this does not happen when I initialize the stack pointer and adjust back the program counter, both C/C++ executable file does not work. As per discussed by the RISC-V author themselves, the executable files are expected to be running in an OS kernel. Hopefully that I would able to solve this problem this week 🙂