devtool: ide-sdk launch.json per recipe only

If multiple recipes are processed at once, the launch.json and the
tasks.json of the second recipe contains also the configurations for the
binaries of the first recipe.

Example:
  devtool ide-sdk powertop cmake-example oe-selftest-image
generated a launch and a tasks configuration for the cmake-example
recipe which also offers debugging the powertop binary.

(From OE-Core rev: 63986b2c40d90fe96cdc6a46aa649efcf17f6ac2)

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Adrian Freihofer 2024-02-25 21:47:00 +01:00 committed by Richard Purdie
parent be57fda542
commit 4c6f3bbc77

View File

@ -255,8 +255,10 @@ class IdeVSCode(IdeBase):
def vscode_launch(self, modified_recipe):
"""GDB Launch configuration for binaries (elf files)"""
configurations = [self.vscode_launch_bin_dbg(
gdb_cross_config) for gdb_cross_config in self.gdb_cross_configs]
configurations = []
for gdb_cross_config in self.gdb_cross_configs:
if gdb_cross_config.modified_recipe is modified_recipe:
configurations.append(self.vscode_launch_bin_dbg(gdb_cross_config))
launch_dict = {
"version": "0.2.0",
"configurations": configurations
@ -280,6 +282,8 @@ class IdeVSCode(IdeBase):
]
}
for gdb_cross_config in self.gdb_cross_configs:
if gdb_cross_config.modified_recipe is not modified_recipe:
continue
tasks_dict['tasks'].append(
{
"label": gdb_cross_config.id_pretty,
@ -394,6 +398,8 @@ class IdeVSCode(IdeBase):
}
if modified_recipe.gdb_cross:
for gdb_cross_config in self.gdb_cross_configs:
if gdb_cross_config.modified_recipe is not modified_recipe:
continue
tasks_dict['tasks'].append(
{
"label": gdb_cross_config.id_pretty,