I'm debugging a problem of a Xorg DDX. I recompiled xorg-server-1.12 with CFLAGS="-g3 -ggdb -O0 -Wa,-mfix-loongson2f-nop -pipe -fstack-protector-all -Wstack-protector --param ssp-buffer-size=4 -D_FORTIFY_SOURCE=2" FEATURES="nostrip" and trying to attach gdb to a runnning X server: $ gdb /usr/bin/Xorg $(pidof Xorg) GNU gdb (Gentoo 7.8 vanilla) 7.8 Copyright (C) 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> 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 "mips64el-unknown-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://bugs.gentoo.org/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from /usr/bin/Xorg...done. Attaching to program: /usr/bin/Xorg, process 15494 Reading symbols from /usr/local/lib/memcpy_loongson2f.so...(no debugging symbols found)...done. Loaded symbols for /usr/local/lib/memcpy_loongson2f.so Reading symbols from /usr/lib32/libudev.so.1...(no debugging symbols found)...done. Loaded symbols for /usr/lib32/libudev.so.1 Reading symbols from /usr/lib32/libgcrypt.so.20...(no debugging symbols found)...done. Loaded symbols for /usr/lib32/libgcrypt.so.20 Reading symbols from /lib32/libdl.so.2...Reading symbols from /usr/lib/debug//lib32/libdl-2.19.so.debug...(no debugging symbols found)...done. (no debugging symbols found)...done. Loaded symbols for /lib32/libdl.so.2 Reading symbols from /usr/lib32/libpciaccess.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib32/libpciaccess.so.0 Reading symbols from /lib32/libpthread.so.0...Reading symbols from /usr/lib/debug//lib32/libpthread-2.19.so.debug...(no debugging symbols found)...done. (no debugging symbols found)...done. [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib32/libthread_db.so.1". Loaded symbols for /lib32/libpthread.so.0 Reading symbols from /usr/lib32/libpixman-1.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib32/libpixman-1.so.0 Reading symbols from /usr/lib32/libXfont.so.1...(no debugging symbols found)...done. Loaded symbols for /usr/lib32/libXfont.so.1 Reading symbols from /usr/lib32/libXau.so.6...(no debugging symbols found)...done. Loaded symbols for /usr/lib32/libXau.so.6 Reading symbols from /usr/lib32/libXdmcp.so.6...(no debugging symbols found)...done. Loaded symbols for /usr/lib32/libXdmcp.so.6 Reading symbols from /lib32/libm.so.6...Reading symbols from /usr/lib/debug//lib32/libm-2.19.so.debug...(no debugging symbols found)...done. (no debugging symbols found)...done. Loaded symbols for /lib32/libm.so.6 Reading symbols from /lib32/libc.so.6...Reading symbols from /usr/lib/debug//lib32/libc-2.19.so.debug...(no debugging symbols found)...done. (no debugging symbols found)...done. Loaded symbols for /lib32/libc.so.6 Reading symbols from /lib32/ld.so.1...Reading symbols from /usr/lib/debug//lib32/ld-2.19.so.debug...(no debugging symbols found)...done. (no debugging symbols found)...done. Loaded symbols for /lib32/ld.so.1 Reading symbols from /lib32/librt.so.1...Reading symbols from /usr/lib/debug//lib32/librt-2.19.so.debug...(no debugging symbols found)...done. (no debugging symbols found)...done. Loaded symbols for /lib32/librt.so.1 Reading symbols from /usr/lib32/libgpg-error.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib32/libgpg-error.so.0 Reading symbols from /lib32/libz.so.1...(no debugging symbols found)...done. Loaded symbols for /lib32/libz.so.1 Reading symbols from /lib32/libbz2.so.1...(no debugging symbols found)...done. Loaded symbols for /lib32/libbz2.so.1 Reading symbols from /usr/lib32/libfontenc.so.1...(no debugging symbols found)...done. Loaded symbols for /usr/lib32/libfontenc.so.1 Reading symbols from /usr/lib/gcc/mips64el-unknown-linux-gnu/4.8.3/libgcc_s.so.1...(no debugging symbols found)...done. Loaded symbols for /usr/lib/gcc/mips64el-unknown-linux-gnu/4.8.3/libgcc_s.so.1 Reading symbols from /usr/lib32/xorg/modules/libexa.so...done. Loaded symbols for /usr/lib32/xorg/modules/libexa.so Reading symbols from /usr/lib32/xorg/modules/libint10.so...done. Loaded symbols for /usr/lib32/xorg/modules/libint10.so Reading symbols from /usr/lib32/xorg/modules/libvgahw.so...done. Loaded symbols for /usr/lib32/xorg/modules/libvgahw.so Reading symbols from /usr/lib32/xorg/modules/libxaa.so...done. Loaded symbols for /usr/lib32/xorg/modules/libxaa.so Reading symbols from /usr/lib32/xorg/modules/input/evdev_drv.so...(no debugging symbols found)...done. Loaded symbols for /usr/lib32/xorg/modules/input/evdev_drv.so Reading symbols from /usr/lib32/libmtdev.so.1...(no debugging symbols found)...done. Loaded symbols for /usr/lib32/libmtdev.so.1 Reading symbols from /usr/lib32/xorg/modules/extensions/libextmod.so...done. Loaded symbols for /usr/lib32/xorg/modules/extensions/libextmod.so Reading symbols from /usr/lib32/xorg/modules/extensions/libdbe.so...done. Loaded symbols for /usr/lib32/xorg/modules/extensions/libdbe.so Reading symbols from /usr/lib32/xorg/modules/drivers/siliconmotion_drv.so...done. Loaded symbols for /usr/lib32/xorg/modules/drivers/siliconmotion_drv.so Reading symbols from /usr/lib32/xorg/modules/libfb.so...done. Loaded symbols for /usr/lib32/xorg/modules/libfb.so findvar.c:773: internal-error: address_from_register: Assertion `!gdbarch_convert_register_p (gdbarch, regnum, type)' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) y This is a bug, please report it. For instructions, see: <http://bugs.gentoo.org/>. findvar.c:773: internal-error: address_from_register: Assertion `!gdbarch_convert_register_p (gdbarch, regnum, type)' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Create a core file of GDB? (y or n) y Aborted (core dumped) Reproducible: Always Steps to Reproduce: 1. Compiled x11-base/xorg-server-1.12.4-r2 and all x11 modules with CFLAGS="-g3 -ggdb -O0 -Wa,-mfix-loongson2f-nop -pipe -fstack-protector-all -Wstack-protector --param ssp-buffer-size=4 -D_FORTIFY_SOURCE=2" FEATURES="nostrip" 2. $ Xorg # start a X server. 3. $ gdb /usr/bin/Xorg $(pidof Xorg) # attach gdb to the running X server. Actual Results: Reading symbols from /usr/lib32/xorg/modules/libfb.so...done. Loaded symbols for /usr/lib32/xorg/modules/libfb.so findvar.c:773: internal-error: address_from_register: Assertion `!gdbarch_convert_register_p (gdbarch, regnum, type)' failed. Expected Results: gdb should resolve the debug symbols successful. $ emerge -pv gdb [ebuild R ] sys-devel/gdb-7.8 USE="client nls python server zlib -expat -lzma -multitarget {-test} -vanilla" PYTHON_SINGLE_TARGET="python2_7 -python3_3 -python3_4" PYTHON_TARGETS="python2_7 python3_3 -python3_4" 0 KiB $ emerge -pv xorg-server [ebuild R ] x11-base/xorg-server-1.12.4-r2:0/1.12.4 USE="minimal nptl udev xorg -dmx -doc -ipv6 -kdrive (-selinux) -static-libs -tslib -xnest -xvfb" 0 KiB
And it is my first time to use -g3 -ggdb on this platform. I just use -g before. I'll recompile and test to confirm whether -ggdb is buggy or not.
Created attachment 382870 [details] emerge --info
-g3 -ggdb isn't the problem. Downgrading to gdb-7.7 and the issue not longer represents. A git bisect is needed.
my guess is the mips part is what makes this a bit flakier. i'm not sure i have suggestions other than doing a bisect as you noted. upstream repo: git://sourceware.org/git/binutils-gdb.git upstream bug tracker if you want to try that too: https://sourceware.org/bugzilla/enter_bug.cgi?product=gdb
Mild curiosity, is -g3 -ggdb equivalent to -ggdb3?
(In reply to Joshua Kinard from comment #5) the upstream documentation seems to indicate that is the case: https://gcc.gnu.org/onlinedocs/gcc-4.9.1/gcc/Debugging-Options.html
This one corresponds to upstream bug https://sourceware.org/bugzilla/show_bug.cgi?id=17316 which has been fixed meanwhile. While I don't know the exact release in which it is fixed, I can confirm that I saw this problem (outside of gentoo context; on an embedded target) on MIPS64/n32 with gdb 7.8.2 and that the problem disappeared with gdb 7.9. According to me, this bug should be closed.
thanks for the heads up