monic part 6: the mC programming language and compiler
|
01-28-2022, 10:20 AM
Post: #7
|
|||
|
|||
RE: monic part 6: the mC programming language and compiler
I've written a debugger that supports single-stepping through the source code. The parser creates two bytecode programs - one for execution ("release") and the other for debugging ("debug"). The debug bytecode program contains instructions that halt execution and enable debugging.
As an example, suppose one wishes to step through the program to calculate 5!: The debugger is comprised of the following screens: 1. Source code with arrow pointing at the line to be executed next: 2. Stack with the line to be executed next at the top: 3. Global variables with the line to be executed next at the top. The image below gives the values of the variables after stepping through the while loop once: 4. Parameters with the line to be executed next at the top (not yet active). 5. Local variables with the line to be executed next at the top (not yet active). 6. "Release" bytecode with arrow pointing at the line to be executed next: 7. "Debug" bytecode with arrow pointing at the line to be executed next: Pressing "step" executes a line of the C source code and the user can see which corresponding bytecode instructions are executed in the bytecode debugging screens. After pressing "step" once more at the end of the program we return to the home screen. The result is on stack level 1: The C language combines all the power of assembly language with all the ease-of-use of assembly language |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)