Lab 11: GUI debugging

Objective

Become familiar with using a GUI debugger, either CLion (Mac or Windows), or Xcode (Mac).

Lab Reading / Preparation

  1. Install a Graphical User Interface (GUI) that includes a debugger, using the instructions on the website Resources / IDEs page.

  2. Create a project using your solution to program 2 (or some similar program).

  3. Get an overview of your environment.

    • Mac Xcode users see this brief description and this video (~2 min)

    • Windows CLion users see this video (7 min)
      CLion currently has an issue on Windows where the result of print statements are buffered and don't show up in the console when debugging. To fix this, at the top of your program make sure you have:
      #include <stdio.h>
      and then first thing in main() add this line to disable output buffer size to 0:
      setbuf( stdout, 0);

    • Click next to the line numbers in the left-hand margin and play with single-stepping through your program, looking at the variable values along the way.

Write a summary in your own words of the process you went through for IDE installation, project creation, and using the debugger to single-step through a program.

Submit your code into the Reading Outline Submission Form that we've been using each week, by copy / pasting it into the form question that asks for 250 words minimum, entitled "What are the main points to this topic?"

Lab Activity

Consider trading lab partners so you can find a lab partner with the same platform (Windows or Mac) as you have.

With your partner use your IDEs to attempt to find the errors in a version of program 1, Hunt the Wumpus, that is on the Piazza Resources page at:
Prog1WumpusSolutionWithERRORS.c
More important than finding all the errors is for you to clearly explain the process of using the IDE tools to set breakpoints, single-step, step in/out of functions, and display values, as part of finding logic errors in a program.

Time permitting if you find all the errors:

  • Explain how the debugging experience is the same/different from what we saw last week using gdb, which you prefer, and why.

  • Provide links to the best tutorial videos you can find for your debugging platform that are appropriate to the level of experience of an average CS 211 student.