Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com>
To: openembedded-core@lists.openembedded.org
Cc: adrian.freihofer@gmail.com, Ross.Burton@arm.com,
	mohammed.raza@savoirfairelinux.com,
	Enguerrand de Ribaucourt
	<enguerrand.de-ribaucourt@savoirfairelinux.com>
Subject: [PATCH 3/6] devtool: code: Add source mapping for debug source files
Date: Thu, 15 Feb 2024 18:04:19 +0100	[thread overview]
Message-ID: <20240215170422.659073-4-enguerrand.de-ribaucourt@savoirfairelinux.com> (raw)
In-Reply-To: <20240215170422.659073-1-enguerrand.de-ribaucourt@savoirfairelinux.com>

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.
---
 scripts/lib/devtool/ide_plugins/ide_code.py | 1 +
 scripts/lib/devtool/ide_sdk.py              | 1 +
 2 files changed, 2 insertions(+)

diff --git a/scripts/lib/devtool/ide_plugins/ide_code.py b/scripts/lib/devtool/ide_plugins/ide_code.py
index b2193130d2e..c063b7d0590 100644
--- a/scripts/lib/devtool/ide_plugins/ide_code.py
+++ b/scripts/lib/devtool/ide_plugins/ide_code.py
@@ -234,6 +234,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 a82ab572998..1e36f2b2093 100755
--- a/scripts/lib/devtool/ide_sdk.py
+++ b/scripts/lib/devtool/ide_sdk.py
@@ -356,6 +356,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(
-- 
2.34.1



  parent reply	other threads:[~2024-02-15 17:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-15 17:04 [PATCH 0/6] devtool: ide: Improve VSCode support Enguerrand de Ribaucourt
2024-02-15 17:04 ` [PATCH 1/6] devtool: ide: Fix topdir exception for fallback mode Enguerrand de Ribaucourt
2024-02-15 23:02   ` adrian.freihofer
2024-02-15 17:04 ` [PATCH 2/6] devtool: ide_sdk: Use bitbake's python3 for generated scripts Enguerrand de Ribaucourt
2024-02-15 17:04 ` Enguerrand de Ribaucourt [this message]
2024-02-15 23:21   ` [PATCH 3/6] devtool: code: Add source mapping for debug source files adrian.freihofer
2024-02-15 17:04 ` [PATCH 4/6] devtool: ide: vscode: Configure read-only files Enguerrand de Ribaucourt
2024-02-15 17:04 ` [PATCH 5/6] meson: use absolute cross-compiler paths Enguerrand de Ribaucourt
2024-02-15 17:04 ` [PATCH 6/6] devtool: code: Provide a generic C++ configuration Enguerrand de Ribaucourt
2024-02-15 23:15   ` adrian.freihofer
2024-02-15 17:11 ` [OE-core] [PATCH 0/6] devtool: ide: Improve VSCode support Richard Purdie
2024-02-15 22:38   ` Peter Kjellerstedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240215170422.659073-4-enguerrand.de-ribaucourt@savoirfairelinux.com \
    --to=enguerrand.de-ribaucourt@savoirfairelinux.com \
    --cc=Ross.Burton@arm.com \
    --cc=adrian.freihofer@gmail.com \
    --cc=mohammed.raza@savoirfairelinux.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox