我知道在 Stack Overflow 上有关于 Rust 调试的问题,并且我之前也用过 GDB 调试 Go。但是,我遇到了一个问题,似乎 GDB 找不到调试符号。
请看这个复杂的程序在 main.rs 中:
这表明调试符号的加载可能存在问题。
请看这个复杂的程序在 main.rs 中:
pub fn main () {
println!("run");
}
我使用调试符号进行编译
rustc -g main.rs
然后我运行 GDB
gdb main
这表明调试符号的加载可能存在问题。
现在当我在 GDB 中输入
list
这让我留下了一些不符合我的预期的C代码。
我做错了什么?我的GDB版本是7.7,我使用的是OS X 10.9.2(13C64)。我的rustc版本是rustc 0.11.0-pre(3035d8dfb13077e195eb056568183911c90c1b4b 2014-07-02 21:26:40 +0000)。
看一下gdb --configuration
的输出可能也有帮助:
这个GDB的配置如下: configure --host=x86_64-apple-darwin13.1.0 --target=x86_64-apple-darwin13.1.0 --with-auto-load-dir=:${prefix}/share/auto-load --with-auto-load-safe-path=:${prefix}/share/auto-load --with-expat --with-gdb-datadir=/usr/local/share/gdb (relocatable) --with-jit-reader-dir=/usr/local/lib/gdb (relocatable) --without-libunwind-ia64 --without-lzma --with-python=/System/Library/Frameworks/Python.framework/Versions/2.7 --with-separate-debug-dir=/usr/local/lib/debug (relocatable) --with-zlib --without-babeltrace
rustc 0.11.0-pre (3035d8dfb13077e195eb056568183911c90c1b4b 2014-07-02 21:26:40 +0000)
。 - Christoph-g -C llvm-args="-dwarf-version 4"
解决方法吗? - huongdb --configuration
的输出结果。这个有什么有用的信息吗? - Christoph