]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
devtool: ide-sdk source mapping for vscode
authorEnguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com>
Sun, 25 Feb 2024 20:47:01 +0000 (21:47 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 27 Feb 2024 11:38:44 +0000 (11:38 +0000)
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>
scripts/lib/devtool/ide_plugins/ide_code.py
scripts/lib/devtool/ide_sdk.py

index d58d0bdc5392066d6063b42a34a3b300cdafd587..09f0bb2a07ef0dc10378944053dac8b2ea5743e1 100644 (file)
@@ -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:
index 3bfeb5a3fce6ff88ee3c470bd74ee8fa2c8a8f9d..289bbbf47c2626d3836207ad1587b6420e9d792b 100755 (executable)
@@ -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(