使用GDB调试无法查找D编程符号

时间:2014-01-09 17:49:11

标签: debugging gdb d symbol-table

我已成功构建并安装了Ian Buclaw(ibuclaw)GDB分支机构 我的Ubuntu 13.10 x86_64上的github及其默认编译器GCC 4.8.1。

我必须从ld子目录中删除文件bin 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);
}

1 个答案:

答案 0 :(得分:3)

使用monodevelop和GDB调试器(不适用于D的gdb调试器)对我来说效果很好,你应该使用start命令而不是break main。你的更多细节dlang论坛帖子: http://forum.dlang.org/thread/avbpulzptddlekkczwse@forum.dlang.org