Lab 2: Debugger
Introduction
The goals of this assignment are to do some basic investigation of the
x86_64 architecture and assembly language, and to introduce (or refresh your understanding of)
how to use the debugger gdb. We'll walk you through the process
of exploring some provided C code using a variety of GDB commands and
techniques. There are links to more references later on the page.
Starter Code and Instructions
Starter code
The starter code for this lab is already available on the server in the
directory /cs/cs105/labs/lab2-debugging. The first step is to make your
own copy of the code to work on. After logging into
wilkes, run the following commands:
mkdir -p ~/cs105 cd ~/cs105 cp -ai /cs/cs105/labs/lab2-debugging . cd lab2-debugging
lab2-debugging in your
cs105 working directory
on the server, and copy the starter code into it. There are three files in the
starter code:
problem1.candproblem2.c, which are the two programs you'll be working with in this lab, andlab02.txt, which is the file where you'll write your answers to the questions in the lab instructions.
Note that you will not be editing problem1.c or problem2.c.
You will be running these programs and analyzing their behavior,
but you won't be changing their code.
Before you start working on the lab, open the file lab02.txt
in your favorite text editor (e.g., emacs, nano or vim), and add
both partners names at the top of the file. This file is where
you'll record your answers to the questions in the lab instructions.
Handout
Once you've grabbed the starter code, you can start following the instructions in the debugger lab handout.
References
- You will find it helpful to refer to our quick gdb info page.
- You may also want to download the gdb reference card. If you print it double-sided, you can fold it in thirds and even fit it in a pocket :)
Due Date and Submission
Deadline: Friday September 25, 1:15pm. This is a one-week lab!
From the command line on wilkes in your lab directory type
cs105submit -a 02 lab02.txt
You should get a response that 1 file has been submitted and that you will get an email confirming your submission. Note, you can resubmit as often as you want up to the deadline. Only the most recent submission will be graded.