Line-by-line visual debugging in VS Code with lldb
In the debugging video, notice that the line highlighted in yellow is the line to be executed. After you step in or step over the line, the result of executing that line is shown. The variables panel will update and any output will be shown in the debugging console.
Clang-14 and debugging symbols
When compiling by hand, you'd include
-g to have the compiler write debugging symbols. For
the version of
clang++ that we're using (v. 14.0.5),
DWARFv5 debug format is used by default.
Unfortunately, I understand that some of our tools will not properly read the
DWARF5 generated by
clang-14. Therefore, Instead of using the
-g flag, use
-gdwarf-4. If you're using
you might need to update the
Makefile to use
-gdwarf-4 instead of
Using the CS 128 environment debugger
For this class's MPs
assessments' debugger. You must open the Machine Problem in its window for things to work. After that,
you must compile the Machine Problem with debugging symbols (use the
-gdwarf-4 flag), and
the resultant executable must be named
exec and placed in the
For your own projectsIf you're interested in using our debugger on your own projects, make sure that you open your project in its own window, compile your project with debugging symbols (use the
-gdwarf-4flag), name the resultant executable
exec, and place
execin a folder named
binin the project's root directory. Furthermore, your project's root directory must aslo contain a
.vscodefolder with the files found here.
To use the debugger, you must understand its actions. Here are the buttons available to us in the VS code debugger.
Please answer the following questions to communicate your understanding of their usage. If you're unsure, open up your CS 128 development environment and tinker with the provided Howdy World example.