File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 9
9
import time
10
10
import os
11
11
import re
12
+ import itertools
12
13
13
14
import targets
14
15
import testlib
@@ -904,6 +905,9 @@ class RepeatReadTest(DebugTest):
904
905
def early_applicable (self ):
905
906
return self .target .supports_clint_mtime
906
907
908
+ warning_re = re .compile (r"\[(?P<target_name>[^\]]+)\] Re-reading memory "
909
+ r"from addresses 0x(?P<addr>[\da-f]+) and 0x(?P=addr)\." )
910
+
907
911
def test (self ):
908
912
self .gdb .b ("main:start" )
909
913
self .gdb .c ()
@@ -912,8 +916,17 @@ def test(self):
912
916
output = self .gdb .command (
913
917
f"monitor riscv repeat_read { count } 0x{ mtime_addr :x} 4" )
914
918
values = []
915
- for line in output .splitlines ():
916
- # Ignore warnings
919
+ def is_valid_warning (line ):
920
+ match = self .warning_re .match (line )
921
+ if match is None :
922
+ return False
923
+ assertEqual (int (match ["addr" ], 16 ), mtime_addr ,
924
+ "The repeat read is reading from the wrong address" )
925
+ return True
926
+
927
+ for line in itertools .dropwhile (is_valid_warning , output .splitlines ()):
928
+ # This `if` is to be removed after
929
+ # https://github.com/riscv/riscv-openocd/pull/871 is merged.
917
930
if line .startswith ("Batch memory" ):
918
931
continue
919
932
for v in line .split ():
You can’t perform that action at this time.
0 commit comments