Comments (4)
The debug adapter currently does not support this. To support custom environment variables, we might have to start the debuggee process externally and connect the debug adapter to it through a socket. This is, at least, what the Java extension does: microsoft/java-debug#89
Edit: Note that you can already launch your process externally with the following JVM args:
-Xdebug -agentlib:jdwp=transport=dt_socket,address=$PORT,server=y,quiet=y,suspend=y
...then connect the debug adapter through VSCode to port$PORT
(using the"request": "attach"
configuration).
from kotlin-debug-adapter.
Thanks for the reply. I'll have a try on the "attach" mode.
from kotlin-debug-adapter.
"request": "attach" configuration
I tried the attach configuration, unfortunately it didn't work.
To reproduce
% cd kotlin-quick-start
./gradlew run --debug-jvm
> Task :run
Listening for transport dt_socket at address: 5005
Run the Kotlin Attach config in vscode. But got the message below:
[INFO] main Connected to client
[INFO] async0 Waiting for configuration done response for 10 seconds...
[INFO] async0 Waiting for configuration done response for 20 seconds...
[INFO] async0 Waiting for configuration done response for 30 seconds...
[INFO] async0 Waiting for configuration done response for 40 seconds...
[INFO] async0 Waiting for configuration done response for 50 seconds...
[INFO] async0 Waiting for configuration done response for 60 seconds...
[INFO] async0 Waiting for configuration done response for 70 seconds...
...
My launch.json is:
{
"version": "0.2.0",
"configurations": [
{
"type": "kotlin",
"request": "attach",
"name": "Kotlin Attach",
"projectRoot": "${workspaceFolder}",
"hostName": "localhost",
"port": 5005,
"timeout": 30000
},
{
"type": "kotlin",
"request": "launch",
"name": "Kotlin Launch",
"projectRoot": "${workspaceFolder}",
"mainClass": "MainKt",
"preLaunchTask": "build"
},
{
"type": "java",
"name": "Java Debug (Attach)",
"request": "attach",
"hostName": "localhost",
"port": 5005
}
]
}
The Java Debug(Attach) works. It correctly attached and showed call stack. (Of cause it doesn't recognize kotlin breakpoints though.)
A reproducing repo can be found here:
https://github.com/thunderz99/kotlin-quick-start/tree/topics/test-environment-variables
from kotlin-debug-adapter.
It worked when I build the kotlin-debug-adapter locally. Maybe the one in the latest-release is out of date.
Anyway thank you for your advice!
from kotlin-debug-adapter.
Related Issues (20)
- Unable to attach debugger to a unit test HOT 1
- Problems using within gradle project
- Support variable presentation hints, e.g. for lazy evaluation of values
- Ability to debug a Kotlin program (JVM, not Native), without gradle or maven HOT 1
- Unable to stop at breakpoints and continue execution HOT 8
- Cannot Debug Quarkus Kotlin project HOT 2
- How to debug kotlin-debug-adapter
- Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/boot/SpringApplication HOT 3
- Fix issues with the shared module dependency and update it HOT 4
- [Discussion] Instruction on developing new feature on the debug adapter
- Improve source root resolving for multi-module projects
- Gradle dependencies could not be resolved [Kotlin VS Code Extension] HOT 4
- Gradle runtimeOnly dependencies not in classpath HOT 1
- Resolving dependencies not working -> Gradle fails with "configuration linuxCompileClasspath not found" HOT 1
- Debugging unit tests HOT 1
- Fields from outer class not shown, only inner fields
- Can I use this to debug android project?
- Kotlin debug doesn't stop at Clikt subcommand
- VSCode Debug Console not evaluating expressions HOT 1
- Custom Kotlin Script definition can't be debugged
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kotlin-debug-adapter.