vadimcn / codelldb

A native debugger extension for VSCode based on LLDB
https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb
MIT License
2.43k stars 237 forks source link

Remote debugging not working #934

Closed lijh8 closed 1 year ago

lijh8 commented 1 year ago

OS: 12.6.5 (21G531) VSCode version: Version: 1.78.1 (Universal) CodeLLDB version: v1.9.1 Compiler: GNU gdb (Debian 10.1-1.7) 10.1.90.20210103-git Debuggee: a.out, through Remote - SSH

Remote - SSH: ms-vscode-remote.remote-ssh: v0.102.0

The following configuration works on macOS and Debian without remote debugging. But remote debugging does not work. For example, I'm on macOS, opening a remote workspace directory on Debian through Remote - SSH. Installed codeLLDB on both local and remote machines. On macOS, remote debugging workspace on Debian Linux does not work.

ENOENT: no such file or directory, stat '/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/LLDB'

Initial debug configuration: {
  type: 'lldb',
  request: 'launch',
  name: 'Debug',
  program: '${workspaceFolder}/src/build/${fileBasenameNoExtension}/${fileBasenameNoExtension}',
  args: [],
  cwd: '${fileDirname}',
  preLaunchTask: 'make',
  MIMode: 'lldb',
  miDebuggerPath: '/usr/bin/gdb',
  __configurationTarget: 6
}
Resolved debug configuration: {
  type: 'lldb',
  request: 'launch',
  name: 'Debug',
  program: '${workspaceFolder}/src/build/${fileBasenameNoExtension}/${fileBasenameNoExtension}',
  args: [],
  cwd: '${fileDirname}',
  preLaunchTask: 'make',
  MIMode: 'lldb',
  miDebuggerPath: '/usr/bin/gdb',
  __configurationTarget: 6,
  relativePathBase: '/home/ljh/Documents/hello_cpp',
  _adapterSettings: {
    displayFormat: 'auto',
    showDisassembly: 'auto',
    dereferencePointers: true,
    suppressMissingSourceFiles: true,
    evaluationTimeout: 5,
    consoleMode: 'commands',
    sourceLanguages: null,
    terminalPromptClear: null,
    evaluateForHovers: true,
    commandCompletions: true,
    reproducer: false
  }
}
Error: ENOENT: no such file or directory, stat '/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/LLDB'

.vscode/launch.json: 

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "lldb", // "lldb"
      "request": "launch",
      "name": "Debug",
      "program": "${workspaceFolder}/src/build/${fileBasenameNoExtension}/${fileBasenameNoExtension}", //new
      "args": [],
      "cwd": "${fileDirname}",
      "preLaunchTask": "make", //new
      "MIMode": "lldb",
      "miDebuggerPath": "/usr/bin/gdb",

    }
  ]
}

.vscode/tasks.json: 

{
  // See https://go.microsoft.com/fwlink/?LinkId=733558
  // for the documentation about the tasks.json format
  "version": "2.0.0",
  "tasks": [
    {
      "label": "make", //new
      "type": "shell",
      "options": {
        "cwd": "${workspaceFolder}/src",
      },
      "command": "/usr/bin/make", //new
    }
  ]
}
vadimcn commented 1 year ago

Please provide a verbose log of the debug session.

lijh8 commented 1 year ago

Please provide a verbose log of the debug session.

Hi,

Initial debug configuration: {
  type: 'lldb',
  request: 'launch',
  name: 'Debug',
  program: '${workspaceFolder}/src/build/${fileBasenameNoExtension}/${fileBasenameNoExtension}',
  args: [],
  cwd: '${fileDirname}',
  preLaunchTask: 'make',
  MIMode: 'lldb',
  miDebuggerPath: '/usr/bin/gdb',
  __configurationTarget: 6
}
Resolved debug configuration: {
  type: 'lldb',
  request: 'launch',
  name: 'Debug',
  program: '${workspaceFolder}/src/build/${fileBasenameNoExtension}/${fileBasenameNoExtension}',
  args: [],
  cwd: '${fileDirname}',
  preLaunchTask: 'make',
  MIMode: 'lldb',
  miDebuggerPath: '/usr/bin/gdb',
  __configurationTarget: 6,
  relativePathBase: '/home/ljh/Documents/hello_cpp',
  _adapterSettings: {
    displayFormat: 'auto',
    showDisassembly: 'auto',
    dereferencePointers: true,
    suppressMissingSourceFiles: true,
    evaluationTimeout: 5,
    consoleMode: 'commands',
    sourceLanguages: null,
    terminalPromptClear: null,
    evaluateForHovers: true,
    commandCompletions: true,
    reproducer: false
  }
}
Error: ENOENT: no such file or directory, stat '/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/LLDB'

Screen Shot 2023-05-12 at 2 14 23 AM

lijh8 commented 1 year ago

ENOENT: no such file or directory, stat '/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/LLDB'

Sorry, the error seems caused by this in my settings. The debugging through remote - ssh works now.

"lldb.library": "/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/LLDB",