Intrumenting with gdb (solution)
Name: Mailbox: Date:
Answer these questions using gdb on sort.c
.
- What is a command that pauses whenever A[3] changes?
w A[3]
- What are the values stored in A[3]?
2, -17
- What is a command that pauses the program at line 30 when n is 2?
b 30 if n == 2
- What is the first element in the array when n is 2?
-55
- Create a command that pauses after each partial sort, prints the array, then continues running the program. What is this command?
b 29
commands
p A
c
end