[GR-60369] JDWP: initialize controller only for the java language. #10268
+3
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Depending on the order between the
JDWPInstrument
being created and languages being initialized,DebuggerController.onLanguageContextInitialized
can be called multiple times (once per language that is initialized after theJDWPInstrument
is created).Typically, the
JDWPInstrument
is created while espresso is being initialized becauseJDWPContextImpl#jdwpInit
callsenv.getInstruments().get(JDWPInstrument.ID)
which causes the initialization of the instrument. By that time all other languages are initialized so we don't see an issue.In a native image with preinitialized contexts though the JDWP instrument might already be created when truffle "replays" the initialization events (e.g.,
onLanguageContextInitialized
) for all languages.