Debugger stops in source code where no breakpoint is defined

Answered

Hi all,

I have defined some breakpoints in external libraries (jars) and Intellij stops on them. Unfortunatelly, it stops in another part of the source code where I have no breakpoints, why? What can I do to avoid this behaivour? I have to click allways F9 to jump such "ghost-breakpoints"

Regards
S.

5
10 comments

Make sure classes and sources are in sync. Attach a screenshot with configured breakpoints and .idea/workspace.xml file. Specify the file/line where is stops, but shouldn't.

1
Avatar
Permanently deleted user

Here is the statement where Intellij stops without setting a breakpoint: (Link) I use the jar which contains that file.

It happens in the following line, although I haven't defined a breakpoint in that line 

"db = factory.open(dbPath.toFile(), options);"

workspace.xml

Here is where I put the breakpoint and where stops as desired:

Any idea what to do?

 

0
Avatar
Permanently deleted user

Here is a screenshot where it stops

 

0

Hi, what IDEA version are you using?

Please also check that you do not have other breakpoints (exception, method, etc.). To verify it is better to remove/disable them all.

 

1
Avatar
Permanently deleted user

Hi Egor,

I am using Idea 15.0.3 (Build-IC143-1821)

I removed all the breakpoints and now works fine. Thanks a lot.

Regards

S.

0

I ran into the same thing. The fix for me was:

  1. Open ./.idea/workspace.xml
  2. Find the <line-breakpoint> entry which has a <url> child element matching the file in question.

    So if your rogue breakpoint is in a file called rogue_breakpoint.py, you're looking for:
    <line-breakpoint enabled="true" suspend="THREAD" type="python-line">
    <url>file://$PROJECT_DIR$/my/path/to/file/rogue_breakpoint.py</url>
    <line>224</line>
    <option name="timeStamp" value="129" />
    </line-breakpoint>
  3. Delete the entire entry from <line-breakpoint> to </line-breakpoint>.
  4. Save and close workspace.xml.

 

6

I had the same exact problem and I think I understand the bug.

I wrote some code, put a breakpoint there, and them commented it without removing the breakpoint.

Then, when the code runs it stops on a ghost breakpoint on a random fixed line of code.

Conclusion: The problem is having breakpoint at commented code. Just delete those breakpoints on commented code, and it will work as expected

1

Another thing to consider is that you might see ghost breakpoints if the compiled code doesn't match up with the source code.

1

Got the same error. My project uses a library that I also have access to. I made changes to it, did a ./gradlew assemble install , and after I opened the modified library class in the main project, the breakpoints became invisible.
Cache invalidation helped, breakpoints became visible and I was able to turn them off.

2

Thank you so much Ben Plowman ! This really worked. It would be nice if there is a simpler way like clicking an option in the Pycharm GUI to remove all these ghost/phantom breakpoints.

0

Please sign in to leave a comment.