Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 907906 - sys-devel/gdb cannot read shared libraries on SPARC64
Summary: sys-devel/gdb cannot read shared libraries on SPARC64
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: Sparc64 Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL: https://sourceware.org/bugzilla/show_...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-05 19:25 UTC by Matt Turner
Modified: 2023-07-06 17:15 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Turner gentoo-dev 2023-06-05 19:25:18 UTC
(64-bit chroot) catbus ~/build-id # cat t.c 
#include <stdio.h>

int main(void) {
        printf("hello world\n");
        return 0;
}
(64-bit chroot) catbus ~/build-id # gcc t.c -o t
(64-bit chroot) catbus ~/build-id # gdb -q t
Reading symbols from t...
(No debugging symbols found in t)
(gdb) start
Temporary breakpoint 1 at 0x7a4
Starting program: /root/build-id/t 

Temporary breakpoint 1, 0x00000100000007a4 in main ()
(gdb) info sharedlibrary
Cannot access memory at address 0xfff80001002011e0
Cannot access memory at address 0xfff80001002011d8
From                To                  Syms Read   Shared Object Library
0xfff80001000010a0  0xfff8000100021f80  Yes (*)     /lib64/ld-linux.so.2
(*): Shared library is missing debugging information.

The result is that trying to debug anything in a shared library is broken.

Things work fine on sparc32:

(32-bit chroot) catbus ~ # gdb -q t
Reading symbols from t...
(No debugging symbols found in t)
(gdb) start
Temporary breakpoint 1 at 0x5e4
Starting program: /root/t 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".

Temporary breakpoint 1, 0x700005e4 in main ()
(gdb) info sharedlibrary
From        To          Syms Read   Shared Object Library
0xf7fbcc40  0xf7fded80  Yes (*)     /lib/ld-linux.so.2
0xf7e02e00  0xf7f6a8c0  Yes (*)     /lib/libc.so.6
(*): Shared library is missing debugging information.
Comment 1 Matt Turner gentoo-dev 2023-07-05 14:47:26 UTC
Patch has now been sent for review: 
https://inbox.sourceware.org/gdb-patches/20230705134141.1441753-1-pedro@palves.net/T/#u
Comment 2 Larry the Git Cow gentoo-dev 2023-07-06 17:15:48 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e89cad361658a86b982a13ceec01514d36011ed0

commit e89cad361658a86b982a13ceec01514d36011ed0
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-07-06 17:15:17 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-07-06 17:15:38 +0000

    sys-devel/gdb: fix runtime debugging on sparc
    
    Closes: https://bugs.gentoo.org/907906
    Signed-off-by: Sam James <sam@gentoo.org>

 .../gdb/files/gdb-13.2-fix-sparc-debugging.patch   | 126 +++++++++
 sys-devel/gdb/gdb-13.2-r1.ebuild                   | 313 +++++++++++++++++++++
 2 files changed, 439 insertions(+)