当前位置:网站首页>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 .
边栏推荐
- 什么是依赖注入(DI)
- sql优化常用技巧及理解
- Sorry, I've learned a lesson
- 导航栏根据路由变换颜色
- Design, configuration and points for attention of network arbitrary source multicast (ASM) simulation using OPNET
- Senior programmers must know and master. This article explains in detail the principle of MySQL master-slave synchronization, and recommends collecting
- ForkJoin最全详解(从原理设计到使用图解)
- How Alibaba cloud's DPCA architecture works | popular science diagram
- How does mapbox switch markup languages?
- Taobao store release API interface (New), Taobao oauth2.0 store commodity API interface, Taobao commodity release API interface, Taobao commodity launch API interface, a complete set of launch store i
猜你喜欢
照片选择器CollectionView
[binary tree] binary tree path finding
How digitalization affects workflow automation
Paper reading [semantic tag enlarged xlnv model for video captioning]
分布式全局ID生成方案
1. AVL tree: left-right rotation -bite
论文阅读【Open-book Video Captioning with Retrieve-Copy-Generate Network】
Unity keeps the camera behind and above the player
Is the human body sensor easy to use? How to use it? Which do you buy between aqara green rice and Xiaomi
基于 hugging face 预训练模型的实体识别智能标注方案:生成doccano要求json格式
随机推荐
The navigation bar changes colors according to the route
Leetcode: maximum number of "balloons"
论文阅读【MM21 Pre-training for Video Understanding Challenge:Video Captioning with Pretraining Techniqu】
Web architecture design process
一条 update 语句的生命经历
async / await
淘宝店铺发布API接口(新),淘宝oAuth2.0店铺商品API接口,淘宝商品发布API接口,淘宝商品上架API接口,一整套发布上架店铺接口对接分享
DOM node object + time node comprehensive case
【Shell】清理nohup.out文件
Paper reading [open book video captioning with retrieve copy generate network]
Simple case of SSM framework
WEB架构设计过程
导航栏根据路由变换颜色
In memory, I moved from CSDN to blog park!
Record a pressure measurement experience summary
Leetcode 1189 maximum number of "balloons" [map] the leetcode road of heroding
1.AVL树:左右旋-bite
JVM (19) -- bytecode and class loading (4) -- talk about class loader again
4. 对象映射 - Mapping.Mapster
Summary of the mean value theorem of higher numbers