Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propagate the exit code of debugee to exit event #553

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

kezhenxu94
Copy link

Fixes #475

@kezhenxu94
Copy link
Author

@testforstephen can you please take a look at this?

@@ -82,7 +82,7 @@ private void handleDebugEvent(DebugEvent debugEvent, IDebugSession debugSession,
} else if (event instanceof VMDeathEvent) {
vmHandler.disconnectVirtualMachine(event.virtualMachine());
context.setVmTerminated();
context.getProtocolServer().sendEvent(new Events.ExitedEvent(0));
context.getProtocolServer().sendEvent(new Events.ExitedEvent(event.virtualMachine().process().exitValue()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

event.virtualMachine().process() might return null, so a null check is necessary. Additionally, I'm investigating how the exit mechanism works, but it seems my debug session never receives a VMDeathEvent when the process exits. Instead, only a VMDisconnectEvent occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Debugee exit code not correctly reported during event_exited
2 participants