Start the Fuchsia debugger ([zxdb
][fuchsia-debugger]) in VS Code and debug the sample component, which is now updated to crash when it runs.
The tasks include:
In VS Code, do the following:
Select the src/hello_world/hello_world.cc
file from the OPEN EDITORS view at the top of VS Code.
To set a breakpoint at the main()
method, click the space to the left of the line number.
{: .screenshot width=“500”}
When a breakpoint is set, a red dot appears.
Click Run > Start Debugging.
This starts a debug session that launches the hello_world
component. The debugger then pauses at the line where the breakpoint is set in the src/hello_world/hello_world.cc
file.
Click the DEBUG CONSOLE tab on the VS Code panel.
{: .screenshot}
This shows the console output of the Fuchsia debugger (zxdb
).
Click the FUCHSIA LOGS tab on the VS Code panel.
At the top right corner of the FUCHSIA LOGS panel, click the Clear logs icon.
In the Filter logs text box, type hello_world
and press Enter.
In the debug toolbar at the top of VS Code, click the Step Over icon.
{: .screenshot width=“250”}
In the FUCHSIA LOGS panel, verify that a new Hello again, World!
entry is printed in the logs.
{: .screenshot}
In the debug toolbar at the top of VS Code, click the Stop icon.
This causes the component to finish the execution of the rest of the code.