如何在下载并安装 lldbCode 后在 VS Code 中设置断点?

问题描述 投票:0回答:0

我不知道在 VS Code 中设置断点。谷歌搜索问题后我所做的事情包括:

  1. 转到代码->首选项->设置,搜索“允许无处不在的断点”,并勾选它。

  2. 下载并安装 lldbCode.

  3. 使用 -g 标志进行编译。

但是,我仍然无法让断点工作。我可以看到红点。然而,在按下 F5 后,调试器会检查整个程序并立即生成输出。

下面是launch.json, main.c, 和我用来测试的一个简单的makefile

我错过了什么吗?或者这是我不知道的某种错误。

任何帮助将不胜感激。

启动.json

"version": "0.2.0",
"configurations": [
        
        {
            "type": "lldb",
            "request": "launch",
            "name": "Debug",
            "program": "${workspaceFolder}/hello",
            "args": [],
            "cwd": "${workspaceFolder}"
        }
    ]

main.c

#include <stdio.h>

void printHello();

int main() {
  printf("aHello World\n");
  printf("bHello World\n");
  printf("cHello World\n");

  printHello();
}

void printHello() {
  printf("\n1 hello\n");
  printf("2 hello\n");
}

制作文件

hellomake: main.c
    clang -g -o hello main.c

操作系统:macOS High Sierra 版本 10.13.6

visual-studio-code breakpoints
© www.soinside.com 2019 - 2024. All rights reserved.