【问题标题】:d2: not getting any backtrace infod2:没有得到任何回溯信息
【发布时间】:2012-05-10 05:18:20
【问题描述】:

我正在使用 gtkd 包装器生成器,并遇到 std.conv 异常,我根本无法获得任何符号调试信息。我已经用调试符号编译了:

$ dmd -gc -debug utils/HTODConvert.d utils/WrapperIF.d utils/funct.d utils/DefReader.d utils/GtkWrapper.d utils/HtmlStrip.d utils/IndentedStringBuilder.d utils/convparms.d utils/GtkDClass.d -ofgtkwrap 

但回溯只是内存地址列表:

std.conv.ConvException@/usr/include/d/std/conv.d(1779): Unexpected ' ' when converting from type string to type int
----------------
/home/martin/code/d/GtkD/wrap/gtkwrap() [0x805c4ab]
/home/martin/code/d/GtkD/wrap/gtkwrap() [0x805c57a]
/home/martin/code/d/GtkD/wrap/gtkwrap() [0x806d49e]
/home/martin/code/d/GtkD/wrap/gtkwrap() [0x806924e]
/home/martin/code/d/GtkD/wrap/gtkwrap() [0x8068c4a]
/home/martin/code/d/GtkD/wrap/gtkwrap() [0x8066aed]
/home/martin/code/d/GtkD/wrap/gtkwrap() [0x8066824]
/home/martin/code/d/GtkD/wrap/gtkwrap() [0x806388f]
/home/martin/code/d/GtkD/wrap/gtkwrap() [0x806367c]
/home/martin/code/d/GtkD/wrap/gtkwrap() [0x805e988]
/home/martin/code/d/GtkD/wrap/gtkwrap() [0x805e910]
/home/martin/code/d/GtkD/wrap/gtkwrap() [0x805e793]
/home/martin/code/d/GtkD/wrap/gtkwrap() [0x805d6f5]
/home/martin/code/d/GtkD/wrap/gtkwrap() [0x8060176]
/home/martin/code/d/GtkD/wrap/gtkwrap() [0x8071140]
/home/martin/code/d/GtkD/wrap/gtkwrap() [0x8070c50]
/home/martin/code/d/GtkD/wrap/gtkwrap() [0x8071182]
/home/martin/code/d/GtkD/wrap/gtkwrap() [0x8070c50]
/home/martin/code/d/GtkD/wrap/gtkwrap() [0x8070c04]
/lib/libc.so.6(__libc_start_main+0xf5) [0xb7dce3d5]

这是32位linux下的

$ uname -a
Linux mercury 3.3.2-1-ARCH #1 SMP PREEMPT Sat Apr 14 10:08:43 UTC 2012 i686 Intel(R) Core(TM)2 Duo CPU P8600 @ 2.40GHz GenuineIntel GNU/Linux

$ dmd -v
DMD32 D Compiler v2.059

【问题讨论】:

    标签: linux d backtrace


    【解决方案1】:

    确保您的 dmd.conf 在其 DFLAGS 中包含 -L--export-dynamic。我相信 dmd 提供的版本有它,但是没有它,您将无法获得函数名称,因此您的 dmd.conf 很可能会丢失它。

    【讨论】:

      【解决方案2】:

      使用 GDB 启动您的程序,您将获得正确的堆栈跟踪,不幸的是我不知道任何其他方式(您需要使用 -g 和 -gc 编译)。

      【讨论】:

        猜你喜欢
        • 2023-01-25
        • 1970-01-01
        • 1970-01-01
        • 2022-11-22
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-12-06
        • 1970-01-01
        相关资源
        最近更新 更多