cancel
Showing results for 
Search instead for 
Did you mean: 

run release without breakpoints

Schmid.M.
Senior

Hi,

I flash a project for debugging and set some breakpoints. Then I compile for release and run the code using the green arrow symbol. The code is flashed, but does not run, as it is stuck in a breakpoint from earlier debug sessions.

Is there a way to automatically remove all breakpoints in the device when starting a "Run" configuration?

thanks,

Michael

12 REPLIES 12
Uwe Bonnes
Principal III

Your program should provide a way to clear breakpoint. As a last ressort, power cycle the device to clear breakpoints left in the debug unit.

Schmid.M.
Senior

power cycling is what I always need to do now. there should be an easier way, in my hardware this is quite complicated.

Cartu38 OpenDev
Lead II

? is "Run > Skip All Breakpoints" or "Run > Remove All Breakpoints" menu you are looking for ?

Schmid.M.
Senior

thanks, but no, this removes the breakpoints in the IDE. I want to keep the breakpoints in the IDE for debugging, just clear them from the device memory when running a release version. I guess there should be some initialization commands in the run config, but I don't know which commands are available there.

0693W000007BUg2QAG.png 

If no IDE breakpoint we are discussing so about software breakpoints you've added to your applicative code ?

If yes you're looking for a way to ignore them at compile time ?

If hardware breakpoint (IDE ones) using "Run > Skip All Breakpoints" is allowing to ignore them running on target without removing them so possible to activate them later on relying on same menu (toggle mode)

Schmid.M.
Senior

no no. I assume the breakpoints are somehow still in the memory of my stm32. during "run", I don't want them there, only during "debug'. So if I click on run, the breakpoints can still be in the IDE ( I might need them again in next debug session), but they should be removed in the stm32 during run.

I hope that makes it a bit more clear ;)

According to me only 2 kind of breakpoints.

1) Hard breakpoint = added thru GDB (relying on console based gdb command usage or Thanks IDE dedicated UI). Such is not part of binary you're flashing to device.

2) Software breakpoint = added within applicative code by code developper

See https://mcuoneclipse.com/2012/07/29/software-and-hardware-breakpoints/

If a breakpoint is part of your device memory means it is part of your application code ... Removing it then new compile & device flash should solve trouble.

Schmid.M.
Senior

I never inserted software breakpoints, so how can I make gdb delete all breakpoints when I want to run release?

Have a try to toogle off all your breakpoints relying on "Run > Skip All Breakpoints".

Then launch a debug session on target. Once running stop it.

Have new try in run mode then.

If debug session and no breakpoint active GDB should do proper cleanup.