binutils: testsuite: Fix addr2line test cases on Windows
Patch fixes addr2line test cases on Windows by addressing path format differences and GCC's symbol naming conventions.
Jan Dubiec submits a patch to fix failing addr2line test cases on Windows within the Binutils test suite. The failures stem from two main issues: 1) nm on Windows uses DOS-style paths (e.g., C:/), while the test suite expects UNIX-style paths, and 2) certain GCC targets (like h8300-*-elf) prepend an underscore to symbol names, which the tests did not account for. The patch modifies the addr2line.exp test script to handle these platform-specific differences.
- proposer
Submits a patch to correct `addr2line` test cases on Windows by handling path formats and GCC symbol naming.
“The following two test cases fail on Windows: [...] FAIL: addr2line FAIL: addr2line -f option ...”
In Details
This patch addresses cross-platform testing issues within the Binutils test suite, specifically for the addr2line utility when run on Windows. The core problems are: 1) Path canonicalization differences between native Windows paths (drive letters) and the UNIX-like paths often used in build environments like MSYS/MinGW, and 2) Target-specific symbol mangling, exemplified by the h8300-*-elf target which prepends an underscore to symbols. The patch modifies the addr2line.exp test script to dynamically adjust for these variations, ensuring test reliability across different environments.
- addr2line
- A command-line utility that translates addresses into line numbers and function names, useful for debugging.
- Test suite
- A collection of tests designed to verify the correctness of a software program.
- Windows
- Microsoft's proprietary graphical operating system.
- MSYS/MinGW
- Environments providing a POSIX-like shell and development tools on Windows, often used for compiling software originally developed for Unix-like systems.
- Symbol naming
- The process by which compilers and linkers generate names for functions, variables, and other entities. Different targets or compiler versions may use different naming conventions (mangling).