1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

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
This commit is contained in:
Marian Buschsieweke 2024-05-09 12:56:01 +02:00
parent 9614813ba7
commit c56f50a2eb
No known key found for this signature in database
GPG Key ID: 77AA882EC78084E6

View File

@ -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':