From 503cc7c20cc196b9e8aefb8a7739d181924af178 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Wed, 22 May 2024 00:42:19 +0000 Subject: [PATCH] vscode: export MI_XSD_PATH and LD_LIBRARY_PATH in gdb wrapper MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- .vscode/launch.json | 6 ++++++ .vscode/libtool_gdb_wrapper.sh | 3 +++ 2 files changed, 9 insertions(+) diff --git a/.vscode/launch.json b/.vscode/launch.json index 4541842e1..be9691232 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -38,6 +38,12 @@ { "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, diff --git a/.vscode/libtool_gdb_wrapper.sh b/.vscode/libtool_gdb_wrapper.sh index 0f60c832d..37ec9e5fb 100755 --- a/.vscode/libtool_gdb_wrapper.sh +++ b/.vscode/libtool_gdb_wrapper.sh @@ -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 "$@" -- 2.34.1