I'm having a problem with the latest gdb
so I want to use an older one. I found the gdb
archive here but how do I compile/install one of them so it can be used?
According to the 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 it results in 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 guide on downgrading programs found here also didn't help since I always got "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
You are trying to compile an older GDB using newer GCC.
This generally doesn't work: newer GCC enables new warnings, and GDB developers fix these warnings (usually before the new GCC version is actually released).
You should be able to disable these warnings with:
./configure 'CFLAGS=-w'
or by editing the generated Makefile and modifying the CFLAGS
there.
Other alternatives:
remote-utils.c
should do it), orYou can check error-related configure flags using this command:
./configure --help | grep error
there you should see:
--enable-werror enable -Werror in bootstrap stage2 and later
So you can disable treating warnings as errors:
./configure --disable-werror
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With