From: Adrian Freihofer Date: Tue, 3 Feb 2026 22:16:24 +0000 (+0100) Subject: devtool: ide-sdk: vscode replace scripts X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b6d435fbae1e6616577e50229ba86927d3c79f6;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git devtool: ide-sdk: vscode replace scripts Write the ssh command to start gdbserver on target directly into the tasks.json. This avoids the need to create one more script file on the host. It also simplifies manual modifications of VSCode's standard tasks.json which is much more handy than modifying multiple proprietary scripts used to launch gdbserver. Signed-off-by: Adrian Freihofer Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- diff --git a/scripts/lib/devtool/ide_plugins/ide_code.py b/scripts/lib/devtool/ide_plugins/ide_code.py index 3f8c1a44a3..05d513f160 100644 --- a/scripts/lib/devtool/ide_plugins/ide_code.py +++ b/scripts/lib/devtool/ide_plugins/ide_code.py @@ -20,6 +20,18 @@ class GdbCrossConfigVSCode(GdbCrossConfig): super().__init__(image_recipe, modified_recipe, binary, gdbserver_default_mode) + def target_ssh_gdbserver_start_args(self, gdbserver_mode=None): + """Get the ssh command arguments to start gdbserver on the target device + + returns something like: + ['-p', '2222', 'root@target', '"/bin/sh -c \'/usr/bin/gdbserver --once :1234 /usr/bin/cmake-example\'"'] + """ + if gdbserver_mode is None: + gdbserver_mode = self.gdbserver_default_mode + return self._target_ssh_gdbserver_args() + [ + self._target_gdbserver_start_cmd(gdbserver_mode) + ] + def target_ssh_gdbserver_kill_args(self): """Get the ssh command arguments to kill gdbserver on the target device @@ -31,7 +43,7 @@ class GdbCrossConfigVSCode(GdbCrossConfig): ] def initialize(self): - self._gen_gdbserver_start_script() + pass class IdeVSCode(IdeBase): @@ -322,7 +334,8 @@ class IdeVSCode(IdeBase): "label": gdb_cross_config.id_pretty_mode(gdbserver_mode), "type": "shell", "isBackground": True, - "command": gdb_cross_config.gdbserver_script(gdbserver_mode), + "command": gdb_cross_config.gdb_cross.target_device.ssh_sshexec, + "args": gdb_cross_config.target_ssh_gdbserver_start_args(gdbserver_mode), "problemMatcher": [ { "pattern": [ @@ -466,7 +479,8 @@ class IdeVSCode(IdeBase): "label": gdb_cross_config.id_pretty(gdbserver_mode), "type": "shell", "isBackground": True, - "command": gdb_cross_config.gdbserver_script(gdbserver_mode), + "command": gdb_cross_config.gdb_cross.target_device.ssh_sshexec, + "args": gdb_cross_config.target_ssh_gdbserver_start_args(gdbserver_mode), "problemMatcher": [ { "pattern": [