summaryrefslogtreecommitdiffstats
path: root/docs/ATTIC/3_Developer_Guides/4_X(cross)_Development_System:_User's_Guide/3_Debugging_Your_First_AGL_Application
diff options
context:
space:
mode:
Diffstat (limited to 'docs/ATTIC/3_Developer_Guides/4_X(cross)_Development_System:_User's_Guide/3_Debugging_Your_First_AGL_Application')
-rw-r--r--docs/ATTIC/3_Developer_Guides/4_X(cross)_Development_System:_User's_Guide/3_Debugging_Your_First_AGL_Application/3.4.3.1_Overview.md45
-rw-r--r--docs/ATTIC/3_Developer_Guides/4_X(cross)_Development_System:_User's_Guide/3_Debugging_Your_First_AGL_Application/3.4.3.2_Configuration.md129
-rw-r--r--docs/ATTIC/3_Developer_Guides/4_X(cross)_Development_System:_User's_Guide/3_Debugging_Your_First_AGL_Application/3.4.3.3_Using_the_Command_Line.md123
-rw-r--r--docs/ATTIC/3_Developer_Guides/4_X(cross)_Development_System:_User's_Guide/3_Debugging_Your_First_AGL_Application/3.4.3.4_Using_an_IDE.md94
-rw-r--r--docs/ATTIC/3_Developer_Guides/4_X(cross)_Development_System:_User's_Guide/3_Debugging_Your_First_AGL_Application/pictures/nb_newtool.pngbin0 -> 49093 bytes
-rw-r--r--docs/ATTIC/3_Developer_Guides/4_X(cross)_Development_System:_User's_Guide/3_Debugging_Your_First_AGL_Application/pictures/nb_project_debug-1.pngbin0 -> 59680 bytes
-rw-r--r--docs/ATTIC/3_Developer_Guides/4_X(cross)_Development_System:_User's_Guide/3_Debugging_Your_First_AGL_Application/pictures/nb_xds_options.pngbin0 -> 50729 bytes
7 files changed, 391 insertions, 0 deletions
diff --git a/docs/ATTIC/3_Developer_Guides/4_X(cross)_Development_System:_User's_Guide/3_Debugging_Your_First_AGL_Application/3.4.3.1_Overview.md b/docs/ATTIC/3_Developer_Guides/4_X(cross)_Development_System:_User's_Guide/3_Debugging_Your_First_AGL_Application/3.4.3.1_Overview.md
new file mode 100644
index 0000000..83e425f
--- /dev/null
+++ b/docs/ATTIC/3_Developer_Guides/4_X(cross)_Development_System:_User's_Guide/3_Debugging_Your_First_AGL_Application/3.4.3.1_Overview.md
@@ -0,0 +1,45 @@
+---
+edit_link: ''
+title: Overview
+origin_url: >-
+ https://git.automotivelinux.org/src/xds/xds-docs/plain/docs/part-1/debug-overview.md?h=master
+---
+
+<!-- WARNING: This file is generated by fetch_docs.js using /home/boron/Documents/AGL/docs-webtemplate/site/_data/tocs/devguides/master/xds-docs-guides-devguides-book.yml -->
+
+# Overview
+
+Debugging your AGL application is based on the GNU Project Debugger
+([GDB](https://www.gnu.org/software/gdb/)).
+In order to use GDB, you must use `xds-gdb` as a wrapper on GDB to
+cross-debug your application.
+For information on `xds-gdb`, see the
+"[Client Part](./client-part.html)" topic.
+
+Using `xds-gdb` allows you to debug an application built with
+XDS without the need to install GDB or any cross-tools.
+
+XDS supports two debugging models:
+
+* Native debugging
+
+* XDS remote debugging
+
+The default debugging model is XDS remote.
+To use this model, you must have previously set up the XDS
+agent and server so that you can cross-debug your application.
+See the
+"[Server Part](./server-part.html)" and
+"[Client Part](./client-part.html)" topics for more
+information on getting set up.
+
+If you want to use the native debugging model, you must define the
+`XDS_NATIVE_GDB` environment variable.
+See the
+"[Configuration](./debug-configuration.html)" topic for information
+on XDS configuration variables.
+
+The remainder of this topic describes
+[configurations](./debug-configuration.html), using the XDS
+[command line](./debug-cmd-line.html) to debug, and using an
+[IDE](./debug-ide.html) to debug.
diff --git a/docs/ATTIC/3_Developer_Guides/4_X(cross)_Development_System:_User's_Guide/3_Debugging_Your_First_AGL_Application/3.4.3.2_Configuration.md b/docs/ATTIC/3_Developer_Guides/4_X(cross)_Development_System:_User's_Guide/3_Debugging_Your_First_AGL_Application/3.4.3.2_Configuration.md
new file mode 100644
index 0000000..2bc28f3
--- /dev/null
+++ b/docs/ATTIC/3_Developer_Guides/4_X(cross)_Development_System:_User's_Guide/3_Debugging_Your_First_AGL_Application/3.4.3.2_Configuration.md
@@ -0,0 +1,129 @@
+---
+edit_link: ''
+title: Configuration
+origin_url: >-
+ https://git.automotivelinux.org/src/xds/xds-docs/plain/docs/part-1/debug-configuration.md?h=master
+---
+
+<!-- WARNING: This file is generated by fetch_docs.js using /home/boron/Documents/AGL/docs-webtemplate/site/_data/tocs/devguides/master/xds-docs-guides-devguides-book.yml -->
+
+# Configuration
+
+Debug configuration (i.e. `xds-gdb`) is defined by variables.
+You can see the variables used further down in this section.
+
+You can set these variables using a number of methods:
+
+- Environment variables that are inherited.
+
+- Configuration file pointed to by the `XDS_CONFIG` environment variable
+ (e.g. `XDS_CONFIG=/tmp/my_xds_gdb_config.env xds-gdb`).
+
+- A GDB "init" command file.
+
+- A "user" configuration file located in one of the following
+ areas, which are order-dependent:
+
+ 1. `$(CURRENT_DIRECTORY)/.xds-gdb.env`
+
+ 1. `$(CURRENT_DIRECTORY)/../xds-gdb.env`
+
+ 1. `$(CURRENT_DIRECTORY)/target/xds-gdb.env`
+
+ 1. `$(HOME)/.config/xds/xds-gdb.env`
+
+## Configuration Variables
+
+This section describes the `XDS_*` configuration variables.
+As previously mentioned, you can define these variables as
+described in the previous section.
+
+- `XDS_LOGLEVEL`
+
+ Sets the logging level.
+ Levels include "panic", "fatal", "error", "warn", "info", and "debug".
+
+- `XDS_LOGFILE`
+
+ Sets the logging file.
+ The default is `/tmp/xds-gdb.log`.
+
+- `XDS_NATIVE_GDB`
+
+ Specifies to use native GDB mode rather than remote XDS mode.
+
+- `XDS_PROJECT_ID` *(mandatory in XDS mode)*
+
+ The project ID you want to build.
+
+- `XDS_RPATH`
+
+ The relative path to the project.
+
+- `XDS_SDK_ID` *(mandatory in XDS mode)*
+
+ Cross SDK ID to use to build project
+
+- `XDS_AGENT_URL`
+
+ The local XDS agent URL.
+ The default is `http://localhost:8800`.
+
+## Configuration Using `XDS_CONFIG`
+
+As mentioned, you can define configuration variables in
+a file you point to with the `XDS_CONFIG` variable.
+Here is an example:
+
+```bash
+XDS_CONFIG=/tmp/my_xds_gdb_config.env xds-gdb
+```
+
+Variables defined in this file overwrite any inherited
+environment variables.
+When you define a variable in the file, you can prefix the
+assignment with the "export" string.
+Doing so causes the variable to be exported to the environment.
+
+Following is an example of a configuration file pointed
+to by the `XDS_CONFIG` variable.
+These commands create the `xds-gen3.conf` configuration file
+in the `$MY_PROJECT_DIR` directory:
+
+```bash
+# MY_PROJECT_DIR=/home/seb/xds-workspace/helloworld-native-application
+cat > $MY_PROJECT_DIR/xds-gen3.conf << EOF
+export XDS_AGENT_URL=localhost:8800
+export XDS_PROJECT_ID=4021617e-ced0-11e7-acd2-3c970e49ad9b
+export XDS_SDK_ID=c226821b-b5c0-386d-94fe-19f807946d03
+EOF
+```
+
+## Configuration Using GDB Init
+
+GDB is a versatile debugger and can be run with many options.
+One such option is to execute a GDB "init" file upon startup.
+You do this by using the "--command" or "-x" command-line options
+and providing the name of the init file.
+
+<!-- section-note -->
+**NOTES:**
+
+- For information on debugging with GDB, see
+ "[Debugging with GDB](https://www.sourceware.org/gdb/onlinedocs/gdb.html)".
+
+- For information on GDB init files, see
+ "[Command files](https://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_node/gdb_190.html)".
+<!-- end-section-note -->
+
+When you create an init file, it must conform to the following
+syntax (i.e. inclusion of what are normally commenting characters
+as well as use of the `:XDS-ENV:` tag).
+
+Following is an example init file that defines the `XDS_PROJECT_ID`
+and `XDS_SDK_ID` variables:
+
+```bash
+ # :XDS-ENV: XDS_PROJECT_ID=4021617e-ced0-11e7-acd2-3c970e49ad9b
+ # :XDS-ENV: XDS_SDK_ID=c226821b-b5c0-386d-94fe-19f807946d03
+```
diff --git a/docs/ATTIC/3_Developer_Guides/4_X(cross)_Development_System:_User's_Guide/3_Debugging_Your_First_AGL_Application/3.4.3.3_Using_the_Command_Line.md b/docs/ATTIC/3_Developer_Guides/4_X(cross)_Development_System:_User's_Guide/3_Debugging_Your_First_AGL_Application/3.4.3.3_Using_the_Command_Line.md
new file mode 100644
index 0000000..4dd7431
--- /dev/null
+++ b/docs/ATTIC/3_Developer_Guides/4_X(cross)_Development_System:_User's_Guide/3_Debugging_Your_First_AGL_Application/3.4.3.3_Using_the_Command_Line.md
@@ -0,0 +1,123 @@
+---
+edit_link: ''
+title: Using the Command Line
+origin_url: >-
+ https://git.automotivelinux.org/src/xds/xds-docs/plain/docs/part-1/debug-cmd-line.md?h=master
+---
+
+<!-- WARNING: This file is generated by fetch_docs.js using /home/boron/Documents/AGL/docs-webtemplate/site/_data/tocs/devguides/master/xds-docs-guides-devguides-book.yml -->
+
+# Using the XDS Command Line
+
+You can debug your AGL application using the XDS command line
+in XDS remote mode or in native mode.
+
+## XDS Remote Mode
+
+XDS remote debugging is the default mode for using XDS to debug your
+application.
+
+
+Follow this procedure to use XDS remotely to debug your application:
+
+1. Declare the project you want to debug to the `xds-server`.
+ The project can also have been built using XDS.
+ See the "[Create your first AGL application](../../../#create-your-first-agl-application)"
+ topic for more details.
+
+2. Be sure you have the XDS agent and XDS server chain in place.
+ You can find more information on this chain in the
+ "[Installing XDS](../../../#installing-xds)" topic.
+
+3. Determine the unique project and SDK ID values.
+ Two methods exist for you to locate these ID values:
+
+ - Use the "Project" page of the XDS dashboard.
+
+ - Use the `xds-gdb --list` command from the XDS command line.
+ This command returns the list of all existing project and SDK
+ IDs:
+
+ ```bash
+ xds-gdb --list
+ ```
+
+4. Define the `XDS_PROJECT_ID` and `XDS_SDK_ID` variables.
+ Defining these variables refers the project to the
+ `xds-server`.
+ Once you refer the project, you are ready to use `xds-gdb`
+ (e.g. cross debug your project).
+
+5. Build and debug the project.
+
+**Example**
+
+Following is an example that builds and debugs a project
+based on a CMakefile and the
+[cmake-apps-module](https://git.automotivelinux.org/src/cmake-apps-module/):
+
+```bash
+# Go into your project directory (e.g. helloworld-native-application)
+cd ~/xds-workspace
+# Clone the project files into your local directory.
+git clone https://github.com/iotbzh/helloworld-native-application.git
+# Go to the local project's directory.
+cd helloworld-service
+
+# Declare your project on xds-server
+# For now, you can only do this step using the XDS Dashboard.
+# See the "Build Using the XDS Dashboard" topic in the "Create Your
+# First Application" topic.
+
+# Define XDS configuration variables by creating a "xds-config.env" file.
+cat <<EOF >./xds-config.env
+#optional if not default value: XDS_AGENT_URL=http://localhost:8800
+XDS_PROJECT_ID=IW7B4EE-DBY4Z74_myProject
+XDS_SDK_ID=poky-agl_aarch64_4.0.1
+EOF
+
+# Define the configuration file to use.
+export XDS_CONFIG=../xds-gen3.conf
+
+# Create a new build directory.
+mkdir build && cd build
+
+# Start remote cross-build
+xds-cli exec -- cmake -DRSYNC_TARGET=root@myTarget ..
+xds-cli exec -- make
+xds-cli exec -- make remote-target-populate
+
+# Start debugging
+xds-gdb -x target/gdb-on-root@myTarget.ini
+```
+
+<!-- section-note -->
+**NOTE:**
+
+The [helloworld-native-application](https://github.com/iotbzh/helloworld-native-application)
+project is an AGL project based on the
+[cmake-apps-module](https://git.automotivelinux.org/src/cmake-apps-module/).
+For information on installing this module, see the
+"[Installing the CMAKE Templates](../../cmakeafbtemplates/dev_guide/installing-cmake.html))"
+topic.
+
+The CMake templates that are used to develop applications
+with the AGL Application Framework, automatically generate
+Makefile rules (e.g. `remote-target-populate`) or scripts
+(e.g. `build/target/*`).
+
+For more info about the CMake templates, see the
+"[Using the Cmake Applications Module](../../../#using-the-cmake-applications-module)"
+topic.
+<!-- end-section-note -->
+
+## Native debugging
+
+Native debugging is best for applications or services that are also
+built natively and you want to use any debugger (e.g. GDB) on an actual
+piece of hardware.
+
+To enable native debugging mode, set the `XDS_NATIVE_GDB` variable.
+
+For information on debugging with GDB, see
+"[Debugging with GDB](https://www.sourceware.org/gdb/onlinedocs/gdb.html)".
diff --git a/docs/ATTIC/3_Developer_Guides/4_X(cross)_Development_System:_User's_Guide/3_Debugging_Your_First_AGL_Application/3.4.3.4_Using_an_IDE.md b/docs/ATTIC/3_Developer_Guides/4_X(cross)_Development_System:_User's_Guide/3_Debugging_Your_First_AGL_Application/3.4.3.4_Using_an_IDE.md
new file mode 100644
index 0000000..c4b0341
--- /dev/null
+++ b/docs/ATTIC/3_Developer_Guides/4_X(cross)_Development_System:_User's_Guide/3_Debugging_Your_First_AGL_Application/3.4.3.4_Using_an_IDE.md
@@ -0,0 +1,94 @@
+---
+edit_link: ''
+title: Using an IDE
+origin_url: >-
+ https://git.automotivelinux.org/src/xds/xds-docs/plain/docs/part-1/debug-ide.md?h=master
+---
+
+<!-- WARNING: This file is generated by fetch_docs.js using /home/boron/Documents/AGL/docs-webtemplate/site/_data/tocs/devguides/master/xds-docs-guides-devguides-book.yml -->
+
+# Using an IDE
+
+This topic describes how to use `xds-gdb` from within an Interactive
+Development Environment (IDE) to debug your application.
+The topic uses the
+[NetBeans](https://netbeans.org/) IDE as an example.
+
+## Prerequisites
+
+Before using the IDE, you need to declare the project you want to debug
+on the `xds-server`.
+
+<!--section-note-->
+**NOTE:**
+
+The project you declare can also have been built using XDS.
+For information on building the project using XDS, see the
+"[Create your first AGL application](../../../#create-your-first-agl-application)"
+section.
+<!--end-section-note-->
+
+## NetBeans
+
+This section presents an example using NetBeans version 8.x:
+
+1. Select the **Options** item in the **Tools** menu.
+
+2. Open the **Build Tools** tab.
+
+3. Open the **C/C++** tab and click the **Add** button to reveal the "Add New
+ Tool Collection" dialog box:
+
+ ![Add new tool panel](./pictures/nb_newtool.png){:: style="width:90%; max-width:700px; margin:auto; display:flex"}
+
+4. Fill in the **Make Command** and **Debugger Command** fields so that they point to the XDS tools.
+ Following is an example:
+
+ ![Add new tool panel](./pictures/nb_xds_options.png){:: style="width:90%; max-width:700px; margin:auto; display:flex"}
+
+5. Click on **OK** button.
+
+6. Select the **Project Properties** item in the **File** menu to
+ update your debug settings.
+
+7. In the "Project Properties" dialog, be sure that the "Gen3 board"
+ appears in the "Configuration" field (i.e. active).
+
+8. In the "Categories" navigation pane, select **Run**.
+
+9. Set the following:
+
+ - Run Command: `target/start-on-root@renesas-gen3.sh`
+ <!--section-note-->
+ **NOTE:**
+
+ The script name could depend on the `RSYNC_TARGET`
+ variable you set in pre-build command.
+ <!--end-section-note-->
+
+ - Run Directory: `build_gen3`
+
+10. In the "Categories" navigation pane, select **Debug**.
+
+11. Set the following:
+
+ - Debug command: `/bin/true`
+
+ - Working Directory: Leave this field blank
+
+ - Gdb Init File: `target/gdb-on-root@renesas-gen3.ini`
+ <!--section-note-->
+ **NOTE:**
+
+ The script name could depend on the `RSYNC_TARGET`
+ variable you set in pre-build command.
+ <!--end-section-note-->
+
+ ![Select Model panel](./pictures/nb_project_debug-1.png){:: style="width:90%; max-width:700px; margin:auto; display:flex"}
+
+12. Click **Apply**.
+
+13. Click **OK** to save your settings.
+
+14. Start debugging your application by selecting the **Debug Project** item
+ in the **Debug** menu, or by entering the **CTRL+F5** shortcut.
diff --git a/docs/ATTIC/3_Developer_Guides/4_X(cross)_Development_System:_User's_Guide/3_Debugging_Your_First_AGL_Application/pictures/nb_newtool.png b/docs/ATTIC/3_Developer_Guides/4_X(cross)_Development_System:_User's_Guide/3_Debugging_Your_First_AGL_Application/pictures/nb_newtool.png
new file mode 100644
index 0000000..7c4fa40
--- /dev/null
+++ b/docs/ATTIC/3_Developer_Guides/4_X(cross)_Development_System:_User's_Guide/3_Debugging_Your_First_AGL_Application/pictures/nb_newtool.png
Binary files differ
diff --git a/docs/ATTIC/3_Developer_Guides/4_X(cross)_Development_System:_User's_Guide/3_Debugging_Your_First_AGL_Application/pictures/nb_project_debug-1.png b/docs/ATTIC/3_Developer_Guides/4_X(cross)_Development_System:_User's_Guide/3_Debugging_Your_First_AGL_Application/pictures/nb_project_debug-1.png
new file mode 100644
index 0000000..7d89fc5
--- /dev/null
+++ b/docs/ATTIC/3_Developer_Guides/4_X(cross)_Development_System:_User's_Guide/3_Debugging_Your_First_AGL_Application/pictures/nb_project_debug-1.png
Binary files differ
diff --git a/docs/ATTIC/3_Developer_Guides/4_X(cross)_Development_System:_User's_Guide/3_Debugging_Your_First_AGL_Application/pictures/nb_xds_options.png b/docs/ATTIC/3_Developer_Guides/4_X(cross)_Development_System:_User's_Guide/3_Debugging_Your_First_AGL_Application/pictures/nb_xds_options.png
new file mode 100644
index 0000000..fa82a94
--- /dev/null
+++ b/docs/ATTIC/3_Developer_Guides/4_X(cross)_Development_System:_User's_Guide/3_Debugging_Your_First_AGL_Application/pictures/nb_xds_options.png
Binary files differ