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

Improve the call stack display info for not avialable source #72

Merged
merged 1 commit into from
Oct 12, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,16 @@ private Types.StackFrame convertDebuggerStackFrameToClient(StackFrame stackFrame
Types.Source clientSource = this.convertDebuggerSourceToClient(location, context);
String methodName = method.name();
int lineNumber = AdapterUtils.convertLineNumber(location.lineNumber(), context.isDebuggerLinesStartAt1(), context.isClientLinesStartAt1());
if (lineNumber < 0 && method.isNative()) {
// When the current stack frame stops at a native method, the line number is -1.
// Display a tip text "native method" in the Call Stack View.
methodName += "[native method]";
// Line number returns -1 if the information is not available; specifically, always returns -1 for native methods.
if (lineNumber < 0) {
if (method.isNative()) {
// For native method, display a tip text "native method" in the Call Stack View.
methodName += "[native method]";
} else {
// For other unavailable method, such as lambda expression's built-in methods run/accept/apply,
// display "Unknown Source" in the Call Stack View.
clientSource = null;
}
}
return new Types.StackFrame(frameId, methodName, clientSource, lineNumber, 0);
}
Expand Down