From 3c1b7faf79486d349ae3ec86d7a4d8b9ad5311ab Mon Sep 17 00:00:00 2001 From: Fan Date: Fri, 20 Sep 2024 16:36:42 +0800 Subject: [PATCH] Add vscode debug config with lldb on Mac M chips --- .vscode/launch.json | 12 ++++++++++++ README.md | 4 ++-- README_CN.md | 4 ++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 5bd3f02..5091d7a 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -38,6 +38,18 @@ "ignoreFailures": true } ] + }, + { + "name": "Mac lldb 启动", + "type": "cppdbg", + "request": "launch", + "cwd": "${workspaceFolder}", + "program": "${workspaceFolder}/bin/KF-GINS", + "args": ["./dataset/kf-gins.yaml"], + "stopAtEntry": true, + "environment": [], + "externalConsole": false, + "MIMode": "lldb", } ] } \ No newline at end of file diff --git a/README.md b/README.md index 8c67208..2921a6e 100644 --- a/README.md +++ b/README.md @@ -137,10 +137,10 @@ sudo apt-get install gdb ``` The debug operation is as follows: -- Set compiler: open the Command Palette (Ctrl+Shift+P) and type "CMake: Select a Kit", select GCC for Linux or select the MSVC compilier for Windows +- Set compiler: open the Command Palette (Ctrl+Shift+P) and type "CMake: Select a Kit", select GCC for Linux, select "clang 15.0.0 arm64-apple-darwin23.5.0"(or above) for MacOS with M-series Chip or select the MSVC compilier for Windows - Set compile parameter: type "CMake: Select Variant" in the Command Palette, select **Debug** - Configure CMake: type "CMake: Configure" in the Command Palette, Compile Project: type "CMake: Build" in the Command Palette -- Set debug startup option: click the fourth button on the left side of VSCode to open the "Run and Debug" menu (or the shortcut key Ctrl+Shift+D), and select "Windows 启动" or "Linux gdb 启动" at the top of this menu window. +- Set debug startup option: click the fourth button on the left side of VSCode to open the "Run and Debug" menu (or the shortcut key Ctrl+Shift+D), and select "Windows 启动", "Linux gdb 启动" or "Mac lldb 启动" at the top of this menu window. - Start debugging, click the green triangle symbol at the top of the left window (or the shortcut key F5) to start debugging. diff --git a/README_CN.md b/README_CN.md index 3babe72..9f9ff86 100644 --- a/README_CN.md +++ b/README_CN.md @@ -137,10 +137,10 @@ sudo apt-get install gdb 调试操作如下: -- 选择编译器,打开命令面板(Ctrl+Shift+P)输入"CMake: Select a Kit",Linux选择gcc编辑器,Windows选择MSVC编译器 +- 选择编译器,打开命令面板(Ctrl+Shift+P)输入"CMake: Select a Kit",Linux选择gcc编辑器,Windows选择MSVC编译器, MacOS M系列芯片选择”clang 15.0.0 arm64-apple-darwin23.5.0“或更高版本 - 设置编译参数,命令面板输入"CMake: Select Variant",选择 **Debug** - 配置CMake,命令面板输入"CMake: Configure",编译工程,命令面板输入"CMake: Build" -- 选择调试启动选项,点击VSCode左侧第四个按钮打开“运行和调试”菜单(或快捷键Ctrl+Shift+D),左侧窗口上方选择“Windows 启动” 或 “Linux gdb 启动” +- 选择调试启动选项,点击VSCode左侧第四个按钮打开“运行和调试”菜单(或快捷键Ctrl+Shift+D),左侧窗口上方选择“Windows 启动”, “Linux gdb 启动” 或 ”Mac lldb 启动“ - 开始调试,点击左侧窗口上方的 绿色三角符号 开始调试(或快捷键F5调试) ## 2 KF-GINS使用