当前位置:网站首页>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 .
边栏推荐
- 淘宝商品详情页API接口、淘宝商品列表API接口,淘宝商品销量API接口,淘宝APP详情API接口,淘宝详情API接口
- [reading of the paper] a multi branch hybrid transformer network for channel terminal cell segmentation
- Most commonly used high number formula
- What are the common message queues?
- 不同网段之间实现GDB远程调试功能
- AI人脸编辑让Lena微笑
- 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
- 分布式事务解决方案之2PC
- Dj-zbs2 leakage relay
- Talk about mvcc multi version concurrency controller?
猜你喜欢
Preliminary practice of niuke.com (9)
Senior programmers must know and master. This article explains in detail the principle of MySQL master-slave synchronization, and recommends collecting
《4》 Form
How Alibaba cloud's DPCA architecture works | popular science diagram
The year of the tiger is coming. Come and make a wish. I heard that the wish will come true
论文阅读【MM21 Pre-training for Video Understanding Challenge:Video Captioning with Pretraining Techniqu】
架构设计的五个核心要素
Pinduoduo product details interface, pinduoduo product basic information, pinduoduo product attribute interface
Paper reading [open book video captioning with retrieve copy generate network]
bat 批示处理详解
随机推荐
JVM (19) -- bytecode and class loading (4) -- talk about class loader again
消息队列:如何确保消息不会丢失
JVM(二十) -- 性能监控与调优(一) -- 概述
Distributed global ID generation scheme
Initial experience of annotation
Flink SQL realizes reading and writing redis and dynamically generates hset key
淘宝商品详情页API接口、淘宝商品列表API接口,淘宝商品销量API接口,淘宝APP详情API接口,淘宝详情API接口
How digitalization affects workflow automation
一条 update 语句的生命经历
zabbix_get测试数据库失败
不同网段之间实现GDB远程调试功能
Phenomenon analysis when Autowired annotation is used for list
Cve-2021-3156 vulnerability recurrence notes
JVM (XX) -- performance monitoring and tuning (I) -- Overview
CVE-2021-3156 漏洞复现笔记
Summary of the mean value theorem of higher numbers
导航栏根据路由变换颜色
Getting started with DES encryption
论文阅读【Open-book Video Captioning with Retrieve-Copy-Generate Network】
Is the human body sensor easy to use? How to use it? Which do you buy between aqara green rice and Xiaomi