On 27 July 2015 at 11:03, Avi Kivity wrote: > > > On 07/27/2015 12:44 PM, Jonathan Wakely wrote: >> >> On 27 July 2015 at 09:54, Avi Kivity wrote: >>> >>> I realize this is a lot of work, but as it is, debugging modern C++ >>> programs >>> is quite a headache with g++/gdb. gdb won't even load binaries compiled >>> with -O0, >> >> Why not? > > > It segfaults on symbols it cannot demangle: > > $ gdb build/debug/apps/httpd/httpd > GNU gdb (GDB) Fedora 7.8.2-39.fc21 > 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 "x86_64-redhat-linux-gnu". > Type "show configuration" for configuration details. > For bug reporting instructions, please see: > <http://www.gnu.org/software/gdb/bugs/>. > 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 build/debug/apps/httpd/httpd...Segmentation fault (core > dumped) > > https://sourceware.org/bugzilla/show_bug.cgi?id=17455 OK so that's a crash on a specific mangled symbol, not a general problem with debugging -O0 binaries.