Skip to content
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