Movatterモバイル変換


[0]ホーム

URL:


Version 1.105 is now available! Read about the new features and fixes from September.

Dismiss this update

Debugging with LLDB-MI on macOS

The debug adapter for theC/C++ extension utilizes the machine interface mode for both gdb and lldb. To use this interface in lldb, the extension utilizeslldb-mi. Thelldb-mi executable was built from the GitHublldb-mi repository and has a dependency on theLLDB.framework, which is part of Xcode.

Prerequisites

Thelldb-mi executable requiresLLDB.framework to run.

How to obtain the LLDB.framework

You can get theLLDB.framework one of two ways.

Xcode:

  1. Open theApple App Store.
  2. Search for 'Xcode'.
  3. Select theXcode application and thenInstall.

Xcode Command Line Tools:

  1. Open a terminal.
  2. Runxcode-select --install.
  3. Confirm the prompt.

Example launch.json

Below is an examplelaunch.json debug configuration entry forlldb:

"configurations": [    {        "name":"Launch (lldb)",        "type":"cppdbg",        "request":"launch",        "program":"${workspaceFolder}/a.out",        "args": [],        "stopAtEntry":false,        "cwd":"${workspaceFolder}",        "environment": [],        "externalConsole":false    }]

If you get a Developer Tools Access prompt

You may see a dialog saying "Developer Tools Access needs to take control of another process for debugging to continue."

Developer Tool Access problem

If you get this prompt, you will have to enter your username and password to allow debugging.

If you want to permanently dismiss this prompt, you can run the following command in a terminal:

sudo DevToolsSecurity --enable

Additional configurations

Using an LLDB.framework not installed via Xcode

If you want to use an LLDB.framework that is not installed with Xcode, you need to:

  1. Copy thelldb-mi executable in~/.vscode/extensions/ms-vscode.cpptools-<version>/debugAdapters/lldb-mi/bin to the folder where theLLDB.framework is located.

  2. Add the full path oflldb-mi tomiDebuggerPath in yourlaunch.json configuration.

For example, if you have theLLDB.framework folder located at/Users/default/example/, you would:

  1. Copy~/.vscode/extensions/ms-vscode.cpptools-<version>/debugAdapters/lldb-mi/bin/lldb-mi into/Users/default/example/.

  2. Add the following to your existing configuration:

    "miDebuggerPath":"/Users/default/example/lldb-mi"

Using a custom-built lldb-mi

If you built your ownlldb-mi, you can use it by settingmiDebuggerPath to the full path of the executable.

References

2/12/2020

[8]ページ先頭

©2009-2025 Movatter.jp