DuckDB 源码配置

DuckDB 源码配置

源码编译

sudo apt-get update && sudo apt-get install -y git g++ cmake ninja-build libssl-dev
git clone git@github.com:duckdb/duckdb.git
cd duckdb
make debug/release

issue

当我们编译 debug 版本的时候可能会出现如下图所示的问题:

img

vscode 调试配置

到源码下的 examples/embedded-c++ 文件夹,修改 CMakeLists.txt 文件

img

添加第 7 行和 第 9 行代码,用于添加调试信息。

cmake .
make -j

launch.json 文件设置

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
        "name": "(gdb) start",
        "type": "cppdbg",
        "request": "launch",
        "program":"${workspaceFolder}/examples/embedded-c++/example",
        "args": [],
        "stopAtEntry": false,
        "cwd":"${fileDirname}",
        "environment": [],
        "externalConsole": false,
        "MIMode":"gdb",
        "setupCommands":[
            {
                "description":"为gdb 启用整齐打印",
                "text":"-enable-pretty-printing",
                "ignoreFailures": true
            },
            {
                "description": "将反汇编风格设置为Intel",
                "text": "-gdb-set disassembly-flavor intel",
                "ignoreFailures": true
            }
        ]
        }
    ]
}

Reference

posted on 2024-05-16 22:42  LambdaQ  阅读(12)  评论(0编辑  收藏  举报