aboutsummaryrefslogtreecommitdiffstats
path: root/docs/part-2/2_xds-agent/4_debug.md
blob: 9490c4bdc39e2b6cbbb8ff6eaee4449a9437ac5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Debugging

## XDS agent architecture

The agent part is written in *Go* and the webapp / dashboard is in *typescript + Angular4*.

```bash
|
+-- bin/                where xds-server binary file will be built
|
+-- conf.d              Linux configuration and startup files (systemd user service)
|
+-- glide.yaml          Go package dependency file
|
+-- lib/                sources of server part (Go)
|
+-- main.go             main entry point of of Web server (Go)
|
+-- Makefile            makefile including
|
+-- README.md           this readme
|
+-- scripts/            hold various scripts used for installation or startup
|
+-- tools/              temporary directory to hold development tools (like glide)
|
+-- vendor/             temporary directory to hold Go dependencies packages
|
+-- webapp/             source client basic webapp / dashboard
```

## Debug

Visual Studio Code launcher settings can be found into `.vscode/launch.json`.

>**Tricks:**
>
>To debug both `xds-agent` and `xds-server` or common code
>`xds-common`, it may be useful use the same local sources.
>
>So you should replace `xds-server` + `xds-common` in `vendor` directory by a symlink.
>
>So clone first `xds-server` + `xds-common` sources next to `xds-agent` directory.

You should have the following tree:

```bash
tree -L 5 --charset=ascii src/
src/
`-- gerrit.automotivelinux.org
    `-- gerrit
        `-- src
            `-- xds
                |-- backup.sh
                |-- xds-agent
                |-- xds-cli
                |-- xds-common
                |-- xds-docs
                |-- xds-gdb
                `-- xds-server
```

Then invoke `vendor/debug` Makefile rule to create a symlink inside vendor
directory :

```bash
cd src/gerrit.automotivelinux.org/gerrit/src/xds/xds-agent
make vendor/debug
```