Mac配置Eclipse CDT的Debug出现的问题(转)

 

问题1:出现 Could not determine GDB version using command: gdb --versionjava

缘由:c++

mac上没有安装gdb或者gdb位置配置有问题web

解决方法:算法

1 安装gdb,shell

2 若是肯定已经安装了gdb,须要配置Eclipse中Debuger的路径:项目右键-》Debug As-》Debug Configurations-》左侧C++ Application找到当前项目-》右侧标签页选择Debuger-》修改gdb的路径和.gdbinit文件路径编程

 

 

问题2:出现 Could not determine GDB version using command: gdb --versionsegmentfault

[plain] view plain copy数据结构

 

 

  1. Error in final launch sequence    
  2. Failed to execute MI command:    
  3. -exec-run    
  4. Error message from debugger back end:    
  5. Unable to find Mach task port for process-id 99177: (os/kern) failure (0x5).    
  6.  (please check gdb is codesigned - see taskgated(8))    
  7. Unable to find Mach task port for process-id 99177: (os/kern) failure (0x5).    
  8.  (please check gdb is codesigned - see taskgated(8))    

 

缘由:机器学习

gdb没有签名学习

解决方法:

1 具体步骤参考:https://segmentfault.com/q/1010000004136334

2 若是出现系统证书建立失败的问题参照:http://blog.csdn.net/lllkey/article/details/79423596

 

问题3:出现 Could not determine GDB version using command: gdb --version

[plain] view plain copy

 

 

  1. Error in final launch sequence  
  2. Failed to execute MI command:  
  3. -exec-run  
  4. Error message from debugger back end:  
  5. During startup program terminated with signal ?, Unknown signal.  
  6. During startup program terminated with signal ?, Unknown signal.  

 

缘由:

mac osx某个版本以后会出现的问题,修改.gdbinit文件的配置能够解决

解决方法:

1 参考:https://stackoverflow.com/questions/40052171/gdb-terminated-with-signal-unknown-signal

在home目录或者gdb的目录下建立文件:.gdbinit (个人gdb的路径为:/usr/local/Cellar/gdb/8.1/bin),只要以后再Eclipse中配置相应路径便可

[plain] view plain copy

 

 

  1. echo "set startup-with-shell off" >> ~/.gdbinit  

从新开一个terminal 或者 在Eclipse下再debug便可

 

问题4:出现 Could not determine GDB version using command: gdb --version

[plain] view plain copy

 

 

  1. Error in final launch sequence  
  2. Failed to execute MI command:  
  3. -exec-run  
  4. Error message from debugger back end:  
  5. During startup program terminated with signal SIGTRAP, Trace/breakpoint trap.  
  6. During startup program terminated with signal SIGTRAP, Trace/breakpoint trap.  

 

缘由:

gdb8.1版本的某些问题,须要降到某版本,我如今尝试gdb8.0.1是能够调试的

解决方法:

1 参考:https://www.jianshu.com/p/b546a47b6b75 

从这个文章来看gdb8.1并不适配如今的os,因此须要回退到gdb8.0.1

使用brew更换版本失败,因为其中须要用到

brew versions gdb

可是返回:

Error: Unknown command: versions

2 8.0.1下载地址:https://ftp.gnu.org/gnu/gdb/gdb-8.0.1.tar.xz

开始编译安装gdb:

解压:

[plain] view plain copy

 

 

  1. tar -Jxvf /Users/lsq/Movies/thunder/gdb-8.0.1.tar.xz   

编译安装:

[plain] view plain copy

 

 

  1. ./configure --prefix=/usr/local  
  2. make  
  3. make -C gdb install  

签名gdb:

[plain] view plain copy

 

 

  1. codesign -fs gdb_codesign $(which gdb)  

配置:

[plain] view plain copy

 

 

  1. echo "set startup-with-shell off" >> ~/.gdbinit  

若是使用Eclipse调试:修改Debuger中gdb和.gdbinit的位置(参考问题1)


经常使用软件开发学习资料目录:  

1.经典编程电子书收藏  

2.C&C++编程学习资料收藏   

3.算法及数据结构(有关c,c++,java)   

4.Java开发学习资料收藏      

5.Android开发学习资料收藏  

6.Python开发学习资料收藏  

7.大数据,机器学习,人工智能资料收藏

8.Docker资料收藏

相关文章
相关标签/搜索