From: adrian.freihofer@gmail.com
To: Enguerrand de Ribaucourt
<enguerrand.de-ribaucourt@savoirfairelinux.com>,
openembedded-core@lists.openembedded.org
Subject: Re: [PATCH v2 2/5] devtool: code: Add source mapping for debug source files
Date: Sun, 25 Feb 2024 21:52:39 +0100 [thread overview]
Message-ID: <78d46783054810d0f7bcc0566867c4d44e1bdc03.camel@gmail.com> (raw)
In-Reply-To: <63b2d3cf-e269-48df-b9b0-a2c6e154dfff@savoirfairelinux.com>
On Thu, 2024-02-22 at 16:51 +0100, Enguerrand de Ribaucourt wrote:
>
>
> On 22/02/2024 14:00, adrian.freihofer@gmail.com wrote:
> > On Wed, 2024-02-21 at 15:56 +0100, Enguerrand de Ribaucourt wrote:
> > >
> > >
> > > On 21/02/2024 15:12, Enguerrand de Ribaucourt wrote:
> > > >
> > > >
> > > > On 20/02/2024 10:01, adrian.freihofer@gmail.com wrote:
> > > > > On Mon, 2024-02-19 at 17:55 +0100, Enguerrand de Ribaucourt
> > > > > wrote:
> > > > > > 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.
> > > > >
> > > > > This looks still wrong to me. If files from the rootfs are
> > > > > openend for
> > > > > a recipe which is in the workspace, the SDK is broken and we
> > > > > need
> > > > > to
> > > > > understand and fix that. This patch does not solve that, but
> > > > > will
> > > > > make
> > > > > it much harder to find the right solution for this issue.
> > > > Hi Adrian,
> > > >
> > > > This is affecting essentially the devtool fallback mode. Since
> > > > it's
> > > > compiled through devtool, it's using the bitbake packaging
> > > > information.
> > > >
> > > > Steps to reproduce:
> > > > - devtool modify powertop (autotools recipe, currently
> > > > fallback)
> > > > - devtool ide-sdk powertop [args...]
> > > > - open the powertop sources workspace
> > > > - run the debug launch configuration
> > > > - initial breakpoint opens the rootfs-dbg main.cpp instead
> > > > of the
> > > > current workspace
> > > >
> > > > This probably will get fixed for autotools with your specific
> > > > class
> > > > support, but will remain for the fallback mode.
> > > >
> > > > Do we want to keep this source map, but only for the fallback
> > > > mode?
> > > > Like
> > > > you say, it's kinda "cheating" the debug information, but since
> > > > we
> > > > are
> > > > in fallback mode, the devtool packaging is supposed to be using
> > > > the
> > > > sources from the workspace, so it's more like "hinting" at the
> > > > proper
> > > > source.
> > > It also affects more meson projects like lighttpd. The "hint"
> > > would
> > > still be valid given how it's built and deployed now. If you are
> > > still
> > > working on an alternative tinfoil deploy method, maybe it's not
> > > affected.
> >
> > It looks like the devtool deploy-target step is missing. If you
> > debug
> > packaged files this would behave like this. It's important to over
> > write the packaged files with the not packaged file from the image
> > folder. This is what the devtool deploy-target command does. It's
> > expected that this just happens, probably there is a bug in the
> > dependencies. Could you please try to run it explicit? Something
> > like
> > this:
> >
> > - devtool modify powertop (autotools recipe, currently fallback)
> > - devtool ide-sdk powertop [args...]
> >
> > - devtool build powertop
> > - devtool deploy-target powertop
> >
> > - open the powertop sources workspace
> > - run the debug launch configuration
> >
> > I guess this would work as expected. The question is then: Why is
> > the
> > deploy not executed?
> The deploy-target is actually executed automatically through the
> launch
> configuration. I also get the same result if I deploy manually. I
> believe that the problem is rather how "devtool build" compiles and
> packages the binary.
You are right. We need this additional source mapping. I found some
time to look into the details. I propose to go with these 4 patches
(including your patch as well):
https://lists.openembedded.org/g/openembedded-core/message/196146
Adrian
> >
> > Adrian
> >
> >
> > > > >
> > > > > Adrian
> > > > >
> > > > > >
> > > > > > Signed-off-by: Enguerrand de Ribaucourt
> > > > > > <enguerrand.de-ribaucourt@savoirfairelinux.com>
> > > > > > ---
> > > > > > 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 14679744807..f292edbe25c 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(
> > > > >
> > > > Enguerrand de Ribaucourt
> > > >
> > > Enguerrand de Ribaucourt
> >
>
> Enguerrand de Ribaucourt
next prev parent reply other threads:[~2024-02-25 20:52 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-19 16:55 [PATCH v2 0/5] devtool: ide: Improve VSCode support Enguerrand de Ribaucourt
2024-02-19 16:55 ` [PATCH v2 1/5] devtool: ide_sdk: Use bitbake's python3 for generated scripts Enguerrand de Ribaucourt
2024-02-20 9:03 ` adrian.freihofer
2024-02-19 16:55 ` [PATCH v2 2/5] devtool: code: Add source mapping for debug source files Enguerrand de Ribaucourt
2024-02-20 9:01 ` adrian.freihofer
2024-02-21 14:12 ` Enguerrand de Ribaucourt
2024-02-21 14:56 ` Enguerrand de Ribaucourt
2024-02-22 13:00 ` adrian.freihofer
2024-02-22 15:51 ` Enguerrand de Ribaucourt
2024-02-25 20:52 ` adrian.freihofer [this message]
2024-02-19 16:55 ` [PATCH v2 3/5] devtool: ide: vscode: Configure read-only files Enguerrand de Ribaucourt
2024-02-20 9:05 ` adrian.freihofer
2024-02-19 16:55 ` [PATCH v2 4/5] meson: use absolute cross-compiler paths Enguerrand de Ribaucourt
2024-02-20 12:54 ` [OE-core] " Richard Purdie
2024-02-19 16:55 ` [PATCH v2 5/5] devtool: code: Provide a generic C++ configuration Enguerrand de Ribaucourt
2024-02-20 9:20 ` adrian.freihofer
2024-02-20 9:27 ` Enguerrand de Ribaucourt
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=78d46783054810d0f7bcc0566867c4d44e1bdc03.camel@gmail.com \
--to=adrian.freihofer@gmail.com \
--cc=enguerrand.de-ribaucourt@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