2017-01-09 2 views
4

최신 버전 gdb에 문제가있어 이전 버전을 사용하고 싶습니다. gdb 보관 파일 here을 찾았지만 어떻게 사용할 수 있습니까? 그 중 하나를 컴파일/설치하려면 어떻게합니까? manual에 따르면이전 버전의 gdb 설치

먼저 configure :

$ 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 
[...] 

하지만 오류가 발생합니다 : 다음 make

$ ./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 

remote-utils.c:436:19: error: ‘hexchars’ defined but not used [-Werror=unused-const-variable=] 
static const char hexchars[] = "abcdef"; 
        ^~~~~~~~ 
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 

는 다운 그레이드 프로그램에 대한 가이드는 here 발견 또한 도움이되지 않았다. 항상 "버전을 찾을 수 없음"오류가 발생했습니다 :

$ 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 

답변

5

최신 GCC를 사용하여 이전 GDB를 컴파일하려고합니다.

일반적으로 작동하지 않습니다. 새로운 GCC는 새로운 경고를 허용하고 GDB 개발자는 (일반적으로 새 GCC 버전이 실제로 출시되기 전에) 이러한 경고를 수정합니다.

당신은 이러한 경고를 해제 할 수 있어야한다 :

./configure 'CFLAGS=-w' 

또는 생성 된 Makefile을 편집하고 거기 CFLAGS을 수정하여

.

다른 대안 : 당신이 설치할 수 실제로 경고 (삭제 라인 remote-utils.c의 436을해야)을 생성하지 않도록 코드를 고칠 수

  • , 또는
  • 나이가 같은 "빈티지"의 GCC , 그리고 그것을 가진 GDB를 (아마도 가상 머신에서) 빌드하십시오.
1
이 명령을 사용하여 오류 관련 구성 플래그를 확인할 수 있습니다

:

./configure --help | grep error

당신이 볼 수 :

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

그래서 당신은 경고를 오류로 처리하지 않도록 설정할 수 있습니다 :

./configure --disable-werror