Skip to content

Commit 7bf00c9

Browse files
nandojvenashif
authored andcommitted
scripts: runners: openocd: Fix empty search path
When enable thread awareness feature for OpenOCD the search path was converted to a list. In some environments OPENOCD_DEFAULT_PATH may not be defined. That create an empty search path list system fails. This add a test to skips fill search_args with openocd_search values when list is empty. Fixes #38272. Signed-off-by: Gerson Fernando Budke <[email protected]>
1 parent 3ad2b06 commit 7bf00c9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/west_commands/runners/openocd.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ def __init__(self, cfg, pre_init=None, reset_halt_cmd=DEFAULT_OPENOCD_RESET_HALT
4747
search_args.append('-s')
4848
search_args.append(path.dirname(i))
4949

50-
for p in cfg.openocd_search:
51-
search_args.extend(['-s', p])
50+
if cfg.openocd_search is not None:
51+
for p in cfg.openocd_search:
52+
search_args.extend(['-s', p])
5253
self.openocd_cmd = [cfg.openocd] + search_args
5354
# openocd doesn't cope with Windows path names, so convert
5455
# them to POSIX style just to be sure.

0 commit comments

Comments
 (0)