You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by mb...@apache.org on 2023/02/25 11:36:44 UTC

[netbeans-website] branch master updated: Add small infos and screenshot. Checked on current build.

This is an automated email from the ASF dual-hosted git repository.

mbien pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans-website.git


The following commit(s) were added to refs/heads/master by this push:
     new 249cb0d06 Add small infos and screenshot. Checked on current build.
     new a86aca610 Merge pull request #640 from mebenn/cnd-debug-improve
249cb0d06 is described below

commit 249cb0d0686d6e828205ac2865ba4ac047b0956e
Author: benn <be...@gmx.net>
AuthorDate: Thu Feb 23 13:47:27 2023 +0100

    Add small infos and screenshot. Checked on current build.
---
 .../src/content/kb/docs/cnd/debugging.adoc         |  64 +++++++++++++++++++--
 .../kb/docs/cnd/images/debug_samples_C_Quote.png   | Bin 0 -> 60587 bytes
 2 files changed, 59 insertions(+), 5 deletions(-)

diff --git a/netbeans.apache.org/src/content/kb/docs/cnd/debugging.adoc b/netbeans.apache.org/src/content/kb/docs/cnd/debugging.adoc
index 65f50f378..c68368e7b 100644
--- a/netbeans.apache.org/src/content/kb/docs/cnd/debugging.adoc
+++ b/netbeans.apache.org/src/content/kb/docs/cnd/debugging.adoc
@@ -28,13 +28,13 @@
 :toc-title:
 :description: Debugging C/C++ Projects Tutorial - Apache NetBeans
 :keywords: Apache NetBeans, Tutorials, Debugging C/C++ Projects Tutorial
+:reviewed: 2023-02-23
 include::../../../inc/database.adoc[]
 
 //March 2013 [Revision number: V8.0-1]
 
 The following short tutorial takes you through some of the features for debugging a C or C++ project in NetBeans IDE.
 
-
 == Requirements
 
 *To follow this tutorial, you need the following software and resources.*
@@ -49,20 +49,72 @@ The following short tutorial takes you through some of the features for debuggin
 
 See the xref:../../../community/releases/80/install.adoc[NetBeans IDE Installation Instructions] and xref:../../../community/releases/80/cpp-setup-instructions.adoc[Configuring the NetBeans IDE for C/C{pp}/Fortran] for information on downloading and installing the required software.
 
-
 == Creating the Sample Project
 
 The NetBeans IDE with C/C++ uses the  ``gdb``  debugger and provides numerous features for debugging your projects. To explore these features, you will use the  ``Quote``  project. If you have not already created this project, do the following:
 
 1. Choose File > New Project.
-2. In the project wizard, expand the Samples category and the C/C++ subcategory.
+2. In the project wizard, expand the Samples category and then the C/C++ subcategory.
 3. Select the Applications subcategory, then select the  ``Quote``  project. Click Next, then click Finish.
 
+image::images/debug_samples_C_Quote.png[]
 
-== Creating Breakpoints
 
-You can create and manipulate breakpoints in your code at any time without starting a debugging session.
+== Debugging
+
+While NetBeans supports compilation using clang and clang++, it does not
+currently support the clang debugger ``lldb``. However applications compiled
+with clang or clang++ can both be debugged using GDB and NetBeans. As clang is a
+drop in compiler replacement for GCC, it should not be necessary to compile
+using different flags.
+
+One of the most common features drawn upon by developers when debugging is the breakpoint.
+There are several ways to create and manipulate breakpoints in NetBeans, for example by using:
+
+* the NetBeans debug interface on the IDE
+* the Debugger Console (Window->Debugging->Debugger Console)
+* a GDB command file  
+
+=== The NetBeans debug interface on the IDE
+
+This is the most popular way to debug which we focus on here.
+
+=== The Debugger Console
+
+This provides the standard GDB interface within NetBeans and can be used to
+automate, store and configure debugging sessions. 
+
+===  A GDB Command file
+
+A GDB configuration file is invaluable in saving more intricate debugging setups,
+to supply your configuration to others or to record some interesting behaviour of
+your application. The configuration file can be loaded into GDB: ``source
+my_gdb_configration``; or automatically load it when GDB is started by renaming the
+GDB command file to ``.gdbinit``.
+
+[source, shell]
+----
+# user friendly output
+set print pretty on
+
+# set a few breakpoints
+# at the first statement
+break quote.cc:24
+# we can abbreviate break
+b quote.cc:171
+# stop at a function
+b Customer.cc:Customer::GetDiscount
+# stop at Customer() if initDiscout is negative
+b Customer.cc:Customer if initDiscount < 0  
+----
+
+You can continue debugging using the Debugger Console or by using the IDE button
+and the application will stop at the set breakpoints.
+
+== Creating Breakpoints
 
+You can create and manipulate breakpoints in your code at any time without
+starting a debugging session using the IDE or using a GDB command file.
 
 === Creating and Removing a Line Breakpoint
 
@@ -129,6 +181,8 @@ The debugging session is shown in this window.
 1. The  ``Quote_1``  application prompts you for input in the Output (Debug) window.
 2. Enter a customer name after the "Enter customer name:" prompt.
 
+Ensure that the name you enter is exactly the same as the name you selected from
+the list including upper and lower case.
 The application stops at the Customer::GetDiscount function breakpoint you set earlier and the customer.cc file opens in the editor at the line where the funtion is called. The Breakpoints window lists the two breakpoints you set earlier. The green program counter arrow appears on top of the breakpoint icon of the function breakpoint. 
 
 image::images/function_breakpoint3.png[]
diff --git a/netbeans.apache.org/src/content/kb/docs/cnd/images/debug_samples_C_Quote.png b/netbeans.apache.org/src/content/kb/docs/cnd/images/debug_samples_C_Quote.png
new file mode 100644
index 000000000..faf149fd4
Binary files /dev/null and b/netbeans.apache.org/src/content/kb/docs/cnd/images/debug_samples_C_Quote.png differ


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists