vscode: export MI_XSD_PATH and LD_LIBRARY_PATH in gdb wrapper
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 22 May 2024 00:42:19 +0000 (00:42 +0000)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 27 Jun 2024 15:09:20 +0000 (11:09 -0400)
vscode fails to launch a session daemon using the libtool wrapper on machines
that don't have lttng installed since the XSD can't be loaded.

Export the MI_XSD_PATH to point to the file in the source tree to allow the
daemon to launch.

Moreover, launching the session daemon fails since it can't find
liblttng-ctl.so.0. Adding the library's .libs to LD_LIBRARY_PATH works around
the issue.

Change-Id: I52929b858917e5a103e067e6861cbdb5172744be
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
.vscode/launch.json
.vscode/libtool_gdb_wrapper.sh

index 4541842e11da25b3a9162dd64a45e4169318207e..be9691232054f660dd924af1af61f2008766a629 100644 (file)
                 {
                     "name": "LTTNG_SESSION_CONFIG_XSD_PATH",
                     "value": "${workspaceFolder}/src/common/"
+                },
+                // Assumes the 64-bit consumer was built. Point to the in-tree
+                // binary.
+                {
+                    "name": "LTTNG_CONSUMERD64_BIN",
+                    "value": "${workspaceFolder}/src/bin/lttng-consumerd/lttng-consumerd"
                 }
             ],
             "externalConsole": false,
index 0f60c832d1f153ce1c6f0fd6c750ff3a04873591..37ec9e5fb83d1f92462fa6ef577e666ba5ca0e15 100755 (executable)
@@ -6,4 +6,7 @@
 # Wrapper script to setup the environment before invoking gdb
 # on the in-tree binaries (under `.libs`)
 
+CURDIR=$(dirname "$0")/
+export LD_LIBRARY_PATH="$CURDIR/../src/lib/lttng-ctl/.libs:$LD_LIBRARY_PATH"
+
 libtool --mode=execute gdb "$@"
This page took 0.025947 seconds and 4 git commands to generate.