@@ -90,7 +90,9 @@ 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 (
94+ commands = {"attach" , "debug" , "debugserver" }, dev_id = True , extload = True , debug_load = True
95+ )
9496
9597 @classmethod
9698 def extload_help (cls ) -> str :
@@ -128,6 +130,7 @@ def do_create(cls, cfg: RunnerConfig, args: argparse.Namespace) -> "STLinkGDBSer
128130 args .port_number ,
129131 args .extload ,
130132 args .external_init ,
133+ args .load ,
131134 )
132135
133136 def __init__ (
@@ -139,6 +142,7 @@ def __init__(
139142 gdb_port : int ,
140143 external_loader : str | None ,
141144 external_init : bool ,
145+ load : bool ,
142146 ):
143147 super ().__init__ (cfg )
144148 self .ensure_output ('elf' )
@@ -149,6 +153,7 @@ def __init__(
149153 self ._ap_id = ap_id
150154 self ._external_loader = external_loader
151155 self ._do_external_init = external_init
156+ self ._load = load
152157
153158 def do_run (self , command : str , ** kwargs ):
154159 if command in ["attach" , "debug" , "debugserver" ]:
@@ -181,7 +186,8 @@ def do_attach_debug_debugserver(self, command: str):
181186 gdbserver_cmd += ["--attach" ]
182187 else : # debug/debugserver
183188 gdbserver_cmd += ["--initialize-reset" ]
184- gdb_args += ["-ex" , f"load { elf_path } " ]
189+ if self ._load :
190+ gdb_args += ["-ex" , f"load { elf_path } " ]
185191
186192 if self ._stlink_serial :
187193 gdbserver_cmd += ["--serial-number" , self ._stlink_serial ]
0 commit comments