2011-01-24 84 views
2



簡短問題:在gdb(我有gdb 7.2)中是否支持D2?

長的故事:我編下一個小程序...D2和gdb問題

 

// file main.d 
int glVar = 0xAAAAAAAA; 

void main() 
{ 
glVar = 0xBBBBBBBB; 
} 
 

...使用命令 「DMD-GC -debug main.d」;
然後我加載到GDB,並試圖對其進行調試:

 
[email protected]:~/proj/d_gdb_test$ gdb main 
GNU gdb (GDB) 7.2-ubuntu 
Copyright (C) 2010 Free Software Foundation, Inc. 
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it. 
There is NO WARRANTY, to the extent permitted by law. Type "show copying" 
and "show warranty" for details. 
This GDB was configured as "i686-linux-gnu". 
For bug reporting instructions, please see: 
... 
Reading symbols from /home/vnm/proj/d_gbb_test/main...done. 
(gdb) b main 
Breakpoint 1 at 0x804b667 
(gdb) r 
Starting program: /home/vnm/proj/d_gbb_test/main 
[Thread debugging using libthread_db enabled] 

Breakpoint 1, 0x0804b667 in main() 
(gdb) info line 
No line number information available. 
(gdb) info variables glVar 
All variables matching regular expression "glVar": 

File main.d: 
int _D4main5glVari; 

爲什麼GDB不能顯示在線信息和爲什麼它顯示了在錯位的形式符號?這是軟件問題還是我做錯了什麼?

+0

這可能是相關的:http://stackoverflow.com/questions/1581560/how-do-i-get-gdb-working-with-d-programs-under-linux – jgottula 2011-01-24 23:12:08

回答

4

gdb支持D從7.2開始。所以,你可以用gdb 7.2來調試D程序。

現在,這並不意味着支持是完美的 - 事實上遠非如此。例如,我不確定你能否正確打印字符串。如果它不去除D符號,這並不令人意外。所以,它有效,但它遠非完美。

+0

一些在digitalmars.D中的主題的澄清.learn新聞組:http://www.mail-archive.com/[email protected]/msg09765.html – cybevnm 2011-01-26 21:02:56