diff mbox series

[3/9] devtool: ide-sdk: pre-select attach process with processFilter

Message ID 20260906210307.2793974-4-adrian.freihofer@siemens.com
State New
Headers show
Series devtool: ide-sdk: bug fixes, do_install-through-bitbake, NFS deploy prep | expand

Commit Message

AdrianF Sept. 6, 2026, 9:02 p.m. UTC
From: Adrian Freihofer <adrian.freihofer@siemens.com>

The ATTACH launch config now uses the extended-remote protocol, which
makes cppdbg show a picker listing every process running on the
target. In modified-recipe mode the binary to attach to is already
known, so the picker is only extra clicking, and on a busy target it
can make finding the right process among unrelated ones tedious.

Set "processFilter" to a regex matching the deployed binary's path so
cppdbg pre-selects it instead of showing the full process list. This
is a recent cpptools feature; until it ships in a released cpptools,
cppdbg silently ignores it and falls back to showing the full
unfiltered process list.

Require cpptools version that supports processFilter
https://github.com/microsoft/vscode-cpptools/pull/14684

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
---
 meta/lib/oeqa/selftest/cases/devtool.py     | 1 +
 scripts/lib/devtool/ide_plugins/ide_code.py | 1 +
 2 files changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py
index 3a407a5162..a4b7a83094 100644
--- a/meta/lib/oeqa/selftest/cases/devtool.py
+++ b/meta/lib/oeqa/selftest/cases/devtool.py
@@ -3569,6 +3569,7 @@  class DevtoolIdeSdkGccTests(DevtoolIdeSdkTests):
                 # from the process instead of killing it.
                 self.assertTrue(config.get("useExtendedRemote"), f"Configuration '{config['name']}' should use useExtendedRemote")
                 self.assertNotIn("cwd", config, f"Configuration '{config['name']}' should not set cwd in attach mode")
+                self.assertTrue(config.get("processFilter"), f"Configuration '{config['name']}' should use processFilter")
             else:
                 self.fail(f"Configuration '{config['name']}' has unexpected request type: {config['request']}")
 
diff --git a/scripts/lib/devtool/ide_plugins/ide_code.py b/scripts/lib/devtool/ide_plugins/ide_code.py
index 937c63a4a5..6effbac654 100644
--- a/scripts/lib/devtool/ide_plugins/ide_code.py
+++ b/scripts/lib/devtool/ide_plugins/ide_code.py
@@ -387,6 +387,7 @@  class IdeVSCode(IdeBase):
             # this configuration is generated. Stopping the session detaches
             # from the process instead of killing it.
             launch_config["useExtendedRemote"] = True
+            launch_config["processFilter"] = "(^| )%s( |$)" % cross_debug_config.binary.binary_path
         else:
             # cwd, environment and externalConsole configure the process the
             # debugger starts, they are not part of the attach schema.