summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorEnguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com>2024-02-25 21:47:01 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-02-27 11:38:44 +0000
commit24db2b8d0d7104960c1cdb2c7ee5216c830a6754 (patch)
tree6476fe8d3dab6dd90c03b393eb13796fd616aeaf /scripts
parent63986b2c40d90fe96cdc6a46aa649efcf17f6ac2 (diff)
downloadopenembedded-core-contrib-24db2b8d0d7104960c1cdb2c7ee5216c830a6754.tar.gz
devtool: ide-sdk source mapping for vscode
When launching the debug configuration, the source files from the debug rootfs were openened in the editor instead of the local workspace files. We add an exception to properly map them to the file being developed and compiled by the IDE integration. This also more closely matches what the user would expect compared to native development. This is also true for the devtool fallback mode. Signed-off-by: Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/devtool/ide_plugins/ide_code.py1
-rwxr-xr-xscripts/lib/devtool/ide_sdk.py1
2 files changed, 2 insertions, 0 deletions
diff --git a/scripts/lib/devtool/ide_plugins/ide_code.py b/scripts/lib/devtool/ide_plugins/ide_code.py
index d58d0bdc53..09f0bb2a07 100644
--- a/scripts/lib/devtool/ide_plugins/ide_code.py
+++ b/scripts/lib/devtool/ide_plugins/ide_code.py
@@ -242,6 +242,7 @@ class IdeVSCode(IdeBase):
if gdb_cross_config.image_recipe.rootfs_dbg:
launch_config['additionalSOLibSearchPath'] = modified_recipe.solib_search_path_str(
gdb_cross_config.image_recipe)
+ src_file_map[os.path.join("/usr/src/debug", modified_recipe.pn, modified_recipe.pv)] = "${workspaceFolder}"
src_file_map["/usr/src/debug"] = os.path.join(
gdb_cross_config.image_recipe.rootfs_dbg, "usr", "src", "debug")
else:
diff --git a/scripts/lib/devtool/ide_sdk.py b/scripts/lib/devtool/ide_sdk.py
index 3bfeb5a3fc..289bbbf47c 100755
--- a/scripts/lib/devtool/ide_sdk.py
+++ b/scripts/lib/devtool/ide_sdk.py
@@ -357,6 +357,7 @@ class RecipeModified:
'PACKAGE_DEBUG_SPLIT_STYLE')
self.path = recipe_d.getVar('PATH')
self.pn = recipe_d.getVar('PN')
+ self.pv = recipe_d.getVar('PV')
self.recipe_sysroot = os.path.realpath(
recipe_d.getVar('RECIPE_SYSROOT'))
self.recipe_sysroot_native = os.path.realpath(