Skip to content

Commit 6dc9ac6

Browse files
scripts: runners: stlink_gdbserver: add support for --no-load
Add support for the --load/--no-load argument from the base runner class. Signed-off-by: Mathieu Choplain <[email protected]>
1 parent f6e43fc commit 6dc9ac6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

scripts/west_commands/runners/stlink_gdbserver.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ def name(cls) -> str:
9090

9191
@classmethod
9292
def capabilities(cls) -> RunnerCaps:
93-
return RunnerCaps(commands={"attach", "debug", "debugserver"}, dev_id=True, extload=True)
93+
return RunnerCaps(commands={"attach", "debug", "debugserver"},
94+
dev_id=True, extload=True, debug_load=True)
9495

9596
@classmethod
9697
def extload_help(cls) -> str:
@@ -128,6 +129,7 @@ def do_create(cls, cfg: RunnerConfig, args: argparse.Namespace) -> "STLinkGDBSer
128129
args.port_number,
129130
args.extload,
130131
args.external_init,
132+
args.load,
131133
)
132134

133135
def __init__(
@@ -139,6 +141,7 @@ def __init__(
139141
gdb_port: int,
140142
external_loader: str | None,
141143
external_init: bool,
144+
load: bool,
142145
):
143146
super().__init__(cfg)
144147
self.ensure_output('elf')
@@ -149,6 +152,7 @@ def __init__(
149152
self._ap_id = ap_id
150153
self._external_loader = external_loader
151154
self._do_external_init = external_init
155+
self._load = load
152156

153157
def do_run(self, command: str, **kwargs):
154158
if command in ["attach", "debug", "debugserver"]:
@@ -181,7 +185,8 @@ def do_attach_debug_debugserver(self, command: str):
181185
gdbserver_cmd += ["--attach"]
182186
else: # debug/debugserver
183187
gdbserver_cmd += ["--initialize-reset"]
184-
gdb_args += ["-ex", f"load {elf_path}"]
188+
if self._load:
189+
gdb_args += ["-ex", f"load {elf_path}"]
185190

186191
if self._stlink_serial:
187192
gdbserver_cmd += ["--serial-number", self._stlink_serial]

0 commit comments

Comments
 (0)