This is a (work-in-progress) collection of .gdbinit
files for Brown University's Operating Systems course, cs1670/1690. These files add useful debugging commands for the course's programming projects.
For the first programming project, uthreads, the provided file adds the uthreads state
command, which prints out the list of uthreads color-coded by their current state.
This method is quicker to set up, but you'll have to redo most of the steps whenever you want to get updates to a dotfile or set up a new assignment.
For each project's initial setup, follow these steps:
-
In this GitHub repository, click into the folder corresponding to the assignment you're working on and open the
.gdbinit
file -
In the upper right corner of the file viewer, click the download button ("Download raw file")
-
Move the downloaded file into the base directory of your project.
a. Note: You may have to rename the file to
.gdbinit
(instead of justgdbinit
- notice the missing dot at the beginning of the filename). When downloading the file from GitHub, it sometimes removes the dot from the beginning of the filename, which would make it not work. -
Open a terminal,
cd
to the base directory of your project, and run the following command:mkdir -p ~/.config/gdb && echo add-auto-load-safe-path $PWD/.gdbinit >> ~/.config/gdb/gdbinit
-
Done! Inside gdb, run the
help user
command to verify your setup. If commands appear in the "List of commands", then setup was successful.
If you want to get new updates to a dotfile for a project you've already set up, follow all steps above except step 4.
This method requires a little more initial setup, but after that you can get updates to the dotfiles with minimal additional effort.
(Instructions coming soon.)
If you're also taking Operating Systems and want to contribute to these dotfiles, please make a pull request! My hope is that this repository will become a collaborative space for OS students to share useful debugging tools, and any contributions to that end will be gladly welcomed.