@@ -568,6 +568,8 @@ class IdeVSCode(IdeBase):
}
rootfs_dbg = lldb_config.image_recipe.rootfs_dbg
is_cargo = modified_recipe.build_tool is BuildTool.CARGO
+ if is_cargo:
+ source_map.update(modified_recipe.cargo_std_source_map)
if is_cargo or rootfs_dbg:
source_root = (
modified_recipe.real_srctree
@@ -915,6 +915,7 @@ class RecipeModified:
self.cargo_packageconfig_confargs = None
self.cargo_rustflags = None
self.cargo_env = None
+ self.cargo_std_source_map = {}
# Populated after bitbake built all the recipes
self._installed_binaries = None
@@ -1134,6 +1135,24 @@ class RecipeModified:
'SYSTEM_DEPS_BUILD_INTERNAL': 'never',
'ZSTD_SYS_USE_PKG_CONFIG': '1',
})
+ # libstd-rs DWARF paths map to sources staged by rust-native.
+ libstd_recipe_d = parse_recipe(
+ config, tinfoil, 'libstd-rs', appends=True,
+ filter_workspace=False)
+ if libstd_recipe_d:
+ libstd_rustsrc = libstd_recipe_d.getVar('RUSTSRC')
+ target_dbgsrc_dir = libstd_recipe_d.getVar('TARGET_DBGSRC_DIR')
+ libstd_tmpdir = libstd_recipe_d.getVar('TMPDIR')
+ if libstd_rustsrc and target_dbgsrc_dir and libstd_tmpdir:
+ shared_source_dir = os.path.join(libstd_tmpdir, 'work-shared')
+ target_source_root = os.path.join(
+ target_dbgsrc_dir,
+ os.path.relpath(libstd_rustsrc, shared_source_dir),
+ 'library')
+ sdk_source_root = os.path.join(
+ self.recipe_sysroot_native, self.libdir.lstrip('/'),
+ 'rustlib', 'src', 'rust', 'library')
+ self.cargo_std_source_map[target_source_root] = sdk_source_root
self.build_tool = BuildTool.CARGO
elif bb.data.inherits_class('module', recipe_d):
self.build_tool = BuildTool.KERNEL_MODULE
libstd-rs DWARF paths use a source prefix under work-shared, while rust-native stages the standard-library sources in the recipe native sysroot. Derive the target prefix from BitBake metadata and map it to the SDK source tree so LLDB runtime frames resolve without host Rust sources. AI-Generated: Uses GitHub Copilot Signed-off-by: Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com> --- scripts/lib/devtool/ide_plugins/ide_code.py | 2 ++ scripts/lib/devtool/ide_sdk.py | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+)