@@ -1140,6 +1140,9 @@ class RecipeModified:
if self.build_tool is BuildTool.KERNEL_MODULE:
self.reverse_debug_prefix_map = self._init_reverse_debug_prefix_map(
self.kernel_cc)
+ elif self.build_tool is BuildTool.CARGO:
+ self.reverse_debug_prefix_map = self._init_reverse_debug_prefix_map(
+ self.cargo_rustflags)
else:
self.reverse_debug_prefix_map = self._init_reverse_debug_prefix_map(
recipe_d.getVar('DEBUG_PREFIX_MAP'))
@@ -1292,15 +1295,20 @@ class RecipeModified:
return ':'.join(self.solib_search_path(image))
def _init_reverse_debug_prefix_map(self, debug_prefix_map):
- """Parses GCC map options and returns a mapping of target to host paths.
+ """Parses compiler map options and returns a mapping of target to host paths.
- This function scans a string containing GCC options such as -fdebug-prefix-map,
+ This function scans a string containing compiler options such as -fdebug-prefix-map,
-fmacro-prefix-map, and -ffile-prefix-map (in both '--option value' and '--option=value'
forms), extracting all mappings from target paths (used in debug info) to host source
paths. If multiple mappings for the same target path are found, the most suitable
host path is selected (preferring 'sources' over 'build' directories).
"""
- prefixes = ("-fdebug-prefix-map", "-fmacro-prefix-map", "-ffile-prefix-map")
+ prefixes = (
+ "-fdebug-prefix-map",
+ "-fmacro-prefix-map",
+ "-ffile-prefix-map",
+ "--remap-path-prefix",
+ )
all_mappings = {}
args = shlex.split(debug_prefix_map)
i = 0
Use Cargo RUSTFLAGS to populate reverse debug mappings and recognize Rust --remap-path-prefix alongside the existing GCC prefix-map options. The following LLDB source-map change depends on these normalized mappings. AI-Generated: Uses GitHub Copilot Signed-off-by: Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com> --- scripts/lib/devtool/ide_sdk.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)