Welcome to the Debugging workshop at ICCS Summer School 2025. This tutorial will introduce the basics of debuggers with some carefully chosen examples, to demonstrate the power of debuggers ⚡.
This repo contains some example programs to help you learn how to use gdb
and mdb
.
└── exercises
├── ex1_play
├── ex2_occasional
├── ex3_memory
└── ex4_mpi
In each folder there is a README.md
which contains instructions on how to run the example programs
and some helper scripts should you need them for guidance. Effort has been made to provide examples
in multiple languages i.e., C++ and Fortran. I appreciate some of you may be more familiar with one
language over another, but I have tried to keep the examples as simple as possible.
If you finish the examples early, feel free to tackle your own codes in the wild 🔍🐛.
- Unix command line (things like
cd
ing, running themake
command and running binaries like this./myprogram.exe
) - Basic experience with a compiled language (C/C++/Fortran or Rust)
- No prior knowledge of debuggers is assumed
- (optional) Experience with MPI programs
- (optional but recommended) install VS Code
- If you do not have VS Code, you will need a browser (Firefox/Chrome have been tested)
This course is designed to run in GitHub codespaces. There are two main ways that you can run a codespace.
- Visual Studio Code (recommended)
- Your internet browser -- option 1 is recommended because the browser sometimes absorbs keyboard shortcuts. You should still be able to complete the entire course without any issues.
Instructions are provided below.
Note
GitHub codespaces provides free monthly usage of 120 core hours. We should only need 3 for this course. For more info on billing please see GitHub's documentation.
Note
GitHub provides a default of 2 cores and 8 GB Ram, which is more than enough for this course. If you select 4 cores, when creating a new codespace it will use twice as many core hours from your allowance.
Note
The first time you create this codespace it will take 2-3 minutes to load (whilst it pulls the docker image and runs initial setup). Re-connecting to a previous session will be much quicker.
(click here to expand instructions)
- Open Visual Studio Code (
code
) - If you haven't already, download the "GitHub Codespaces" extension
- Click on "Remote Explorer" in the side bar
- If you haven't already, sign into your GitHub account
- Click "Create Codespace"
- Type
https://github.com/Cambridge-ICCS/debugging-workshop
into the search bar and press theEnter
key. - Click "main Default Branch"
- Click "2 cores, 8 GB RAM, 32 GB storage"
- This will connect to a remote instance of the GitHub codespace. You are now ready to start the
course! 🎉
(click here to expand instructions)
- Navigate to https://github.com/Cambridge-ICCS/debugging-workshop
- Click on the
+
icon to create a new on branchmain
- This will open a new tab in your browser with a Visual Studio Code interface connected to the
GitHub codespace. You are now ready to start the course! 🎉
Now that we have the codespace running in VSCode or the browser, we can get started with the course. All of the following instructions will be the same regardless of how you setup your codespace.
Navigate into the exercises folder and start with exercise 1.
cd exercises/ex1_play/
Start reading through the README.md
for that exercise i.e., exercises/ex1_play/README.md
.