2bc28f31eb26468f87332836d40f8088b61282ce
[AGL/documentation.git] / 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
1 ---
2 edit_link: ''
3 title: Configuration
4 origin_url: >-
5   https://git.automotivelinux.org/src/xds/xds-docs/plain/docs/part-1/debug-configuration.md?h=master
6 ---
7
8 <!-- 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 -->
9
10 # Configuration
11
12 Debug configuration (i.e. `xds-gdb`) is defined by variables.
13 You can see the variables used further down in this section.
14
15 You can set these variables using a number of methods:
16
17 - Environment variables that are inherited.
18
19 - Configuration file pointed to by the `XDS_CONFIG` environment variable
20   (e.g. `XDS_CONFIG=/tmp/my_xds_gdb_config.env xds-gdb`).
21
22 - A GDB "init" command file.
23
24 - A "user" configuration file located in one of the following
25   areas, which are order-dependent:
26
27   1. `$(CURRENT_DIRECTORY)/.xds-gdb.env`
28
29   1. `$(CURRENT_DIRECTORY)/../xds-gdb.env`
30
31   1. `$(CURRENT_DIRECTORY)/target/xds-gdb.env`
32
33   1. `$(HOME)/.config/xds/xds-gdb.env`
34
35 ## Configuration Variables
36
37 This section describes the `XDS_*` configuration variables.
38 As previously mentioned, you can define these variables as
39 described in the previous section.
40
41 - `XDS_LOGLEVEL`
42
43   Sets the logging level.
44   Levels include "panic", "fatal", "error", "warn", "info", and "debug".
45
46 - `XDS_LOGFILE`
47
48   Sets the logging file.
49   The default is `/tmp/xds-gdb.log`.
50
51 - `XDS_NATIVE_GDB`
52
53   Specifies to use native GDB mode rather than remote XDS mode.
54
55 - `XDS_PROJECT_ID`  *(mandatory in XDS mode)*
56
57   The project ID you want to build.
58
59 - `XDS_RPATH`
60
61   The relative path to the project.
62
63 - `XDS_SDK_ID`   *(mandatory in XDS mode)*
64
65   Cross SDK ID to use to build project
66
67 - `XDS_AGENT_URL`
68
69   The local XDS agent URL.
70   The default is `http://localhost:8800`.
71
72 ## Configuration Using `XDS_CONFIG`
73
74 As mentioned, you can define configuration variables in
75 a file you point to with the `XDS_CONFIG` variable.
76 Here is an example:
77
78 ```bash
79 XDS_CONFIG=/tmp/my_xds_gdb_config.env xds-gdb
80 ```
81
82 Variables defined in this file overwrite any inherited
83 environment variables.
84 When you define a variable in the file, you can prefix the
85 assignment with the "export" string.
86 Doing so causes the variable to be exported to the environment.
87
88 Following is an example of a configuration file pointed
89 to by the `XDS_CONFIG` variable.
90 These commands create the `xds-gen3.conf` configuration file
91 in the `$MY_PROJECT_DIR` directory:
92
93 ```bash
94 # MY_PROJECT_DIR=/home/seb/xds-workspace/helloworld-native-application
95 cat > $MY_PROJECT_DIR/xds-gen3.conf << EOF
96 export XDS_AGENT_URL=localhost:8800
97 export XDS_PROJECT_ID=4021617e-ced0-11e7-acd2-3c970e49ad9b
98 export XDS_SDK_ID=c226821b-b5c0-386d-94fe-19f807946d03
99 EOF
100 ```
101
102 ## Configuration Using GDB Init
103
104 GDB is a versatile debugger and can be run with many options.
105 One such option is to execute a GDB "init" file upon startup.
106 You do this by using the "--command" or "-x" command-line options
107 and providing the name of the init file.
108
109 <!-- section-note -->
110 **NOTES:**
111
112 - For information on debugging with GDB, see
113   "[Debugging with GDB](https://www.sourceware.org/gdb/onlinedocs/gdb.html)".
114
115 - For information on GDB init files, see
116   "[Command files](https://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_node/gdb_190.html)".
117 <!-- end-section-note -->
118
119 When you create an init file, it must conform to the following
120 syntax (i.e. inclusion of what are normally commenting characters
121 as well as use of the `:XDS-ENV:` tag).
122
123 Following is an example init file that defines the `XDS_PROJECT_ID`
124 and `XDS_SDK_ID` variables:
125
126 ```bash
127      # :XDS-ENV: XDS_PROJECT_ID=4021617e-ced0-11e7-acd2-3c970e49ad9b
128      # :XDS-ENV: XDS_SDK_ID=c226821b-b5c0-386d-94fe-19f807946d03
129 ```