zoukankan      html  css  js  c++  java
  • Mac配置Eclipse CDT的Debug出现的问题(转)

     

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

    原因:

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

    解决方法:

    1 安装gdb,

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

     

     

    问题2:出现 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. 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资料收藏

  • 相关阅读:
    [转载]c,c++及数据结构笔试题2(转)
    [转载]C,C++及数据结构笔试题1(转)
    C++指针详细解析
    [转载]转载一篇好文章:《海量数据处理常用思路和方法》
    [转载]c,c++及数据结构笔试题2(转)
    [转载]C++ 面试
    [转载]转载一篇好文章:《海量数据处理常用思路和方法》
    [转载]C,C++及数据结构笔试题1(转)
    BizTalk手动清除MessageBox数据库
    Linux中的时间和时间管理
  • 原文地址:https://www.cnblogs.com/it-tsz/p/9016776.html
Copyright © 2011-2022 走看看