diff --git a/doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_debug.htm b/doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_debug.htm index a3eb8de41f3..9c6a8659fe1 100644 --- a/doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_debug.htm +++ b/doc/org.eclipse.cdt.doc.user/getting_started/cdt_w_debug.htm @@ -15,57 +15,97 @@

The debugger lets you control the execution of your program by setting breakpoints, suspending executed programs, stepping through your code, and examining the contents of variables.

-

To debug a project:

+

To debug a project:

    -
  1. Click Run > Debug Configurations....

    The Debug Configurations dialog opens.

  2. -
  3. Double-click C/C++ Application.
  4. -
  5. In the Name field, type Hello World.
  6. -

    You can now select this debug launch configuration by name the next time - that you debug this project.

    -
  7. In the Project box, type or choose your project, e.g. HelloWorld. -
    - Your executable should be selected under "C/C++ Application." -
    If not, the Search Project button should find the executable in the project. -

     

    +
  8. Click the Run > Debug Configurations... menu option.
    +
    +

    The Debug Configurations dialog opens.
    +
    +
    +

  9. - +
  10. Double-click C/C++ Application to create a new launch configuration.
    +
    +
    +
    +

    If a project is selected in the Project Explorer view the following data is automatically entered, take a moment to verify its accuracy or change as needed.
    +
    +

    +
      +
    1. In the Name edit box, type the project name, like Hello World.
      +
      + You can now select this debug launch configuration by name the next time + that you debug this project.
      +
      +
    2. +
    3. In the C/C++ Application edit box, type the name of the executable if its not already entered.
      +
      + If not, click the Search Project button to locate the executable in the project.
      +
      +
    4. +
    5. +

      In the Project edit box, type or choose your project, e.g. HelloWorld.
      +

      +

       

      +

      NOTE If you see the error "[Debugger]: No debugger available", select the Debugger tab + and choose a valid debugger for your platform (e.g. gdb/mi).
      +
      +

      +
    6. +
    +
  11. Click Debug.
  12. -

    You will be prompted to switch to the Debug Perspective. Click Yes

    -

    You will now see the debug perspective with the hello.exe application window open. +

    You may be prompted to switch to the Debug perspective. Click Yes

    +

    The Debug perspective appears with the helloworld.exe application window open. The C/C++ editor repositions in the perspective.

    - -
  13. In the left margin of the main.cpp window, double-click to set a - breakpoint on:
    -  cout << "You just entered" -
    You'll see an icon there indicating the breakpoint is set.
    -
  14. -
  15. Click Run > Resume. -
    Or, you can use the Resume button (green arrow) on the toolbar of the Debug View -
  16. -
  17. When prompted, in the Console view, type a value other than 'm', and hit Enter/Return.
    - The breakpoint will be hit.
  18. -
  19. In the Variables view, verify that the variable is not 'm'.
  20. -
  21. Click Run > Resume.
  22. -
  23. When prompted, again type a value other than 'm' in the Console view, and press Enter/Return.
  24. -

    The breakpoint will be hit.

    -
  25. In the Variables view, verify that the variable is not 'm'.
  26. -
  27. In the Variables view, right-click the input variable, and select Change Value... - and type 'm' between the single quotes and hit OK.
  28. -
  29. Click Run > Resume.
  30. -

    The output in the hello.exe application window is:
    - "You just entered m, you need to enter m to exit." -

  31. The application terminates and the debug session ends. The debug - perspective remains open.
- +
+

NOTE If you see the error "Can't find source file" in the editor view, use the Locate File button + to locate your source file.
+

+
+
    +
  1. In the left margin of the main.cpp window, double-click to set a + breakpoint on:
    +
    +  cout << "You just entered" +
    +
    + You'll see a blue circle (Breakpoint) there indicating the breakpoint is set.
    +
    +
    +
  2. +
  3. Click Run > Resume. +
    +
    + Or, you can use the Resume button (Resume) on the toolbar of the Debug view + .
    +
    +
  4. +
  5. When prompted, in the Console view, type a value other than 'm', and press Enter.
    +
    + The breakpoint will be hit.
    +
    +
  6. +
  7. In the Variables view, verify that the variable is not 'm'.
    +
    +
  8. +
  9. Click Run > Resume.
    +
    +
  10. +
  11. When prompted, again type a value other than 'm' in the Console view, and press Enter.
  12. +

    The breakpoint will be hit.

    +
  13. In the Variables view, verify that the variable is not 'm'.
    +
    +
  14. +
  15. In the Variables view, right-click the input variable, and select Change Value... + and type 'm' between the single quotes and hit OK.
    +
    +
  16. +
  17. Click Run > Resume.
  18. +

    The output in the helloworld.exe application window is:  "You just entered m, you need to enter m to exit." +

  19. The application terminates and the debug session ends. The Debug perspective remains open.
  20. +

To learn more about debugging, see the related debug conceptual topics.

diff --git a/doc/org.eclipse.cdt.doc.user/images/cdt_w_debug_configurations_01.png b/doc/org.eclipse.cdt.doc.user/images/cdt_w_debug_configurations_01.png new file mode 100755 index 00000000000..79ec77bb9be Binary files /dev/null and b/doc/org.eclipse.cdt.doc.user/images/cdt_w_debug_configurations_01.png differ diff --git a/doc/org.eclipse.cdt.doc.user/images/cdt_w_debug_configurations_02.png b/doc/org.eclipse.cdt.doc.user/images/cdt_w_debug_configurations_02.png new file mode 100755 index 00000000000..670f168ad35 Binary files /dev/null and b/doc/org.eclipse.cdt.doc.user/images/cdt_w_debug_configurations_02.png differ