在 vscode 中使用 gdb 跨平台远程调试 C/C++ 代码
重新编译安装 gdb
要使用 gdb 跨平台远程调试,需要在编译 gdb 的时候开启相关的支持选项,简单的说在 configure 选项中加入 --enable-targets=all。
archlinux 用户可以使用 asp 来获取 gdb 的 PKGBUILD,做如下修改:
build() {
cd gdb-$pkgver
./configure --prefix=/usr --disable-nls \
--enable-targets=all \
--with-system-readline \
--with-python=/usr/bin/python3 \
--with-guile=guile-2.0 \
--with-system-gdbinit=/etc/gdb/gdbinit
make
}然后运行 makepkg -si 编译安装,应该会报签名无法验证的错误,这时候需要我们先导入 PGP 公钥:
gpg --keyserver pgp.ustc.edu.cn --recv-keys 92EDB04BFF325CF3然后再运行 makepkg -si。
