From c56f50a2eb0fcfecd171071bb0f3087b7b738041 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Thu, 9 May 2024 12:56:01 +0200 Subject: [PATCH] dist/tools/bmp: fix target parsing Either GDB or pygdbmi changed behavior to trim off whitespace following the message, resulting in the `\\n` at the end of the regex no longer matching. This replaces the `\\n` with `\s*` to match both old and new output. Fixes: https://github.com/RIOT-OS/RIOT/issues/20604 --- dist/tools/bmp/bmp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/tools/bmp/bmp.py b/dist/tools/bmp/bmp.py index 81dce765d6..cb3013cf23 100755 --- a/dist/tools/bmp/bmp.py +++ b/dist/tools/bmp/bmp.py @@ -85,7 +85,7 @@ def detect_targets(gdbmi, res): while True: for msg in res: if msg['type'] == 'target': - m = re.fullmatch(pattern=r"\s*(\d)+\s*(.*)\\n", string=msg['payload']) + m = re.fullmatch(pattern=r"\s*(\d+)\s*(.*)\s*", string=msg['payload']) if m: targets.append(m.group(2)) elif msg['type'] == 'result':