Line info missing on multiarch build with MIPS
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gdb (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Version: GNU gdb (Ubuntu 15.0.50.
File: ELF 32-bit LSB executable, MIPS, MIPS32 rel2 version 1 (SYSV), statically linked, with debug_info, not stripped
Compiler used to create test file: gcc version 8.3.1 (Microchip XC32 Compiler v4.50)
While using gdb-multiarch with a MIPS ELF, created by Microchip's GCC fork (xc32),
line info only becomes available after having disassembled the function by function name.
(Address only won't work even though it correctly gets the scope of the function).
Line info however is already available with "normal" gdb.
Steps to reproduce:
Build a simple executable:
/opt/microchip/
Open file with gdb-multiarch:
gdb-multiarch ./a.out
Attempt to print line info:
info line *0x9d000020
Notice it doesn't work:
No line number information available for address 0x9d000020 <main+32>
Attempt to print line info by name:
info line main
See it works.
Reattempt to print line info by address:
Suddendly now it works.
GDB example output:
(gdb) info line *0x9d000020
No line number information available for address 0x9d000020 <main+32>
(gdb) info line main
Line 2 of "simple_main.c" starts at address 0x9d000000 <main(int, char**)> and ends at 0x9d000014 <main(int, char**)+20>.
(gdb) info line *0x9d000020
Line 5 of "simple_main.c" starts at address 0x9d000020 <main(int, char**)+32> and ends at 0x9d00002c <main(int, char**)+44>.
This problem does not occur, when manually using ld.lld,
It does occur with xc32-ld.
Neither does it occur when building the file using clang: xc32/v4. 50/bin/ xc32-ld simple_main.o
clang -c -target mipsel-unknown -mno-abicalls -gdwarf-2 simple_main.c
/opt/microchip/
Mixing a file built with clang and GCC, results only in the file built with GCC
exhibiting this behaviour (while investigating in GDB).
(Linking them together with xc32-ld)
Stripping the ".debug_aranges" section, allows for proper display: xc32/v4. 50/bin/ xc32-objcopy --remove-section .debug_aranges simple_main.o simple_main_trunc.o
/opt/microchip/