当前位置: 首页 > news >正文

四海网络网站建设建设施工组织设计方案网站

四海网络网站建设,建设施工组织设计方案网站,展示类网站开发费用,怎么看网站有没有做竞价文章目录 1. 前言2. GDB 远程调试2.1 准备工作2.1.1 准备 客户端 gdb 程序2.1.2 准备 服务端 gdbserver2.1.3 准备 被调试程序 2.2 调试2.2.1 通过网络远程调试2.2.1.1 通过 gdbserver 直接启动程序调试2.2.1.2 通过 gdbserver 挂接到已运行程序调试 2.2.2 通过串口远程调试2.2… 文章目录 1. 前言2. GDB 远程调试2.1 准备工作2.1.1 准备 客户端 gdb 程序2.1.2 准备 服务端 gdbserver2.1.3 准备 被调试程序 2.2 调试2.2.1 通过网络远程调试2.2.1.1 通过 gdbserver 直接启动程序调试2.2.1.2 通过 gdbserver 挂接到已运行程序调试 2.2.2 通过串口远程调试2.2.1.1 通过 gdbserver 直接启动程序调试2.2.1.2 通过 gdbserver 挂接到已运行程序调试 3. 参考资料 1. 前言 限于作者能力水平本文可能存在谬误因此而给读者带来的损失作者不做任何承诺。 2. GDB 远程调试 GDB 远程调试同时需要 服务端 gdbserver 和 客户端 gdb 两个程序。本文以 ARM32 嵌入式设备内程序的调试为例对 GDB 远程调试方法进行说明。 先对 服务端 gdbserver 和 客户端 gdb 连接拓扑做一个梗概描绘 2.1 准备工作 2.1.1 准备 客户端 gdb 程序 客户端 gdb 通过和 服务端 gdbserver 的交互对运行于目标机器的程序进行调试。笔者使用 Ubuntu 系统作为调试客户端的宿主机即 客户端 gdb 运行于 Ubuntu 下。 笔者测试使用的嵌入式设备 SDK 的交叉编译工具链已经包含了 客户端 gdb 程序无需额外准备 $ arm-linux-gnueabihf-gdb --version GNU gdb (Linaro GDB 2016.02) 7.10.1.20160210-cvs Copyright (C) 2015 Free Software Foundation, Inc. License GPLv3: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type show copying and show warranty for details. This GDB was configured as --hostx86_64-unknown-linux-gnu --targetarm-linux-gnueabihf. Type show configuration for configuration details. For bug reporting instructions, please see: https://bugs.launchpad.net/gcc-linaro. Find the GDB manual and other documentation resources online at: http://www.gnu.org/software/gdb/documentation/. For help, type help. Type apropos word to search for commands related to word. 如果读者的交叉编译工具链没有包含 gdb在 Ubuntu 下可通过命令安装适用于多架构平台的 gdb 客户端程序 sudo apt-get install gdb-multiarch 2.1.2 准备 服务端 gdbserver gdbserver 运行于被调试的目标机器在本文中目标机器指 ARM 嵌入式设备。笔者是通过 buildroot 构建的 gdbserver不想使用 buildroot 的读者可自行查阅相关资料进行 gdbserver 的构建。 构建好 gdbserver 后将其拷贝到目标机器。笔者是将其拷贝到目标机器的 /usr/bin 目录这样可以不用指定路径运行。 2.1.3 准备 被调试程序 /* test.c */#include unistd.hint main(void) {while (1)sleep(5);return 0; } 编译然后将测试程序 test 拷贝到目标机器 $ arm-linux-gnueabihf-gcc -o test test.c 2.2 调试 2.2.1 通过网络远程调试 2.2.1.1 通过 gdbserver 直接启动程序调试 首先在目标机器(本文是指 ARM32 嵌入式设备)上运行命令 # gdbserver :2345 test Process test created; pid 440 Listening on port 2345 然后在调试器客户端机器(本文是指 Ubuntu)上运行下列命令 $ arm-linux-gnueabihf-gdb GNU gdb (Linaro GDB 2016.02) 7.10.1.20160210-cvs Copyright (C) 2015 Free Software Foundation, Inc. License GPLv3: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type show copying and show warranty for details. This GDB was configured as --hostx86_64-unknown-linux-gnu --targetarm-linux-gnueabihf. Type show configuration for configuration details. For bug reporting instructions, please see: https://bugs.launchpad.net/gcc-linaro. Find the GDB manual and other documentation resources online at: http://www.gnu.org/software/gdb/documentation/. For help, type help. Type apropos word to search for commands related to word. (gdb) target remote 192.168.3.8:2345 Remote debugging using 192.168.3.8:2345 Reading /root/test from remote target... warning: File transfers from remote targets can be slow. Use set sysroot to access files locally instead. Reading /root/test from remote target... Reading symbols from target:/root/test...done. Reading /lib/ld-linux-armhf.so.3 from remote target... Reading /lib/ld-linux-armhf.so.3 from remote target... Reading symbols from target:/lib/ld-linux-armhf.so.3...(no debugging symbols found)...done. 0xb6fd7a00 in _start () from target:/lib/ld-linux-armhf.so.3 (gdb) 在客户端宿主机(本文指 Ubuntu)启动 arm-linux-gnueabihf-gdb 后通过命令 target remote 192.168.3.8:2345 连接到目标机器。其中192.168.3.8 是目标机器的的 IP。 这时候目标机器(本文是指 ARM 嵌入设备)会输出 gdb 客户端连接的消息 Remote debugging from host 192.168.3.168 # gdbserver :2345 test Process test created; pid 440 Listening on port 2345 Remote debugging from host 192.168.3.168 到此就可以通过 gdb 在客户端宿主机(本文指 Ubuntu)调试目标机器(本文是指 ARM 嵌入设备)的 test 程序了。 2.2.1.2 通过 gdbserver 挂接到已运行程序调试 如果 test 已经运行可以通过 attach 方式启动 gdbserver挂接到 test 程序进行调试。 先在目标机器(本文是指 ARM32 嵌入式设备)上启动 test 程序放入后台运行 # ./test # ps -ef | grep -v grep | grep test445 root ./test 将 gdbserver 挂接到 test 进程 # gdbserver --attach :2345 445 Attached; pid 445 Listening on port 2345 在客户端宿主机(本文指 Ubuntu)启动 arm-linux-gnueabihf-gdb然后通过命令 target remote 192.168.3.8:2345 连接到目标机器调试程序 $ arm-linux-gnueabihf-gdb GNU gdb (Linaro GDB 2016.02) 7.10.1.20160210-cvs Copyright (C) 2015 Free Software Foundation, Inc. License GPLv3: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type show copying and show warranty for details. This GDB was configured as --hostx86_64-unknown-linux-gnu --targetarm-linux-gnueabihf. Type show configuration for configuration details. For bug reporting instructions, please see: https://bugs.launchpad.net/gcc-linaro. Find the GDB manual and other documentation resources online at: http://www.gnu.org/software/gdb/documentation/. For help, type help. Type apropos word to search for commands related to word. (gdb) target remote 192.168.3.8:2345 Remote debugging using 192.168.3.8:2345 Reading /root/test from remote target... warning: File transfers from remote targets can be slow. Use set sysroot to access files locally instead. Reading /root/test from remote target... Reading symbols from target:/root/test...done. Reading /lib/libc.so.6 from remote target... Reading /lib/ld-linux-armhf.so.3 from remote target... Reading symbols from target:/lib/libc.so.6...(no debugging symbols found)...done. Reading symbols from target:/lib/ld-linux-armhf.so.3...(no debugging symbols found)...done. Reading /lib/ld-linux-armhf.so.3 from remote target... 0xb6e9e134 in nanosleep () from target:/lib/libc.so.6 (gdb) 2.2.2 通过串口远程调试 2.2.1.1 通过 gdbserver 直接启动程序调试 在目标机运行命令 gdbserver /dev/ttyS1 test 其中/dev/ttyS1 为目标机上和客户端宿主机连接的串口设备对象。 在客户端宿主机运行命令 $ arm-linux-gnueabihf-gdb [......] (gdb) target remote /dev/ttyUSB0 其中/dev/ttyUSB0 为客户端宿主机上和目标机连接的串口设备对象。 2.2.1.2 通过 gdbserver 挂接到已运行程序调试 在目标机上依次运行下列命令 # test # ps -ef | grep -v grep | grep test ## 查询 test 进程 PID # gdbserver --attach /dev/ttyS1 445 在客户端宿主机运行命令 $ arm-linux-gnueabihf-gdb [......] (gdb) target remote /dev/ttyUSB0 3. 参考资料 [1] Using the gdbserver program [2] gdbserver(1) — Linux manual page
http://www.pierceye.com/news/26125/

相关文章:

  • 辽宁省建设厅网站升级建设淘宝网站的市场分析
  • 易语言开发网站做网站首页ps分辨率多少
  • 网站素材资源一手楼房可以做哪个网站
  • 无锡市网站新手要如何让网站被收录
  • 如何写网站建设方案书门户网站构建
  • 自己搭建服务器 发布网站 域名如何申请网站用途
  • 鄂尔多斯市东胜区城市建设局网站网站自动优化怎么样
  • 用ssh做的简单网站深圳网站建设ln12345
  • 杨浦网站建设_网站外包企业管理软件开发平台
  • 机械加工外协网站模板之家网页模板下载
  • 企信网是什么网站徐州网站建设工作室
  • 云指建站平台网站优化需要那些工具
  • 怎么登陆建设工程网站电子商城网站开发
  • 建设银行昆山分行网站私人路由器做网站
  • 网站建设需要多少天视频链接提取在线工具
  • 广州网站建设易企咸阳制作网站
  • 绵阳市三台县城乡建设局网站谷歌网站排名
  • 网站直播软件开发进入4399电脑网页版
  • 优秀网站优点乐趣做网站
  • 大连网站制作431免费拿货的代理商
  • 荷泽网站建设网站建立连接不安全
  • 织梦 手机网站模板工商注册地址查询系统
  • golang 网站开发 开源山东家居行业网站开发
  • 青岛建设局网站静态网站入侵
  • seo网站图片优化深汕特别合作区房价
  • ps怎么做网站导航什么网站做产品销售做的好
  • 中国建设银行官网站电话号码低价网站建设联系方式
  • 做网站用什么网名好个人博客网站模板wordpress
  • 官方网站建设合同做网站的价位
  • 合肥网站建设培训机构正规的外包加工订单网有哪些