当前位置:网站首页>Related concepts of GDB in embedded system
Related concepts of GDB in embedded system
2022-07-03 01:31:00 【TangZhenye】
1. background
Debugger plays a very important role in embedded development , Download program 、 Single step debugging program 、 Lower breakpoint 、 Check the function call relationship through the function call stack . Usually we don't care about how the debugger works , Just debug , But the recognition of underlying principles is very important , This article will open a large piece of knowledge puzzle .
2. GDB What is it?
I understand , Not according to the official explanation , what GNU Plan something .GDB yes gcc A debugging program of tool chain , Notice the procedure .
3. GDB Two concepts of
GDB It's the program , The debugger is just running GDB Embedded tools for programs , In debugger GDB Procedures are often called GDB Server, seeing the name of a thing one thinks of its function , That's it. GDB The server . The server serves the client , Always listen for requests from clients . therefore ,PC There must be a GDB Client Client program .
Frequently used Jlink,ST-link Etc , Usually use your own gdb server The program runs on it , therefore , We usually use on-chip JTAG Interface ,SWD Interface to the debugger , After connecting , We are IDE Click the bug button on the to debug the board , here ,IDE Integrated in GDB Client,IDE Through this Client And ST-link perhaps Jlink Medium Server Communications , For example, send a breakpoint instruction ( stay IDE Click to show a red circle ), Then run at full speed ,Client Will send the command to run at full speed to Server, here Server Send the signal to the internal debugging unit of the chip through the actual DuPont line , The chip runs .
4. GDB Serial protocol
Usually we use the debugger to connect the development board , such Client And Server It is difficult to observe the commands sent between , therefore , Can pass qemu The way , Give Way qemu function Server Program and start the network protocol stack ,Client Connect through the network Server To debug Server End of the code , such , Through the bag capturing tool Client And Server The interactive data between them is caught , You can know what they have said between them .
5. GDB Relevant command
gdb xxx.elf // client End load symbol table
target remote ip:port // Connect Server
load xxx.elf // take elf load To Server End , It is equivalent to downloading the program again for the board
b xxx // stay xxx Break point
c // Run at full speed , Stop at breakpoint
bt // Display function call stack
.
.
.
.
.
边栏推荐
- Now that the teenager has returned, the world's fireworks are the most soothing and ordinary people return to work~
- 一比特苦逼程序員的找工作經曆
- [Androd] Gradle 使用技巧之模块依赖替换
- Androd gradle's substitution of its use module dependency
- [Cao gongzatan] after working in goose factory for a year in 2021, some of my insights
- 数学知识:Nim游戏—博弈论
- Mongodb common commands of mongodb series
- Top ten regular spot trading platforms 2022
- Basic concept and implementation of overcoming hash
- MySQL foundation 05 DML language
猜你喜欢

leetcode刷题_两数之和 II - 输入有序数组
![[interview question] 1369 when can't I use arrow function?](/img/7f/84bba39965b4116f20b1cf8211f70a.png)
[interview question] 1369 when can't I use arrow function?

MySQL - database query - condition query

wirehark数据分析与取证A.pacapng

Why is it not recommended to use BeanUtils in production?

海量数据冷热分离方案与实践

Esp32 simple speed message test of ros2 (limit frequency)

Why can't the start method be called repeatedly? But the run method can?

JDBC courses
![[技术发展-23]:DSP在未来融合网络中的应用](/img/2e/f39543a18a8f58b1d341ce72cc4427.png)
[技术发展-23]:DSP在未来融合网络中的应用
随机推荐
【C语言】指针与数组笔试题详解
MySQL basics 03 introduction to MySQL types
【FPGA教程案例6】基于vivado核的双口RAM设计与实现
Swiftui component Encyclopedia: using scenekit and swiftui to build interactive 3D pie charts (tutorial with source code)
数学知识:能被整除的数—容斥原理
tail -f 、tail -F、tailf的区别
强化学习 Q-learning 实例详解
【第29天】给定一个整数,请你求出它的因子数
Look at how clothing enterprises take advantage of the epidemic
C application interface development foundation - form control (3) - file control
LeetCode 987. Vertical order transverse of a binary tree - Binary Tree Series Question 7
SwiftUI 组件大全之使用 SceneKit 和 SwiftUI 构建交互式 3D 饼图(教程含源码)
uniapp组件-uni-notice-bar通告栏
Matlab finds the position of a row or column in the matrix
按键精灵打怪学习-多线程后台坐标识别
给你一个可能存在 重复 元素值的数组 numbers ,它原来是一个升序排列的数组,并按上述情形进行了一次旋转。请返回旋转数组的最小元素。【剑指Offer】
leetcode 2097 — 合法重新排列数对
Database SQL language 02 connection query
C application interface development foundation - form control (2) - MDI form
Why can't the start method be called repeatedly? But the run method can?