scripts: Add complete line to validation messages related to a single line
Any time breakpad symbol validation fails on a particular symbol file line,
add the complete line to the error message. This makes it easier to
debug issues without needing to find the symbol file (which may not get
uploaded) or reproduce the error.
BUG=b:270240549
TEST=Forced errors, examined output
TEST=unit tests
Change-Id: Ie2e41001761549b19cd474dbc9df88193afa9f3b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/4673853
Reviewed-by: Sergey Frolov <sfrolov@google.com>
Commit-Queue: Sergey Frolov <sfrolov@google.com>
Auto-Submit: Ian Barkley-Yeung <iby@chromium.org>
Tested-by: Ian Barkley-Yeung <iby@chromium.org>
diff --git a/scripts/cros_generate_breakpad_symbols.py b/scripts/cros_generate_breakpad_symbols.py
index ceae4fe..4a713a0 100644
--- a/scripts/cros_generate_breakpad_symbols.py
+++ b/scripts/cros_generate_breakpad_symbols.py
@@ -255,7 +255,7 @@
else:
raise ValueError(
f"{elf_file}: symbol file has unknown line type "
- f"{line_type}"
+ f"{line_type} (line='{line}')"
)
if expected_words_max is not None:
@@ -265,14 +265,15 @@
raise ValueError(
f"{elf_file}: symbol file has {line_type} line "
f"with {len(words)} words (expected "
- f"{expected_words_min} - {expected_words_max})"
+ f"{expected_words_min} - {expected_words_max}) "
+ f"(line='{line}')"
)
elif expected_words_min is not None:
if len(words) < expected_words_min:
raise ValueError(
f"{elf_file}: symbol file has {line_type} line "
f"with {len(words)} words (expected "
- f"{expected_words_min} or more)"
+ f"{expected_words_min} or more) (line='{line}')"
)