当前位置:网站首页>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 .

边栏推荐
猜你喜欢

Flink SQL realizes reading and writing redis and dynamically generates hset key

Flink SQL 实现读写redis,并动态生成Hset key

Unity keeps the camera behind and above the player

How Alibaba cloud's DPCA architecture works | popular science diagram

《2022中国低/无代码市场研究及选型评估报告》发布

论文阅读【Semantic Tag Augmented XlanV Model for Video Captioning】

English grammar_ Noun possessive

张平安:加快云上数字创新,共建产业智慧生态

分布式事务介绍

The navigation bar changes colors according to the route
随机推荐
What are the common message queues?
一条 update 语句的生命经历
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
Educational Codeforces Round 22 B. The Golden Age
Two person game based on bevy game engine and FPGA
Vector and class copy constructors
Use Zhiyun reader to translate statistical genetics books
Egr-20uscm ground fault relay
Mybaits之多表查询(联合查询、嵌套查询)
What is dependency injection (DI)
[JS component] custom select
[PM products] what is cognitive load? How to adjust cognitive load reasonably?
WEB架构设计过程
1.AVL树:左右旋-bite
论文阅读【Sensor-Augmented Egocentric-Video Captioning with Dynamic Modal Attention】
nodejs获取客户端ip
"Multimodal" concept
sql查询:将下一行减去上一行,并做相应的计算
async / await
张平安:加快云上数字创新,共建产业智慧生态