MIPS: Fix line info in compressed MIPS function
Patch corrects MIPS line number information for compressed functions, addressing an issue with DWARF debug info.
Maciej W. Rozycki points out an issue with a previous patch intended to fix line number information for MIPS compressed functions. While acknowledging the failure seen in addr2line output for specific addresses, Rozycki corrects the addresses used in the test case and clarifies that the binutils test framework does support addr2line checks. The original patch aimed to allow the first address of a MIPS16/microMIPS function to correctly retrieve filename/line information without needing the ISA bit set.
- proposer
Corrects test addresses and clarifies capabilities of the binutils test framework, while agreeing with the need to fix MIPS line number debug info for compressed functions.
“The addresses used here do not match those with the tests. I can see the failure though, true.”
In Details
This discussion concerns the accurate generation of DWARF debugging information for MIPS architecture, specifically for functions compiled using MIPS16 or microMIPS instruction sets, which use compressed instruction encodings. The issue is that the _bfd_mips_elf_find_nearest_line function, responsible for mapping code addresses to source lines, may fail for the entry point of such functions because the ISA bit is not set in the address. This prevents debuggers from correctly locating source line information for these functions. The discussion involves a correction to a previous patch and it…
- MIPS16
- A 16-bit instruction set extension for the MIPS architecture, designed to reduce code size.
- microMIPS
- A variant of the MIPS instruction set that uses a mix of 16-bit and 32-bit instructions, offering a balance between code density and performance.
- DWARF
- A standardized debugging data format used by many compilers to store information about variables, types, and code structure for debuggers.
- addr2line
- A command-line utility that translates object code addresses into line numbers and function names, used for debugging.
- ISA bit
- Instruction Set Architecture bit. In the context of MIPS compressed instructions, this bit in the address might indicate whether the instruction at that address is 16-bit (compressed) or 32-bit.