The first day of ACM Tutoring will be September 9th!
Useful for tracking code changes in CS1, CS2, and Functional
Resources
Examples
git add . add all code changes to current commit
git commit -m "your commit message" commit the added changes (semi) permanently with your commit message
git push pushes your commit(s) to GitHub or other remote code server
git restore . restores all changes by reverting to last commit
git checkout main switches branch to main if all changes have been tracked
Useful for general debugging and finding infinite loops in Low Level and Data Abstraction (C/C++)
Resources
man gdb
info gdb
Examples
First, compile your program with the debugging flag -g
gcc -g -std=c99 my_program.c
g++ -g -std=c++11 my_program.cpp
gdb a.out will start a debugging session for the program a.out
run in gdb will run the program within gdb until it hits a breakpoint, encounters an error, or completes successfully
break 7 in gdb will set a breakpoint at line 7
step in gdb will move to the next line, or into a function called on the current line
next in gdb will move to the next line without stepping into function calls
print x in gdb will print the contents of variable x at the current point in the program
Useful for solving segfaults and finding memory leaks in Low Level and Data Abstraction (C/C++)
Resources
man valgrind
info valgrind
Examples
valgrind ./a.out