This article has been published by the author Wu Zhiqiang to authorize the Netease cloud community.
Welcome to the Netease cloud community to learn more about the operation experience of Netease technology products.
This article takes the WFD program as an example:
1. fl gdbserver to the router firmware
On the host side, use make menuconfig to select the following two items.
1) Advanced Configuration Options (for developers) → toolchain options → build GDB
2) Utilities → gdbserver
As follows:
2. Compile the program.
On the host side, add target_cflags + =-ggdb3 To The makefile header of your program.
Then compile the software package and add the config_debug option during compilation. Otherwise, the symbol table cannot be found during debugging. You can also enable global settings: Global build Settings> compile packages with debugging info.
Command:
3. Enable gdbserver.
After the compilation is successful, upload and install the software package on the vro through SSH, and run the gdbserver command to start the program. You can specify the port here.
Command syntax: gdbserver <local_ip >:< port> <program> <ARGs>
The last line is the output after the gdb connection, which can be ignored here.
4. Remote debugging
Connect to the server on the host side.
Command Format:
Remote-GDB serverip: Port executable
You can use the gdb command for normal debugging.
The Netease cloud free trial hall provides over 20 cloud products at zero cost!
For more information about Netease technologies, products, and operations, click.
Related Articles:
[Recommended] 360 ° perspective: Evolution of cloud native architecture
[Recommended] Spring boot + mybatis multi-data source configuration for read/write splitting
[Recommendation] comprehensive popularity of AI
Openwrt remote debugging