У нас есть приложение, скомпилированное с последней версией gcc (g++-7.2). К сожалению, рабочий сервер довольно старый и имеет очень старую версию gdb (6.5.25-el5rh)
Отлаживать программное обеспечение на месте сложно, так как gdb
не показывает трассировку с файлом ядра. Открытие основного файла с помощью gdb приводит к этому сообщению:
GNU gdb Red Hat Linux (6.5-25.el5rh)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".
warning: Can't read pathname for load map: Erreur d'entrée/sortie.
[...]
Reading symbols from /lib/libcrypt.so.1...done.
Loaded symbols for /lib/libcrypt.so.1
Reading symbols from /lib/libnss_files.so.2...done.
Loaded symbols for /lib/libnss_files.so.2
Core was generated by `[binary_filename]'.
Program terminated with signal 11, Segmentation fault.
Die: DW_TAG_unspecified_type (abbrev = 218, offset = 2719370)
has children: FALSE
attributes:
DW_AT_name (DW_FORM_strp) string: "decltype(nullptr)"
Dwarf Error: Cannot find type of die [in module [path_to_binary]]
Я нашел на http://wiki.dwarfstd.org/index.php?title=C%2B%2B0x:_Null_pointer, что nullptr
можно преобразовать в DW_TAG_unspecified_type
.
Является ли nullptr
проблемой этой старой версии gdb? Можно ли попросить gcc не генерировать информацию о карликах для nullptr?
Точность:
- Мы не можем ни обновить версию gdb, ни развернуть собственную версию gdb.
- Мы зависим от наличия последней версии gcc (>= C++11), поэтому понижение версии gcc нежелательно.
[local_installation]/generated/bin/g++ -v
:
COLLECT_GCC=./g++
COLLECT_LTO_WRAPPER=[local_installation]/generated/libexec/gcc/i686-pc-linux-gnu/7.2.0/lto-wrapper
Cible : i686-pc-linux-gnu
Configuré avec: [local_installation]/gcc-7.2.0/configure --prefix=[local_installation]/generated --disable-multilib --disable-libstdcxx-dual-abi --with-dwarf2 --enable-cxx-flags=-gdwarf-2
Modèle de thread: posix
gcc version 7.2.0 (GCC)
CXXFLAGS
:
-pipe -fpermissive -Wshadow -Wextra -Wundef -Wno-deprecated-declarations -std=gnu++17 -D_GLIBCXX_USE_CXX11_ABI=0 -gdwarf-2 -gstrict-dwarf $(INCLUDES) -O2 -Wall -W -D_REENTRANT $(DEFINES)
С уважением
gdbserver
? - person ams   schedule 08.12.2017