- ALL git commands must be in the command line.
- ALL gdb debugging must be in the command line.
- ALL file system actions (eg. creating a file, navigating a file, etc) must be in the command line
You are allowed to utilize the terminal of your choice for these actions, but they must be accomplished in-terminal.
Note: SSHing via VS Code or another GUI is acceptable provided that the above actions are then accomplished via a terminal therein.
main.c,reader.c,calculator.cand their corresponding header files.- A Makefile
- Some testcases in the
testcasesfolder - a reference executable called
mini_ci_reference
The given code reads in a string representing a postfix operation, evaluates the value of the operation,
and prints the result, notifying the user if the operation was invalid.
A postfix operation is defined by <operand1> <operand2> <binary operator> eg. 1 2 + which evaluates to 3.
These operations can be chained together 8 1 - 2 + = 7 2 + = 9;
Similarly 8 1 2 - + = 8 -1 + = 7
If at any point the Reader encounters an error, the final result should be set to -1 and the Reader's had_error field
should be set to true. If no error occurs, the Reader's had_error field should be false.
The given program uses a greedy stack based approach to evaluate valid operations as soon as they appear.
Unfortunately, this program may be wrong!
To run an individual testcase use
mini_ci <file>. Use mini_ci_reference <file> for the reference output.
- ssh into your favorite UTCS lab machine
- Create a file
~/.gdbinit - Add the line
set history save onto~/.gdbinit - Clone this repository
- Read then use the Makefile
- Debug the test cases using gdb; you must use gdb to pass this mastery assessment.
- Ensure your output matches the reference exactly.
- Write the outputs of the
historycommand to a file in this repo calledshell_logs.txt - While in gdb, use the command
show commandsto display your most recently used commands. Write this output to a file in this repo calledgdb_logs.txt - Commit and push your changes. Do not forget to add
shell_logs.txtandgdb_logs.txtto git. - Delete your local copy of this repository (you will need to use the r and f flags). If this results in any errors, please notify your proctor before leaving the room.
- Please do not leave before your proctors tell you to do so.