Skip to content

Instantly share code, notes, and snippets.

@thinkhy
Last active August 29, 2015 14:22
Show Gist options
  • Save thinkhy/7dea08068fd013604554 to your computer and use it in GitHub Desktop.
Save thinkhy/7dea08068fd013604554 to your computer and use it in GitHub Desktop.
How to Debug Pintos

How to Debug Pintos

Pull latest docker image from docker.io

  sudo docker pull thinkhy/cs162-pintos

Run container

sudo docker run -i -t -v [pintosSRC]/pintos:/pintos docker.io/thinkhy/cs162-pintos  bash

Start GDB server

cd /pintos
./run.sh

Create another session to start a GDB client

sudo docker ps  # find the container ID just run
sudo docker exec -t -i [ContainerID] bash
# at this point, you are in the container
cd /pintos/src/thread/build
gdb ./kernel.o
# in GDB
target remote localhost:1234
continue

Happy Coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment