Skip to content

Conversation

@mfussenegger
Copy link
Contributor

@mfussenegger mfussenegger commented Dec 4, 2025

Follow up to:

With the change to set the line number to 0 the jdiLineNumber !=
lspFrame.line comparison can evaluate to true:

dap> lspFrame
Types$StackFrame@78
  column: 1
  id: 6
  line: 0
  name: "0x000000002f0bc000.invokeVirtual(Object,Object)"
  presentationHint: "subtle"
  source: null

dap> jdiLineNumber
-1

source being null caused an NPE

Fixes #612

Follow up to:

- microsoft#614
- microsoft#609

With the change to set the line number to 0 the jdiLineNumber !=
lspFrame.line comparison can evaluate to true:

    dap> lspFrame
    Types$StackFrame@78
      column: 1
      id: 6
      line: 0
      name: "0x000000002f0bc000.invokeVirtual(Object,Object)"
      presentationHint: "subtle"
      source: null

    dap> jdiLineNumber
    -1

`source` being null caused an NPE
Comment on lines 116 to +117
int jdiLineNumber = AdapterUtils.convertLineNumber(jdiFrame.lineNumber, context.isDebuggerLinesStartAt1(), context.isClientLinesStartAt1());
if (jdiLineNumber != lspFrame.line) {
if (jdiLineNumber != lspFrame.line && lspFrame.source != null) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could also change convertLineNumber to return 0 as is?
No idea what other implications that might have.

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.

Cannot read field "path" because "lspFrame.source" is null

1 participant