Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ IDEA: Breakpoint not being hit, and is shown without the tick, just a red dot

I have a gradle project, and when I put a breakpoint it is displayed as a red dot, with a tick inside, and it just works fine.

working breakpoint

The problem is that in some classes (in the same project, not a dependency class), the red dot doesn't have a tick inside, and it doesn't tell why it wouldn't work. And it just doesn't work..:

enter image description here

What have I tried so far:

  • Gradle clean & build
  • Rebuild project
  • Restart debug
  • Invalidate caches and restart IntelliJ
  • Update IntelliJ to the latest version (2017.2.5)
  • Mute & Unmute breakpoints

This question is similar, but clearly not the same: Intellij IDEA: Breakpoint not being hit, and is shown greyed out

like image 754
Pablo Matias Gomez Avatar asked Oct 11 '17 15:10

Pablo Matias Gomez


People also ask

Why Debug is not working in Intellij?

To solve this, simply remove the jar of the debugged module from all modules' dependencies in the Project Structure. If you do not know which modules have the debugged module jar as dependencies, you can use some tools (Eg. Sublime Text, bash, ...) to search for the module name which is stored in Intellij *.

What does a tick on a breakpoint mean in Intellij?

Their documentation Describes the checkmark as "Shown at run-time when the breakpoint is recognized by the debugger as set on an executable code line." and the regular red dot as "Shown at design-time or during the debugging session when the class with such breakpoint is not yet loaded. "

How do I mark a breakpoint in Intellij?

To do this, go to Settings/Preferences | Build, Execution, Deployment | Debugger and select Drag to the editor or click with middle mouse button. Clicking a breakpoint will then enable or disable it.


2 Answers

Did some searching through IntelliJ Help PDF:
Help Doc pg. 431

Their documentation Describes the checkmark as "Shown at run-time when the breakpoint is recognized by the debugger as set on an executable code line."

and the regular red dot as "Shown at design-time or during the debugging session when the class with such breakpoint is not yet loaded. "

So it would seem that the line you're adding the breaking point to never gets executed. You can try stepping up line by line through the class to make sure the class is not getting hung up somewhere.

like image 176
Kedar Brooks Avatar answered Oct 16 '22 07:10

Kedar Brooks


I made a n00b mistake on the IDE. Instead of hitting the debug button, I thought it would work the same as visual studio or eclipse in that I'd have to use the run button, yet when I hit the debug button (That looks like an actual bug) my break-point hit just fine.

like image 7
Sizons Avatar answered Oct 16 '22 07:10

Sizons