From 9e8a4c9f0e22667c34e29c1a3f2a106f54614d29 Mon Sep 17 00:00:00 2001 From: Afonso Oliveira Date: Fri, 15 Nov 2024 15:40:09 +0000 Subject: [PATCH] Bug fix on address mismatch Signed-off-by: Afonso Oliveira --- ext/binutils-gdb/encoding.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/ext/binutils-gdb/encoding.py b/ext/binutils-gdb/encoding.py index 14c43dd9e..76cecdf77 100644 --- a/ext/binutils-gdb/encoding.py +++ b/ext/binutils-gdb/encoding.py @@ -324,15 +324,13 @@ def main(): if success_encodings: for class_, encoding in success_encodings: - if success_encodings: - for class_, encoding in success_encodings: - # Simulate a mismatch by modifying the encoding - if True: # Always trigger the mismatch condition - mismatches_found = True - print(f"Error: Encoding mismatch for instruction '{name}' in YAML file '{yaml_file_path}'.") - print(f" YAML match : {yaml_encoding}") - print(f" Generated match: {encoding}\n") - sys.exit(1) # Exit immediately on first mismatch + # Actually compare the encodings + if yaml_encoding.replace(" ", "") != encoding.replace(" ", ""): + mismatches_found = True + print(f"Error: Encoding mismatch for instruction '{name}' in YAML file '{yaml_file_path}'.") + print(f" YAML match : {yaml_encoding}") + print(f" Generated match: {encoding}\n") + sys.exit(1) # Exit immediately on first mismatch else: # No valid definitions could be processed for this instruction print(f"Error: Could not evaluate any MATCH/MASK expressions for instruction '{name}' in YAML file '{yaml_file_path}'.\n")