Debugging 使用GDB调试无法查找D个程序符号

Debugging 使用GDB调试无法查找D个程序符号,debugging,gdb,d,symbol-table,Debugging,Gdb,D,Symbol Table,我已成功地在上构建并安装了Ian Buclaw(ibuclaw)的GDB分支 我的Ubuntu 13.10 x86_64上的github,带有默认编译器GCC4.8.1 否则,我必须从bin子目录中删除文件ld DMD在链接阶段抱怨系统根问题 当我编译我的测试程序并通过GDB运行它时 问题 我可以在main开始时执行break main、run和GDB停止,但是当我执行next时,我会得到以下不希望的输出 Single stepping until exit from function ma

我已成功地在上构建并安装了Ian Buclaw(ibuclaw)的GDB分支 我的Ubuntu 13.10 x86_64上的github,带有默认编译器GCC4.8.1

否则,我必须从
bin
子目录中删除文件
ld
DMD在链接阶段抱怨系统根问题

当我编译我的测试程序并通过GDB运行它时 问题

我可以在
main
开始时执行
break main
、run和GDB停止,但是当我执行
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
GDB不应该在这里工作吗

我的测试程序编译为

dmd -debug -g -gs -wi t_array.d -oft_array
没有任何警告或错误。我也试着假装是C

同样的结果

此外,当我执行
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);
}

对于我来说,使用monodevelop和GDB调试器(不是用于D的GDB调试器)效果很好,应该使用start命令而不是break main。更多详情请访问您的dlangs论坛帖子:

当我像上面那样运行它时,在GDB中执行
打印符号时,几乎没有任何D符号正确地显示名称和它们的值。这是ibuclaw的GDB的当前状态还是我遗漏了什么?GDB还不能要求所有的D符号。Iain Buclaw(GDC项目的核心开发人员)最近做了一些改进,有望很快被合并到主GDB代码中,这将对我们有很大帮助。你试过用GDC编译你的D程序吗?
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);
}