当前位置:网站首页>Realize GDB remote debugging function between different network segments
Realize GDB remote debugging function between different network segments
2022-07-07 05:41:00 【Big orange madness】
Preface
In the development process , Use gdb When debugging remotely , You'll come across Linux The network segment of the server is not the same as that of the onboard device , Can't be used normally gbd Remote debugging function .
Onboard devices and computers connect to routers , Belong to the same network segment , Such as 192.168.1.1, And routers and Linux The server belongs to another network segment , Such as 10.20.51.251.
problem
Onboard devices and computers can interact ping through , Onboard devices or computers can also ping through Linux The server , but Linux The server cannot ping Connect onboard equipment or computer .
Onboard devices or computers can ping through Linux The server is because the router and the server belong to the same network segment , So you can forward it through the router ping through , The server can ping Through router IP, But can not ping Connect the LAN under the router IP
Because the server cannot ping On board equipment , Nature cannot use gdb Remote debugging , The following error occurred after entering the following instructions during server debugging ( Reference resources Use on Hisilicon chip GDB Remote debugging ).
# ./arm-himix200-linux-gdb test
...
(gdb) target remote 192.168.1.102:8005
192.168.1.102:8005: Connection timeout .
(gdb)
terms of settlement
Enable router DMZ host function , Add onboard equipment IP address
About DMZ host , In fact, it is to expose a host in the internal network to the external network , Direct access to the public network IP, This can be the same as the Internet .
It can be simply interpreted as an access router IP, It's a transparent interview DMZ Host settings IP.
Suppose the onboard equipment IP yes “192.168.1.140”, The router IP yes “10.20.51.100”, Server's IP yes “10.20.51.120”.
In the use of GDB When debugging remotely , Onboard equipment execution gdbserver, Connected to the server IP Address .
# ./gdbserver --remote-debug 10.20.51.120:8005 test
Run on the server gdb, The connection uses the router IP Address , Instead of onboard equipment IP Address .
# ./arm-himix200-linux-gdb test
...
(gdb) target remote 10.20.51.100:8005
Remote debugging using 10.20.51.100:8005
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.
0x76fcebc0 in ?? () from target:/lib/ld-linux-armhf.so.3
(gdb)
It can be used normally at this time gdb Remote debugging function of .
attach
How to set the router DMZ Host function :
With TP-LINK Router, for example , Log in to the setting interface of the router , Application management , Click on DMZ host
Enable DMZ Host function , Input... Of onboard equipment IP Address , Save it .
边栏推荐
- Leakage relay jelr-250fg
- [JS component] custom select
- 淘宝商品详情页API接口、淘宝商品列表API接口,淘宝商品销量API接口,淘宝APP详情API接口,淘宝详情API接口
- 微信小程序蓝牙连接硬件设备并进行通讯,小程序蓝牙因距离异常断开自动重连,js实现crc校验位
- Vector and class copy constructors
- Senior programmers must know and master. This article explains in detail the principle of MySQL master-slave synchronization, and recommends collecting
- 《2》 Label
- Paper reading [MM21 pre training for video understanding challenge:video captioning with pre training techniqu]
- [JS component] date display.
- Five core elements of architecture design
猜你喜欢
分布式事务解决方案之2PC
Photo selector collectionview
Leetcode 1189 maximum number of "balloons" [map] the leetcode road of heroding
《4》 Form
Flink SQL 实现读写redis,并动态生成Hset key
什么是消息队列?
JVM (XX) -- performance monitoring and tuning (I) -- Overview
K6el-100 leakage relay
导航栏根据路由变换颜色
Zhang Ping'an: accelerate cloud digital innovation and jointly build an industrial smart ecosystem
随机推荐
Under the trend of Micah, orebo and apple homekit, how does zhiting stand out?
Flink SQL realizes reading and writing redis and dynamically generates hset key
Common skills and understanding of SQL optimization
Sorry, I've learned a lesson
async / await
How to get free traffic in pinduoduo new store and what links need to be optimized in order to effectively improve the free traffic in the store
说一说MVCC多版本并发控制器?
A cool "ghost" console tool
Jhok-zbg2 leakage relay
Dj-zbs2 leakage relay
照片选择器CollectionView
Mysql database learning (8) -- MySQL content supplement
Leakage relay llj-100fs
纪念下,我从CSDN搬家到博客园啦!
《2022中国低/无代码市场研究及选型评估报告》发布
Mybaits multi table query (joint query, nested query)
【oracle】简单的日期时间的格式化与排序问题
得物客服一站式工作台卡顿优化之路
《HarmonyOS实战—入门到开发,浅析原子化服务》
sql查询:将下一行减去上一行,并做相应的计算