【发布时间】:2014-01-09 17:49:11
【问题描述】:
我已经成功构建并安装了 Ian Buclaw 的 (ibuclaw) GDB 分支 我的 Ubuntu 13.10 x86_64 上的 github 及其默认编译器 GCC 4.8.1。
否则我必须从 bin 子目录中删除文件 ld
DMD 抱怨链接阶段存在 sysroot 问题。
当我编译我的测试程序并通过 GDB 运行它时,我有 问题。
我可以做break main,运行,GDB 在main 的开头停止,但是当我做next 时,我得到以下不想要的输出
Single stepping until exit from function main,
which has no line number information.
0x00007ffff760ede5 in __libc_start_main () from
/lib/x86_64-linux-gnu/libc.so.6
ibuclaw 的 GDB 不应该在这里工作吗?
我的测试程序编译为
dmd -debug -g -gs -wi t_array.d -oft_array
没有任何警告或错误。我也尝试过假装是C
dmd -debug -g -gc -gs -wi t_array.d -oft_array
结果相同。
当我做b 后跟制表符时,大多数符号在
完成列表不会被分解。
我的测试程序是这样的
import std.stdio, std.algorithm;
void main(string args[]) {
int[] x;
writeln(x.sizeof);
if (x) {
writeln("Here!");
} else {
writeln("There!");
}
int xx[2];
auto xc = xx;
xc[0] = 1;
writeln(xx);
writeln(xc);
int[2] xx_;
auto hit = x.find(1);
if (hit) {
writeln("Hit: ", hit);
} else {
writeln("No hit");
}
int[2] z; // arrays are zero initialized
writeln(z);
assert([].ptr == null);
assert("ab"[$..$] == []);
auto p = "ab"[$..$].ptr;
writeln(p);
assert(p != null);
}
【问题讨论】:
标签: debugging gdb d symbol-table