Installing the old version of gdb

I have a problem with the latter gdb, so I want to use the older one. I found the gdbarchive here , but how can I compile / install one of them so that it can be used?

According to manual , first configure:

$ ./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
[...]
configure: creating ./config.status
config.status: creating Makefile

Then make:

$ make
make[1]: Entering directory '/root/Desktop/gdb-7.7'
Configuring in ./libiberty
configure: creating cache ./config.cache
checking whether to enable maintainer-specific portions of Makefiles... no
checking for makeinfo... /root/Desktop/gdb-7.7/missing makeinfo --split-size=5000000
[...]

But this leads to an error:

remote-utils.c:436:19: error: ‘hexchars’ defined but not used [-Werror=unused-const-variable=]
 static const char hexchars[] = "0123456789abcdef";
                   ^~~~~~~~
cc1: all warnings being treated as errors
Makefile:238: recipe for target 'remote-utils.o' failed
make[4]: *** [remote-utils.o] Error 1
make[4]: Leaving directory '/root/Desktop/gdb-7.7/gdb/gdbserver'
Makefile:1345: recipe for target 'subdir_do' failed
make[3]: *** [subdir_do] Error 1
make[3]: Leaving directory '/root/Desktop/gdb-7.7/gdb'
Makefile:1018: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/root/Desktop/gdb-7.7/gdb'
Makefile:8611: recipe for target 'all-gdb' failed
make[1]: *** [all-gdb] Error 2
make[1]: Leaving directory '/root/Desktop/gdb-7.7'
Makefile:832: recipe for target 'all' failed
make: *** [all] Error 2

The downgrade guide found here didn’t help either, since I always had "version not found" errors:

$ sudo apt-get install gdb="7.8.1"
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Version '7.8.1' for 'gdb' was not found
+4
source share
2 answers

You are trying to compile an older GDB using the new GCC.

, : GCC , GDB ( , GCC).

:

 ./configure 'CFLAGS=-w'

Makefile CFLAGS .

:

  • , ( 436 remote-utils.c ),
  • GCC "" GDB (, ).
+5

, , :

./configure --help | grep error

:

--enable-werror enable -Werror in bootstrap stage2 and later

, :

./configure --disable-werror

+1

Source: https://habr.com/ru/post/1666305/


All Articles