Skip to main content
PSimo.4
Associate
October 7, 2022
Question

How to enable / configure dynamic breakpoint ?

  • October 7, 2022
  • 2 replies
  • 3215 views

Hey hi Community !

I’m here because I didn’t found informations onto «fonction breakpoint» «event breakpoint» and «watchpoint» :

I work with STM32G071, write C and use GDB.

I want to configure a conditional breakpoint, that break when a variable is equal to a specific value. Is that possible ?

I tried with a Watchpoint, but it doesn’t work well.

Can you help me pls?

Thanks a lot !

Simon

This topic has been closed for replies.

2 replies

Pavel A.
Super User
October 8, 2022

Is your gdb and target software provided by ST (such as ST-LINK server or OpenOCD provided with CubeIDE, or J-LINK) or something generic?

PSimo.4
PSimo.4Author
Associate
October 11, 2022

I’m using default gdb and ST-LINK/V2 via usb.

I’m a begginner, so I didn’t hack anythink xD

Semer CHERNI
ST Employee
October 10, 2022

Hello @PSimo.4​ 

First let me thank you for posting.

In fact, such feature is implemented in STM32CubeIDE.

In the debugging view go to the Breakpoint view and right click on the breakpoint where you want to add a condition.

Open the Breakpoints Properties menu and add the stopping condition.

0693W00000UnhwfQAB.png 

0693W00000UnhumQAB.png 

Kind regards,

Semer.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
PSimo.4
PSimo.4Author
Associate
October 11, 2022

Thx a lot !

As Condition may I write « var == 5 » (if var is a correctly declared variable ?)

I saw Watchpoint with a similar interface, (with condition)

Is Watchpoint the same thing that a conditionnal breakpoint, but didn’t attached to a line ?