当前位置:网站首页>Advanced usage of setting breakpoints during keil debugging
Advanced usage of setting breakpoints during keil debugging
2022-06-22 06:34:00 【liht_ one thousand six hundred and thirty-four】
Catalog :
1、 Set the number of times the breakpoint runs
2、 Variables match breakpoints
3、 Variable conditions match breakpoints
4、 Print information
5、 Condition matching print information
-----------------------------------------------------------------------------------------------------------------
When debugging the program online , Breaking points is a very effective way , Cooperate with one-step debugging , Can quickly locate problems . But sometimes , Manual break points are not so convenient to use .
such as , Want to be in the first place of a loop N Stop for the first time , Break the point manually , Then keep clicking on one-step operation , Until the cycle runs to N Time .
Another example , I don't know when the variables are changed during the running of the program , It's not easy to locate , I don't know where to hit the manual interruption point . At this point, we need to use some advanced usage of breakpoints .
-----------------------------------------------------------------------------------------------------------------
1、 Set the number of times the breakpoint runs
Take the following procedure for example , Stop the program at the tenth time of the cycle . First, manually make a breakpoint in the loop :

Click on Debug menu , choice BreakPoints:

Pop up the following menu :

The top breakpoint is manually hit , Double click the breakpoint , Will see Expression The information of the breakpoint will be displayed , modify Count The value of is 10, Click on Define, Then close the window . Here's an explanation :
Expression Expression for , That is, the condition of the breakpoint , You can see , The manually set breakpoint ends with \123, It means that main.c Of documents 123 That's ok . There is support for basic >、<、==、!= Wait for the operator .
Count Is the number of times , Indicates how many times the operation is interrupted and once , Manually set breakpoints Count All are 1.
Command For orders , Indicates the command executed when the breakpoint is reached , The default is empty. .
According to the settings above , Run the program . You can see , The program didn't stop immediately when it reached the breakpoint , But in the 10 Time to stop :

-----------------------------------------------------------------------------------------------------------------
2、 Variables match breakpoints
Add variables to Watch window , Right click selection Set Access BreakPoint at xxx. Or pop up the menu just now :


Check Access The way Read or Write, Set up Count value , Click on Define. Choose here Write,Count The value is 4, Indicates that the program will stop when the variable is written for the fourth time .
-----------------------------------------------------------------------------------------------------------------
3、 Variable conditions match breakpoints
Just like the next step , stay Watch window , Right click the variable and select Set Access BreakPoint at xxx. Check Access The way Read or Write, Delete Expression Write down the original content , Fill in the expression “AD== 10”. Click on Define. So when AD==10 The program will stop .

-----------------------------------------------------------------------------------------------------------------
4、 Print information
Select a manually set breakpoint , And then in Command Fill in below printf(), When running to the breakpoint , The program will not stop , But in Command Window print setting information .


-----------------------------------------------------------------------------------------------------------------
5、 Condition matching print information
Can also be 3 and 4 Use a combination of , as follows :

be AD==10 when , The program is not interrupted , stay Command Window printing information .
There are many advanced uses of breakpoints , Different expressions , Different instructions, etc , For details, please refer to Keil Use help documentation for .

-----------------------------------------------------------------------------------------------------------------
边栏推荐
- 5G终端标识SUPI,SUCI及IMSI解析
- Test ofnatural clusters via s-dbscan a self tuning version of DBSCAN
- 【5G NR】UE注册管理状态
- 【OpenAirInterface5g】RRC NR解析之RrcSetupRequest
- 《数据安全实践指南》- 数据采集安全实践-数据分类分级
- The difference between drop, truncate and delete
- Entry level test kotlin implements popwindow pop-up code
- 【OpenAirInterface5g】高层模块接口及itti实体线程创建
- 5G-GUTI详解
- Class load memory analysis
猜你喜欢

SQL 注入漏洞(十)二次注入

Chrome 安装 driver

SQL injection vulnerability (XIV) XFF injection attack

【5G NR】NAS连接管理—CM状态

Single cell literature learning (Part3) -- dstg: deconvoluting spatial transcription data through graph based AI

SQL 注入漏洞(十一)宽字节注入
![[PHP] composer 安装](/img/37/7adaca01b95085b42a116bc6b08165.png)
[PHP] composer 安装

New GDI functions and functions introduced in MiniGUl version 1.1.0 (II)

OpenGL - Draw Triangle

MySQL Niuke brush questions
随机推荐
SQL 注入漏洞(十三)base64注入
SQL injection vulnerability (x) secondary injection
ERROR: cannot verify nih. At's certificate, issued by "/c=us/o=let's encrypt/cn=r3", WGet reports an error
Clickhouse compares data from two machines
【5G NR】NAS连接管理—CM状态
[tp6] using the workman websocket
类加载内存分析
DL and alignment of spatially resolved single cell transcriptomes with Tangram
集合类并发不安全问题
[5g NR] ng setup of ngap protocol
KV260的PMOD接口介绍
5g-guti detailed explanation
【OpenAirInterface5g】RRC NR解析(一)
IO intensive and CPU intensive
【5G NR】NG接口
The song of cactus - marching into to C live broadcast (2)
高考是人生旅途的一处驿站
Inserting a classdiagram into markdown
SQL 注入漏洞(十二)Cookie注入
ForkJoinPool