0

I'm trying to do a remote debug on IntelliJ. I have my remote debug setup using this command in IntelliJ -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=40779 Currently when I hit local server with port 40779 and I check the logs I see that logging works so the code does execute. I set the breakpoint at the log just for sanity check to make sure that it would suspend at the point however it doesn't. I'm currently using Intellij 2020.2. I tried upgrading to Intellij 2020.3 and also the latest version 2021.1. I also tried invalidating the cache/restarting and also removing/adding all my breakpoints again.

The files I'm setting the breakpoints are Kotlin files and my Kotlin plugin version 203-1.5.0-release-759-IJ7717.8. I can also successfully run debug and connect to remote server Connected to the target VM, address: 'localhost:40779', transport: 'socket' but when I make a request to that server, the breakpoints don't stop.

  • Double check you connect to the correct JVM that runs your code. When using Maven/Gradle and other tools sometimes VM is forked depending on the configuration, so you may be connecting to the parent VM process while your code actually runs in the child process. – CrazyCoder May 05 '21 at 22:43
  • I double checked that under File > Project Structure > Project SDK I'm using version 1.8.052 and also Platform Settings is also using the same version. It also matches the Gradle JVM version. Are there other places to look at since I can connect to the remote port but breakpoints don't get hit. Thanks for answering – user3838284 May 07 '21 at 00:17
  • See the process tree in the OS when you start the app. Do you see the single java process or do you see 2 java processes created once your app is started? – CrazyCoder May 07 '21 at 00:18
  • Sorry how do you see the process tree? Is this how you see process tree: https://stackoverflow.com/questions/7138783/how-to-display-the-current-process-tree-of-a-bash-session. I'm using MacOS – user3838284 May 07 '21 at 00:30
  • Do your research, you didn't specify your OS, so I can't help. – CrazyCoder May 07 '21 at 00:31
  • Edited my comment. I'm using macOS Big Sur version 11.3.1. I can use pstree – user3838284 May 07 '21 at 00:35
  • I double checked. It is only one java process after app is started – user3838284 May 07 '21 at 00:43
  • Do you connect exactly to that process? Does run the same version of the code that you have in the editor? – CrazyCoder May 07 '21 at 00:43
  • So I'm currently running remote JVM debug and when I try to attach to that process, an exception shows up. `Exception in thread "main" sun.jvm.hotspot.debugger.DebuggerException: sun.jvm.hotspot.debugger.DebuggerException: Can't attach to the process. Could be caused by an incorrect pid or lack of privileges.` – user3838284 May 07 '21 at 00:57

0 Answers0