bug#63047: Can't load glib debug symbols in gdb

2023-09-13 Thread Andrew Tropin
On 2023-04-25 08:38, Maxim Cournoyer wrote:

> Hi Andrew,
>
> Josselin Poiret via Bug reports for GNU Guix  writes:
>
>> Hi Andrew,
>>
>> Andrew Tropin  writes:
>>
>>> I try to run emacs in gdb with debug symbols for some libs available, I
>>> succeed with gtk+, but it doesn't work for glib and glibc.  It looks
>>> strange to me, but maybe I am doing something wrong.
>>>
>>> Reproducer:
>>>
>>> guix shell gdb emacs-next-pgtk glibc:debug gtk+:debug glib:debug \
>>>  --with-debug-info=glibc --with-debug-info=glib --with-debug-info=gtk+ \
>>>  --no-grafts -- gdb .emacs-30.0.50-real
>>
>> At least for glibc, the glibc that is linked against is the one in (gnu
>> packages commencement), which is hidden from the user.  The one in (gnu
>> packages base), which you can refer to with "glibc" is different.  You
>> can try to find the proper debug output by looking at `guix size` of
>> your store path, then finding out the deriver for glibc with `guix gc
>> --derivers` and finally looking at the .drv to find out what the debug
>> output should be.
>>
>> For glib, it might be similar, make sure that you're using exactly the
>> right store path for it.
>
> Perhaps try on the core-updates branch, where glibc no longer has its
> symbols stripped.  Another thing that can cause the debug symbols to not
> be found is grafts, as described in #48907, so when debugging I'd
> recommend using --no-grafts for now.

Thank you for the tips.

For future readers: the core-updates merged, it should be fixed, however,
I didn't check if it works now.

Closing the issue, but feel free to reopen.

-- 
Best regards,
Andrew Tropin


signature.asc
Description: PGP signature


bug#63047: Can't load glib debug symbols in gdb

2023-04-25 Thread Maxim Cournoyer
Hi Andrew,

Josselin Poiret via Bug reports for GNU Guix  writes:

> Hi Andrew,
>
> Andrew Tropin  writes:
>
>> I try to run emacs in gdb with debug symbols for some libs available, I
>> succeed with gtk+, but it doesn't work for glib and glibc.  It looks
>> strange to me, but maybe I am doing something wrong.
>>
>> Reproducer:
>>
>> guix shell gdb emacs-next-pgtk glibc:debug gtk+:debug glib:debug \
>>  --with-debug-info=glibc --with-debug-info=glib --with-debug-info=gtk+ \
>>  --no-grafts -- gdb .emacs-30.0.50-real
>
> At least for glibc, the glibc that is linked against is the one in (gnu
> packages commencement), which is hidden from the user.  The one in (gnu
> packages base), which you can refer to with "glibc" is different.  You
> can try to find the proper debug output by looking at `guix size` of
> your store path, then finding out the deriver for glibc with `guix gc
> --derivers` and finally looking at the .drv to find out what the debug
> output should be.
>
> For glib, it might be similar, make sure that you're using exactly the
> right store path for it.

Perhaps try on the core-updates branch, where glibc no longer has its
symbols stripped.  Another thing that can cause the debug symbols to not
be found is grafts, as described in #48907, so when debugging I'd
recommend using --no-grafts for now.

-- 
Thanks,
Maxim





bug#63047: Can't load glib debug symbols in gdb

2023-04-24 Thread Josselin Poiret via Bug reports for GNU Guix
Hi Andrew,

Andrew Tropin  writes:

> I try to run emacs in gdb with debug symbols for some libs available, I
> succeed with gtk+, but it doesn't work for glib and glibc.  It looks
> strange to me, but maybe I am doing something wrong.
>
> Reproducer:
>
> guix shell gdb emacs-next-pgtk glibc:debug gtk+:debug glib:debug \
>  --with-debug-info=glibc --with-debug-info=glib --with-debug-info=gtk+ \
>  --no-grafts -- gdb .emacs-30.0.50-real

At least for glibc, the glibc that is linked against is the one in (gnu
packages commencement), which is hidden from the user.  The one in (gnu
packages base), which you can refer to with "glibc" is different.  You
can try to find the proper debug output by looking at `guix size` of
your store path, then finding out the deriver for glibc with `guix gc
--derivers` and finally looking at the .drv to find out what the debug
output should be.

For glib, it might be similar, make sure that you're using exactly the
right store path for it.

Best,
-- 
Josselin Poiret


signature.asc
Description: PGP signature


bug#63047: Can't load glib debug symbols in gdb

2023-04-24 Thread Andrew Tropin
I try to run emacs in gdb with debug symbols for some libs available, I
succeed with gtk+, but it doesn't work for glib and glibc.  It looks
strange to me, but maybe I am doing something wrong.

Reproducer:

guix shell gdb emacs-next-pgtk glibc:debug gtk+:debug glib:debug \
 --with-debug-info=glibc --with-debug-info=glib --with-debug-info=gtk+ \
 --no-grafts -- gdb .emacs-30.0.50-real

--8<---cut here---start->8---
GNU gdb (GDB) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from .emacs-30.0.50-real...
(No debugging symbols found in .emacs-30.0.50-real)
(gdb) run -q
Starting program: 
/gnu/store/g59lvzvhbai1dcrbckaw4qvf4amxyfa2-profile/bin/.emacs-30.0.50-real -q
warning: Unable to find libthread_db matching inferior's thread library, thread 
debugging will not be available.
[New LWP 14944]
[New LWP 14945]
[New LWP 14946]
Gdk-Message: 11:19:32.820: Unable to load sb_v_double_arrow from the cursor 
theme
Gdk-Message: 11:19:32.820: Unable to load sb_h_double_arrow from the cursor 
theme
Gdk-Message: 11:19:32.838: Unable to load hand2 from the cursor theme
Gdk-Message: 11:19:32.838: Unable to load sb_h_double_arrow from the cursor 
theme
Gdk-Message: 11:19:32.838: Unable to load sb_v_double_arrow from the cursor 
theme
[New LWP 14947]
[LWP 14947 exited]
[New LWP 14948]
[New LWP 14949]
[LWP 14948 exited]
[LWP 14949 exited]
[New LWP 14950]
[New LWP 14951]
[LWP 14950 exited]
[LWP 14951 exited]
^Z
Thread 1 ".emacs-30.0.50-" received signal SIGTSTP, Stopped (user).
0x73def17b in pselect () from 
/gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libc.so.6
(gdb) info dll
FromTo  Syms Read   Shared Object Library
0x77fcf050  0x77ff15ee  Yes (*) 
/gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/ld-linux-x86-64.so.2
0x7769c070  0x779e9936  Yes 
/gnu/store/whgbkfyggc3ljkh7y9wqwvqgnsnnyf7w-gtk+-3.24.30/lib/libgtk-3.so.0
0x77ee6190  0x77f5efdd  Yes 
/gnu/store/whgbkfyggc3ljkh7y9wqwvqgnsnnyf7w-gtk+-3.24.30/lib/libgdk-3.so.0
0x77ea9b20  0x77eaf8c0  Yes (*) 
/gnu/store/vk23fcm4livzrnb3kzhxs6yjds8f355c-pango-1.48.10/lib/libpangocairo-1.0.so.0
0x77e61c80  0x77e8711e  Yes (*) 
/gnu/store/vk23fcm4livzrnb3kzhxs6yjds8f355c-pango-1.48.10/lib/libpango-1.0.so.0
0x7751fec0  0x775c462e  Yes (*) 
/gnu/store/f6ibajh7x233cvr30c2p314l2absk36h-harfbuzz-2.8.2/lib/libharfbuzz.so.0
0x77e316b0  0x77e3ed44  Yes (*) 
/gnu/store/np9pryvn0rxc00cc6g4jd7rlcxwk2mxs-atk-2.36.0/lib/libatk-1.0.so.0
0x7750d0a0  0x7750e20d  Yes (*) 
/gnu/store/6gq2n65ixpn6drd5wai2h7g5wjm6bp2b-cairo-1.16.0/lib/libcairo-gobject.so.2
0x773fc680  0x774c3a97  Yes (*) 
/gnu/store/6gq2n65ixpn6drd5wai2h7g5wjm6bp2b-cairo-1.16.0/lib/libcairo.so.2
0x773c9b50  0x773dccde  Yes (*) 
/gnu/store/xgiz9rvzvfhwx655lb6jpjx1whc4kjg8-gdk-pixbuf-2.42.4/lib/libgdk_pixbuf-2.0.so.0
0x7721e980  0x773267e6  Yes (*) 
/gnu/store/96srhmpmxa20wmsck95g3iq4hb3lz4a0-glib-2.70.2/lib/libgio-2.0.so.0
0x77191760  0x771be826  Yes (*) 
/gnu/store/96srhmpmxa20wmsck95g3iq4hb3lz4a0-glib-2.70.2/lib/libgobject-2.0.so.0
0x7706ed40  0x770f4a7e  Yes (*) 
/gnu/store/96srhmpmxa20wmsck95g3iq4hb3lz4a0-glib-2.70.2/lib/libglib-2.0.so.0
0x76fd5dc0  0x77018105  Yes (*) 
/gnu/store/343iqv9hvbvzp2in0hs03dvygccrcapl-libtiff-4.3.0/lib/libtiff.so.5
0x76f39500  0x76f8e0c5  Yes (*) 
/gnu/store/g5hf1zhqlcyx9vw3q1xa52bgddaqsfm5-libjpeg-turbo-2.0.5/lib/libjpeg.so.62
0x76f05900  0x76f2739a  Yes (*) 
/gnu/store/p7iq81hxxyk9zy7a9dngbf16zm8d4klx-libpng-1.6.37/lib/libpng16.so.16
0x76ee52f0  0x76ef5cc4  Yes (*) 
/gnu/store/8qv5kb2fgm4c3bf70zcg9l6hkf3qzpw9-zlib-1.2.11/lib/libz.so.1
0x76ed9390  0x76edd58b  Yes (*) 
/gnu/store/4d0ssibbd2glk1vc93zj738awmy22xad-giflib-5.2.1/lib/libgif.so.7
0x76e0fcc0  0x76e93bd6  Yes (*) 
/gnu/store/nfxcjvv9c2q6in9x52kkkayqv38k00ai-alsa-lib-1.2.4/lib/libasound.so.2
0x76512070  0x76a2df5c  Yes (*)