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:
clang -c -target mipsel-unknown -mno-abicalls -gdwarf-2 simple_main.c
/opt/microchip/xc32/v4.50/bin/xc32-ld simple_main.o

Mixing a file build with clang and GCC results in the file build with GCC,
exhibiting this behaviour, while investigating in GDB.
(Linking them together with xc32-ld)

Stripping the ".debug_aranges" section, allows for proper display:
/opt/microchip/xc32/v4.50/bin/xc32-objcopy --remove-section .debug_aranges 
simple_main.o simple_main_trunc.o

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to gdb in Ubuntu.
https://bugs.launchpad.net/bugs/2106811

Title:
  Line info missing on multiarch build with MIPS

Status in gdb package in Ubuntu:
  New

Bug description:
  Version: GNU gdb (Ubuntu 15.0.50.20240403-0ubuntu1) 15.0.50.20240403-git
  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/xc32/v4.50/bin/xc32-c++ -nostartfiles -nostdlib -g 
simple_main.c

  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>.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gdb/+bug/2106811/+subscriptions


-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to