More often than not, the JVM to attach the debugger to is started outside IDE's scope. E.g. various cmdline tools.
The process of starting the app is sometimes quite long - downloading deps, building, creating database, ...).
When this is done, JVM is started, and waits for the debugger to attach (when suspend=y). After debugger is attached, the app continues for another longer period until it get's to the point user is interested in.
It would be much convenient if the IDE watched pre-configured port, and attached automatically any time the debugger would appear on that port. In the UI, this would be represented:
a) by a toggleable button "Wait for debugger",
b) or better, re-using the current "Attach to debugger" dialog, only adding a checkbox - "Watch the port permanently, attach whenever debugger appears".
(The state of waiting for the debugger could be represented by the button being somehow altered.)
Thanks for considering.