Intrumenting with gdb (solution)

Name: Mailbox: Date:

Answer these questions using gdb on sort.c.

  1. What is a command that pauses whenever A[3] changes?
w A[3]
  1. What are the values stored in A[3]?

2, -17

  1. What is a command that pauses the program at line 30 when n is 2?
b 30 if n == 2
  1. What is the first element in the array when n is 2?

-55

  1. 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