zoukankan      html  css  js  c++  java
  • gdbserver + gdb 远程调试

    主机为Linux,如Ubuntu; 目标机为arm-linux,如树莓派。

    主机安装samba服务后添加用户

    sudo smbpasswd -a chents

    目标机mount share dir

    sudo mount //192.168.111.19/chents_share chents_share -t cifs -o user=chents,pass=chenpwd,iocharset=utf8,uid=pi,gid=pi
    uid=pi,gid=pi 表示用户及组都是pi(则用户pi可读写)表示用户及组都是pi(则用户pi可读写)
    CIFS VFS: No username specified失败的原因 可能是要sudo apt-get install nfs-common

    sudo apt-get install nfs-kernel-server
    sudo mount -t nfs 192.168.199.101:/home/chen/workspace_robotos_x32 workspace_robotos_x32 -o nolock
    文件在主机上,编译要在目标机上

    目标机上启动程序

    gdbserver :2345 ./t -c <参数>

    主机编译支持arm-linux架构的gdb

    ./configure –host=x86_64-linux –target=arm-linux

    gdb-arm后带目标程序

    gdb-arm ./t
    set architecture i386:x86-64:intel
    add-symbol-file linux-3.0/vmlinux
    target remote 192.168.110.97:2345
    continue
    ctrl + c
    set solib-search-path .

    运行方式

    Manual Remote Debugging Launcher #开发版手动运行
    Automatic Remote Dubugging Launcher #自动运行

  • 相关阅读:
    Linux查看当前系统的发行版信息
    用 CentOS 7 打造合适的科研环境
    消息队列的使用场景
    RabbitMQ几种Exchange 模式
    JMS规范概览
    消息队列的学习
    springMVC参数传递实例
    java8时间处理实例
    windows电脑常用必备软件
    http后台json解析实例
  • 原文地址:https://www.cnblogs.com/qq575654643/p/11135448.html
Copyright © 2011-2022 走看看