From 1d6b1c31fc7040d4d5b7a37a232de2e4cb7afb63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominic=20H=C3=B6glinger?= Date: Thu, 15 May 2025 23:17:40 +0200 Subject: [PATCH] st_record.py: Fix signal detection and stdin read for TUI mode --- st_record.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/st_record.py b/st_record.py index b2658ba..3bb0884 100644 --- a/st_record.py +++ b/st_record.py @@ -149,11 +149,11 @@ def fastlz_decompress_lv1(datain, doutlen): return bytes(dataout[:dataout_idx]) def scan_for_signals(directory, predefined_signals): - library_files = ['pet.c', 'pet.h'] - rx_events = re.compile(r'pet_evtrace\(\"([^\"]+)\"') - rx_scalars = re.compile(r'pet_([usf])(8|16|32)trace\(\"([^\"]+)\"') - rx_arrays = re.compile(r'pet_a([us])(8|16|32)trace\(\"([^\"]+)\"\,\s*[^,]+,\s*((?:0x)?[a-zA-Z0-9]+)') - rx_strings = re.compile(r'pet_strtrace\(\"([^\"]+)\"') + library_files = ['st.c', 'st.h'] + rx_events = re.compile(r'st_evtrace\(\"([^\"]+)\"') + rx_scalars = re.compile(r'st_([usf])(8|16|32)trace\(\"([^\"]+)\"') + rx_arrays = re.compile(r'st_a([us])(8|16|32)trace\(\"([^\"]+)\"\,\s*[^,]+,\s*((?:0x)?[a-zA-Z0-9]+)') + rx_strings = re.compile(r'st_strtrace\(\"([^\"]+)\"') signals = {} valid = True @@ -657,8 +657,8 @@ def tui_record(packet_filter, vcd_sink, enable_verbose_trace): packet_filter.onnoise(noise_buffer.add) try: - while True: - for b in sys.stdin.buffer.read(1): + for bstr in sys.stdin.buffer: + for b in bstr: packet_filter.process(b) live_status.update(diag_progress) except KeyboardInterrupt: