Search code examples
javadebuggingintellij-idearemote-debugging

Break points are not setting up for some lines in intellij


While setting break points in intellij for debugging a java project . I couldn't set line break points at some places.

Methods I followed for debugging .

  • Go to Run-> Debug in IntelliJ. It will give a dialog box and click on Edit Configurations.
  • Then give a name such ( I have given Remote-debugger) and press OK. I set Host: localhost and Port:5005 have been set.
  • Go Run->Debug ‘' ( Run-> Debug Remote-debugger in my case)
  • Started the server

enter image description here

As you can see above, for some lines the break points get added and for some line it is not . WHY ?


Solution

  • It most likely is because the remote code that you are debugging is different than the source code and the lines that are you are putting a break point on are not code lines. You have to make sure your source code matches the binary that's on your remote host by checking out exactly the same revision from your source control.