From 6bbc4ed292b187a26537fafc5a206d1d1765727e Mon Sep 17 00:00:00 2001 From: Scott Rifenbark Date: Tue, 7 May 2019 12:44:20 -0700 Subject: Renamed XDS Debug files, update devguides-book.yml For guppy, I renamed the XDS debug procedure files. Also, Removed three files that are not used. I updated the devguides-book.yml file to use the "guppy" version. Change-Id: I623ce1b6021c419742c3a5c311fc5240867660fe Signed-off-by: Scott Rifenbark --- docs/devguides-book.yml | 16 +-- docs/part-1/1-1_install-xds-server-docker.md | 196 --------------------------- docs/part-1/1-3_install-xds-server-native.md | 86 ------------ docs/part-1/4_build-first-app.md | 21 --- docs/part-1/5-1_debug-first-app-config.md | 76 ----------- docs/part-1/5-2_debug-first-app-cmd.md | 69 ---------- docs/part-1/5-3_debug-first-app-ide.md | 44 ------ docs/part-1/5_debug-first-app.md | 22 --- docs/part-1/debug-cmd-line.md | 69 ++++++++++ docs/part-1/debug-configuration.md | 76 +++++++++++ docs/part-1/debug-ide.md | 44 ++++++ docs/part-1/debug-overview.md | 22 +++ 12 files changed, 219 insertions(+), 522 deletions(-) delete mode 100644 docs/part-1/1-1_install-xds-server-docker.md delete mode 100644 docs/part-1/1-3_install-xds-server-native.md delete mode 100644 docs/part-1/4_build-first-app.md delete mode 100644 docs/part-1/5-1_debug-first-app-config.md delete mode 100644 docs/part-1/5-2_debug-first-app-cmd.md delete mode 100644 docs/part-1/5-3_debug-first-app-ide.md delete mode 100644 docs/part-1/5_debug-first-app.md create mode 100644 docs/part-1/debug-cmd-line.md create mode 100644 docs/part-1/debug-configuration.md create mode 100644 docs/part-1/debug-ide.md create mode 100644 docs/part-1/debug-overview.md diff --git a/docs/devguides-book.yml b/docs/devguides-book.yml index dc8a033..e714db0 100644 --- a/docs/devguides-book.yml +++ b/docs/devguides-book.yml @@ -32,16 +32,16 @@ books: name: Build Using the XDS Dashboard - url: part-1/create-app-build-ide.md name: Build Using an IDE - - name: Debug your first AGL application + - name: Debugging Your First AGL Application children: - - url: part-1/5-1_debug-first-app-config.md - name: Prerequisites - - url: part-1/5-2_debug-first-app-cmd.md + - url: part-1/debug-overview.md + name: Overview + - url: part-1/debug-configuration.md name: Configuration - - url: part-1/5-3_debug-first-app-ide.md - name: xds-gdb from command line - - url: part-1/5_debug-first-app.md - name: xds-gdb within an IDE + - url: part-1/debug-cmd-line.md + name: Using the Command Line + - url: part-1/debug-ide.md + name: Using an IDE - name: "X(cross) Development System: Internals" children: - url: part-2/0_Abstract.md diff --git a/docs/part-1/1-1_install-xds-server-docker.md b/docs/part-1/1-1_install-xds-server-docker.md deleted file mode 100644 index 5b30ca5..0000000 --- a/docs/part-1/1-1_install-xds-server-docker.md +++ /dev/null @@ -1,196 +0,0 @@ -# Installation based on Docker container - -## Docker container prerequisites - -Docker is installed on the host machine, please refer to [Docker documentation](https://docs.docker.com/engine/installation/) for more details. - - ->**Warning:** -> ->Your user must be part of docker group. You can use following command to check it : ->```bash ->groups | grep docker ->``` -> ->If not, please refer to [docker post install instructions](https://docs.docker.com/install/linux/linux-postinstall/). -> ->Here are a short recap of commands you must execute : -> ->```bash ->sudo groupadd docker ->sudo usermod -aG docker $USER -># Log out and log back in so that your group membership is re-evaluated ->``` -> - - -## Get the container - -Load the pre-build AGL SDK docker image including `xds-server`: - -```bash -wget -O - http://iot.bzh/download/public/XDS/docker/docker_agl_worker-xds-latest.tar.xz | docker load -``` - -You should get `docker.automotivelinux.org/agl/worker-xds:X.Y` image - -```bash -# List image that we just load -docker images "docker.automotivelinux.org/agl/worker-xds*" - -REPOSITORY TAG IMAGE ID CREATED SIZE -docker.automotivelinux.org/agl/worker-xds 5.0 877979e534ff 3 hours ago 106MB -``` - -## Create and start a new container - -Use provided script to create a new docker image and start a new container: - -```bash -# Get script -wget -O xds-docker-create-container.sh 'https://gerrit.automotivelinux.org/gerrit/gitweb?p=src/xds/xds-server.git;a=blob_plain;f=scripts/xds-docker-create-container.sh;hb=master' - -# Create new XDS worker container (-id option value should be changed when you get port conflict error) -bash ./xds-docker-create-container.sh -id 0 - -# Check that new container is running -docker ps | grep worker-xds -f67079db4339 docker.automotivelinux.org/agl/worker-xds:5.0 "/usr/bin/wait_for..." About a minute ago Up 34 seconds 0.0.0.0:8000->8000/tcp,0.0.0.0:10809->10809/tcp, 0.0.0.0:2222->22/tcp agl-xds-HOSTNAME-0-USERNAME -``` - -This container exposes following ports: - -| Port number | Description | -|-------------|---------------------------------------------| -| 8000 | `xds-server`: serve XDS webapp and REST API | -| 2222 | ssh | - -This container also creates the following volumes (shared folders between -inside and outside docker): - -| Directory on host | Directory inside docker | Comment | -|-------------------|-------------------------|---------| -| $HOME/xds-workspace | /home/devel/xds-workspace | XDS projects workspace location| -| $HOME/xds-workspace/.xdt_0 | /xdt | location to store SDKs | -| $USER_VOLUME | $USER_VOLUME | user path, see `--volume` option of `xds-docker-create-container.sh` script | - -### Optional settings - -**`--volume`** - -You can add a new shared directory using `--volume` option in order -to use for example with Path-Mapping folder type. - -```bash -# Create new XDS worker container and share extra '$HOME/my-workspace' directory -bash ./xds-docker-create-container.sh --volume /my-workspace:$HOME/my-workspace -``` - -**`--id`** - -You can change docker used port with `-id` option - -```bash -# Create new XDS worker container with a different port number -ID=3 -bash ./xds-docker-create-container.sh -id ${ID} - -# Check that new container is running (in example below id has been set to 3) -docker ps | grep worker-xds -f67079db4339 docker.automotivelinux.org/agl/worker-xds:5.0 "/usr/bin/wait_for..." About a minute ago Up 34 seconds 0.0.0.0:2225->22/tcp, 0.0.0.0:8003->8000/tcp, 0.0.0.0:10892->10809/tcp agl-xds-3 -``` - - ->**Warning:** -> Changing container id will impact the port number used to connect to xds-server. -> So you may need to adjust xds-agent config in order to match the right port number. -> ->In above example, with `id` set to 3, the export port number will be `8003` and >consequently ->you must define xds-server `url` in `xds-agent` configuration as follow: -> ->```json ->{ -> ... -> "xdsServers": [ -> { -> "url": "http://localhost:8003" -> } -> ], -> ... ->} ->``` -> ->See also [xds-agent configuration](../part-2/1_xds-agent/1_config.html) chapter for >more details. - - -### Manually setup docker user id - - -**Note:** - -If you used `xds-docker-create-container.sh` script to create XDS -docker container, user uid/gid inside docker has already been changed by this script. - - -If you plan to use **path-mapping sharing type for your projects**, you need to -have the same user id and group id inside and outside docker. - -By default user and group name inside docker is set `devel` (id `1664`). - -Use following commands to replace id `1664` with your user/group id: - -```bash -# Set docker container name to use (usually agl-xds-xxx where xxx is USERNAME@MACHINENAME-IDX-NAME) -export CONTAINER_NAME=agl-xds-seb@laptop-0-seb -docker ps | grep -q ${CONTAINER_NAME} || echo "ERROR: No container name \"${CONTAINER_NAME}\" please set a valid CONTAINER_NAME before you continue" - -# First kill all processes of devel user (including running xds-server) -docker exec ${CONTAINER_NAME} bash -c "/bin/loginctl kill-user devel" - -# Change user and group id inside docker to match your ids -docker exec ${CONTAINER_NAME} bash -c "usermod -u $(id -u) devel" -docker exec ${CONTAINER_NAME} bash -c "groupmod -g $(id -g) devel" - -# Update some files ownership -docker exec ${CONTAINER_NAME} bash -c "chown -R devel:devel /home/devel /tmp/xds*" - -# Restart devel autologin service -docker exec ${CONTAINER_NAME} bash -c "systemctl restart autologin" - -# Restart xds-server as a service (ssh port 2222 may depend on your container ID) -ssh -p 2222 devel@localhost -- "systemctl --user restart xds-server" -``` - -## Check if xds-server is running (open XDS webapp) - -**`xds-server` is automatically started** as a user service on container startup. - -If the container is running on your localhost, you can access to a basic web -application: - -```bash -xdg-open http://localhost:8000 -``` - -If needed you can status / stop / start it manually using following commands: - -```bash -# Status XDS server: -ssh -p 2222 devel@localhost systemctl --user status xds-server.service - -# Stop XDS server -ssh -p 2222 devel@localhost systemctl --user stop xds-server.service - -# Start XDS server -ssh -p 2222 devel@localhost systemctl --user start xds-server.service - -# Get XDS server logs -ssh -p 2222 devel@localhost journalctl --user --unit=xds-server.service --output=cat -``` - -`xds-server` is now up and running, you can now install AGL SDKs, please refer -to next chapter named [Installing AGL SDKs](./3_install-sdks.html) - - -Please refer to [xds-server configuration](../part-2/1_xds-server/1_config.html) chapter for additional info about xds-server settings. - diff --git a/docs/part-1/1-3_install-xds-server-native.md b/docs/part-1/1-3_install-xds-server-native.md deleted file mode 100644 index 77ef9f8..0000000 --- a/docs/part-1/1-3_install-xds-server-native.md +++ /dev/null @@ -1,86 +0,0 @@ -# Native installation - -You can chose to install xds-server 'natively' instead of within a docker -container but note that only Linux host OSes are supported and tested for native -installation ! - -You also need to install `python3` to allow `xds-server` to manage AGL sdks. - -## Install packages for debian distro type - -```bash -# 'DISTRO' can be set to { xUbuntu_16.04, xUbuntu_16.10, xUbuntu_17.04, Debian_8.0, Debian_9.0} -export DISTRO="xUbuntu_16.04" - -# AGL_RELEASE can be set to {AGL_ElectricEel, AGL_FunkyFlounder, AGL_Master} -export AGL_RELEASE="AGL_Master" - -wget -O - http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/${AGL_RELEASE}/${DISTRO}/Release.key | sudo apt-key add - -sudo bash -c "cat >> /etc/apt/sources.list.d/AGL.list < -**Optional step**: skip this chapter if you plan to use default settings - - -Please refer to [Configuration chapter of xds-server](../part-2/1_xds-server/1_config.html) -documentation for more details about JSON configuration file. - -## Start/Stop xds-server - -`xds-server` can be managed as a systemd service with the following commands: - -```bash -# Status XDS server: -systemctl --user status xds-server.service - -# Stop XDS server -systemctl --user stop xds-server.service - -# Start XDS server -systemctl --user start xds-server.service - -# Get XDS server logs -systemctl --user --unit=xds-server.service --output=cat -``` - -To check if xds-server is correctly install and running, you can access the web -interface, using a web browser : - -```bash -xdg-open http://localhost:8000 -``` - -or get the current version using the following curl command: - -```bash -curl http://localhost:8000/api/v1/version -``` diff --git a/docs/part-1/4_build-first-app.md b/docs/part-1/4_build-first-app.md deleted file mode 100644 index 34f895b..0000000 --- a/docs/part-1/4_build-first-app.md +++ /dev/null @@ -1,21 +0,0 @@ -# Create your first AGL application - -## Prerequisites - -- `xds-agent` is running locally on your machine - (see previous chapter: [Installing XDS client tools](./1_install-client.html) ) -- `xds-server` is running locally in a docker container or is accessible on your - network (see previous chapter: [Installing XDS server](./2_install-xds-server.html)) -- one or more SDK have been installed (see previous chapter: [Installing AGL SDKs](./3_install-sdks.html)) -- XDS configuration is correct: in other words, connection is correctly - established between `xds-agent` and `xds-server` and no error message is - displayed when you open XDS Dashboard in a web browser. - ---- - -Links to subchapters : - -- [Setup](./4-1_build-first-app-setup.html) -- [Build using command line tool](./4-2_build-first-app-cmd.html) -- [Build using XDS Dashboard](./4-3_build-first-app-dashboard.html) -- [Build using a source code editor / IDE](./4-4_build-first-app-ide.html) diff --git a/docs/part-1/5-1_debug-first-app-config.md b/docs/part-1/5-1_debug-first-app-config.md deleted file mode 100644 index 8743bc1..0000000 --- a/docs/part-1/5-1_debug-first-app-config.md +++ /dev/null @@ -1,76 +0,0 @@ -# Configuration - - `xds-gdb` configuration is defined by variables (see listed below). - These variables may be set using : - -- environment variables (inherited), -- or a config file set with `XDS_CONFIG` environment variable, for example: - `XDS_CONFIG=/tmp/my_xds_gdb_config.env xds-gdb` -- or by setting variables within a gdb ini file (see details below), -- or a "user" config file located in following directory (first found is taken): - 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 - -`XDS_CONFIG` Config file defining `XDS_xxx` configuration variables. - -Variables of this file will overwrite inherited environment variables. - -Variables definition may be prefixed or not by "export" keyword. - -Here is an example of configuration file: - -```bash -# for example: -# 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 -``` - -`XDS_LOGLEVEL` - -Set logging level (supported levels: panic, fatal, error, warn, info, debug) - -`XDS_LOGFILE` - -Set logging file, default `/tmp/xds-gdb.log`. - -`XDS_NATIVE_GDB` - -Use native gdb mode instead of remote XDS mode. - -`XDS_PROJECT_ID` *(mandatory in XDS mode)* - -Project ID you want to build - -`XDS_RPATH` - -Relative path into project - -`XDS_SDK_ID` *(mandatory in XDS mode)* - -Cross Sdk ID to use to build project - -`XDS_AGENT_URL` - -Local XDS agent url (default `http://localhost:8800`) - -## Configuration variables set within gdb init command file - -Above `XDS_xxx` variables may also be defined within gdb init command file -(see --command or -x option of genuine Gdb). - -You must respect the following syntax: commented line including `:XDS-ENV:` tag - -Example of gdb init file where we define project and sdk ID: - -```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/part-1/5-2_debug-first-app-cmd.md b/docs/part-1/5-2_debug-first-app-cmd.md deleted file mode 100644 index 4d2ca84..0000000 --- a/docs/part-1/5-2_debug-first-app-cmd.md +++ /dev/null @@ -1,69 +0,0 @@ -# Debug using xds-gdb from command line - -## XDS remote debugging mode - -First the project you want to debug must be declared on an xds-server and this -project may also has been built using using XDS (see [Create your first AGL application](./4_build-first-app.html) for more details). - -So to debug it you need to have the XDS agent - server chain in place and -you also need the project and sdk unique id. - -You can find these IDs in project page of XDS dashboard or you can get them from command line using the `--list` option. - -This option lists all existing projects ID: - -```bash -xds-gdb --list -``` - -Now to refer your project, just set `XDS_PROJECT_ID` and `XDS_SDK_ID` variables. - -You are now ready to use `xds-gdb` to for example cross debug your project. - -Here is an example to build and debug a project based on CMakefile and -[cmake-apps-module](https://git.automotivelinux.org/src/cmake-apps-module/): - -```bash -# Go into your project directory (for example helloworld-native-application) -cd ~/xds-workspace -git clone https://github.com/iotbzh/helloworld-native-application.git -cd helloworld-service - -# Declare your project on xds-server -# - -# Define XDS config -cat <./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 - -# Tell to xds-cli and xds-gdb which is your config file -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 -``` - - -**Note:** : [helloworld-native-application](https://github.com/iotbzh/helloworld-native-application) project is an AGL -project based on [cmake-apps-module](https://git.automotivelinux.org/src/cmake-apps-module/) -(refer to install cmake module [instructions](../../cmakeafbtemplates/dev_guide/installing-cmake.html)). This CMake templating, used to develop application -with the AGL Application Framework, will automatically generate makefile rules -(eg. `remote-target-populate`) or scripts (eg. `build/target/xxx` scripts). - -For more info about app-template, please refer to [this documentation](../../../#using-the-cmake-applications-module). - - -## Native debugging - -To enable native debugging mode, you need to define `XDS_NATIVE_GDB` variable. diff --git a/docs/part-1/5-3_debug-first-app-ide.md b/docs/part-1/5-3_debug-first-app-ide.md deleted file mode 100644 index 0473892..0000000 --- a/docs/part-1/5-3_debug-first-app-ide.md +++ /dev/null @@ -1,44 +0,0 @@ -# Debug using xds-gdb within an IDE - -First the project you want to debug must be declared on an xds-server and this -project may also has been built using using XDS (see [Create your first AGL application](./4_build-first-app.html) for more details). - -## Netbeans - -__Netbeans 8.x :__ - -- Open menu **Tools** -> **Options** - - Open **C/C++** tab, in **Build Tools** sub-tab, click on **Add** button: - - ![Add new tool panel](./pictures/nb_newtool.png){:: style="width:90%; max-width:700px; margin:auto; display:flex"} - - - Then, you should set **Make Command** and **Debugger Command** to point to xds tools: - - ![Add new tool panel](./pictures/nb_xds_options.png){:: style="width:90%; max-width:700px; margin:auto; display:flex"} - - - Finally click on **OK** button. - -- Edit project properties (using menu **File** -> **Project Properties**) to update Debug settings: - - - Be sure that "Gen3 board" configuration is selected - - - Select **Run** category, and set: - - Run Command: `target/start-on-root@renesas-gen3.sh` - (_script name may depend of RSYNC_TARGET variable you set in pre-build command_) - - Run Directory: `build_gen3` - - - Select **Debug** category, and set: - - Debug command: `/bin/true` - - Working Directory: _empty field_ - - Gdb Init File: `target/gdb-on-root@renesas-gen3.ini` - (_script name may depend of RSYNC_TARGET variable you set in pre-build command_) - - ![Select Model panel](./pictures/nb_project_debug-1.png){:: style="width:90%; max-width:700px; margin:auto; display:flex"} - - - Click on **Apply** and then **OK** button to save settings - -You can now start debugging your application with menu **Debug** -> **Debug Project** (or **CTRL+F5** shortcut) - -## Others IDE - -*Coming soon...* diff --git a/docs/part-1/5_debug-first-app.md b/docs/part-1/5_debug-first-app.md deleted file mode 100644 index e1bdffd..0000000 --- a/docs/part-1/5_debug-first-app.md +++ /dev/null @@ -1,22 +0,0 @@ -# Debug your first AGL application - -Debug is based on gdb and you need to use `xds-gdb` as a wrapper on gdb to -cross-debug your application. - -This tool allows you to debug an application built with XDS without the need to install gdb or any cross tools. - -Two debugging models are supported: - -1. native debugging -1. XDS remote debugging requiring an XDS agent/server setup and that allows you to cross debug your application. - -By default XDS debug model is used and you need to define `XDS_NATIVE_GDB` -variable to use native gdb debug mode instead. - ---- - -Links to subchapters : - -- [Configuration](./5-1_debug-first-app-config.html) -- [xds-gdb from command line](./5-2_debug-first-app-cmd.html) -- [xds-gdb within an IDE](./5-3_debug-first-app-ide.html) diff --git a/docs/part-1/debug-cmd-line.md b/docs/part-1/debug-cmd-line.md new file mode 100644 index 0000000..4d2ca84 --- /dev/null +++ b/docs/part-1/debug-cmd-line.md @@ -0,0 +1,69 @@ +# Debug using xds-gdb from command line + +## XDS remote debugging mode + +First the project you want to debug must be declared on an xds-server and this +project may also has been built using using XDS (see [Create your first AGL application](./4_build-first-app.html) for more details). + +So to debug it you need to have the XDS agent - server chain in place and +you also need the project and sdk unique id. + +You can find these IDs in project page of XDS dashboard or you can get them from command line using the `--list` option. + +This option lists all existing projects ID: + +```bash +xds-gdb --list +``` + +Now to refer your project, just set `XDS_PROJECT_ID` and `XDS_SDK_ID` variables. + +You are now ready to use `xds-gdb` to for example cross debug your project. + +Here is an example to build and debug a project based on CMakefile and +[cmake-apps-module](https://git.automotivelinux.org/src/cmake-apps-module/): + +```bash +# Go into your project directory (for example helloworld-native-application) +cd ~/xds-workspace +git clone https://github.com/iotbzh/helloworld-native-application.git +cd helloworld-service + +# Declare your project on xds-server +# + +# Define XDS config +cat <./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 + +# Tell to xds-cli and xds-gdb which is your config file +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 +``` + + +**Note:** : [helloworld-native-application](https://github.com/iotbzh/helloworld-native-application) project is an AGL +project based on [cmake-apps-module](https://git.automotivelinux.org/src/cmake-apps-module/) +(refer to install cmake module [instructions](../../cmakeafbtemplates/dev_guide/installing-cmake.html)). This CMake templating, used to develop application +with the AGL Application Framework, will automatically generate makefile rules +(eg. `remote-target-populate`) or scripts (eg. `build/target/xxx` scripts). + +For more info about app-template, please refer to [this documentation](../../../#using-the-cmake-applications-module). + + +## Native debugging + +To enable native debugging mode, you need to define `XDS_NATIVE_GDB` variable. diff --git a/docs/part-1/debug-configuration.md b/docs/part-1/debug-configuration.md new file mode 100644 index 0000000..8743bc1 --- /dev/null +++ b/docs/part-1/debug-configuration.md @@ -0,0 +1,76 @@ +# Configuration + + `xds-gdb` configuration is defined by variables (see listed below). + These variables may be set using : + +- environment variables (inherited), +- or a config file set with `XDS_CONFIG` environment variable, for example: + `XDS_CONFIG=/tmp/my_xds_gdb_config.env xds-gdb` +- or by setting variables within a gdb ini file (see details below), +- or a "user" config file located in following directory (first found is taken): + 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 + +`XDS_CONFIG` Config file defining `XDS_xxx` configuration variables. + +Variables of this file will overwrite inherited environment variables. + +Variables definition may be prefixed or not by "export" keyword. + +Here is an example of configuration file: + +```bash +# for example: +# 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 +``` + +`XDS_LOGLEVEL` + +Set logging level (supported levels: panic, fatal, error, warn, info, debug) + +`XDS_LOGFILE` + +Set logging file, default `/tmp/xds-gdb.log`. + +`XDS_NATIVE_GDB` + +Use native gdb mode instead of remote XDS mode. + +`XDS_PROJECT_ID` *(mandatory in XDS mode)* + +Project ID you want to build + +`XDS_RPATH` + +Relative path into project + +`XDS_SDK_ID` *(mandatory in XDS mode)* + +Cross Sdk ID to use to build project + +`XDS_AGENT_URL` + +Local XDS agent url (default `http://localhost:8800`) + +## Configuration variables set within gdb init command file + +Above `XDS_xxx` variables may also be defined within gdb init command file +(see --command or -x option of genuine Gdb). + +You must respect the following syntax: commented line including `:XDS-ENV:` tag + +Example of gdb init file where we define project and sdk ID: + +```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/part-1/debug-ide.md b/docs/part-1/debug-ide.md new file mode 100644 index 0000000..0473892 --- /dev/null +++ b/docs/part-1/debug-ide.md @@ -0,0 +1,44 @@ +# Debug using xds-gdb within an IDE + +First the project you want to debug must be declared on an xds-server and this +project may also has been built using using XDS (see [Create your first AGL application](./4_build-first-app.html) for more details). + +## Netbeans + +__Netbeans 8.x :__ + +- Open menu **Tools** -> **Options** + - Open **C/C++** tab, in **Build Tools** sub-tab, click on **Add** button: + + ![Add new tool panel](./pictures/nb_newtool.png){:: style="width:90%; max-width:700px; margin:auto; display:flex"} + + - Then, you should set **Make Command** and **Debugger Command** to point to xds tools: + + ![Add new tool panel](./pictures/nb_xds_options.png){:: style="width:90%; max-width:700px; margin:auto; display:flex"} + + - Finally click on **OK** button. + +- Edit project properties (using menu **File** -> **Project Properties**) to update Debug settings: + + - Be sure that "Gen3 board" configuration is selected + + - Select **Run** category, and set: + - Run Command: `target/start-on-root@renesas-gen3.sh` + (_script name may depend of RSYNC_TARGET variable you set in pre-build command_) + - Run Directory: `build_gen3` + + - Select **Debug** category, and set: + - Debug command: `/bin/true` + - Working Directory: _empty field_ + - Gdb Init File: `target/gdb-on-root@renesas-gen3.ini` + (_script name may depend of RSYNC_TARGET variable you set in pre-build command_) + + ![Select Model panel](./pictures/nb_project_debug-1.png){:: style="width:90%; max-width:700px; margin:auto; display:flex"} + + - Click on **Apply** and then **OK** button to save settings + +You can now start debugging your application with menu **Debug** -> **Debug Project** (or **CTRL+F5** shortcut) + +## Others IDE + +*Coming soon...* diff --git a/docs/part-1/debug-overview.md b/docs/part-1/debug-overview.md new file mode 100644 index 0000000..e1bdffd --- /dev/null +++ b/docs/part-1/debug-overview.md @@ -0,0 +1,22 @@ +# Debug your first AGL application + +Debug is based on gdb and you need to use `xds-gdb` as a wrapper on gdb to +cross-debug your application. + +This tool allows you to debug an application built with XDS without the need to install gdb or any cross tools. + +Two debugging models are supported: + +1. native debugging +1. XDS remote debugging requiring an XDS agent/server setup and that allows you to cross debug your application. + +By default XDS debug model is used and you need to define `XDS_NATIVE_GDB` +variable to use native gdb debug mode instead. + +--- + +Links to subchapters : + +- [Configuration](./5-1_debug-first-app-config.html) +- [xds-gdb from command line](./5-2_debug-first-app-cmd.html) +- [xds-gdb within an IDE](./5-3_debug-first-app-ide.html) -- cgit 1.2.3-korg