|
Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript electronics |
digitalmars.D.debugger - DMD on Linux?
Hello, Has anyone tried debugging a DMD-compiled program on Linux recently? I am seeing incorrect source file paths in Zero and verified with dwarfdump and readelf that the DWARF info generated by DMD is wrong. The funny thing is that this used to work in 0.174 or so. Anyone having the same experience or am I seeing things? I have already email Walter about this issue and as he is slow as usual in addressing Linux back-end issues I was thinking about hacking Zero so that if it cannot locate the source (it is just the path that's wrong, the filename is okay) then go recursively search for it in the parent dir tree of the binary. Of course it assumes that one builds their executables in the source dir tree. Thoughts? Cristian Vlasceanu http://www.zerobugs.org Apr 02 2007
Cristian Vlasceanu wrote:Hello, Has anyone tried debugging a DMD-compiled program on Linux recently? I am seeing incorrect source file paths in Zero and verified with dwarfdump and readelf that the DWARF info generated by DMD is wrong. The funny thing is that this used to work in 0.174 or so. Anyone having the same experience or am I seeing things? I have already email Walter about this issue and as he is slow as usual in addressing Linux back-end issues I was thinking about hacking Zero so that if it cannot locate the source (it is just the path that's wrong, the filename is okay) then go recursively search for it in the parent dir tree of the binary. Of course it assumes that one builds their executables in the source dir tree. Thoughts? Cristian Vlasceanu http://www.zerobugs.org Apr 02 2007
John Demme Wrote:Of course it assumes that one builds their executables in the source dir tree. Thoughts? Apr 02 2007
John Demme Wrote:I was debugging a program built with DMD 1.010 the other day and Zero appeared to be finding the source files fine, though. I'm using Zero: Zero (v1.5.41 Jan 31 2007 12:40:08) The Linux Application Debugger (Linux 2.6.19-gentoo-r2/x86_64) root capetown Apr 02 2007
Cristian Vlasceanu wrote:John Demme Wrote:I was debugging a program built with DMD 1.010 the other day and Zero appeared to be finding the source files fine, though. I'm using Zero: Zero (v1.5.41 Jan 31 2007 12:40:08) The Linux Application Debugger (Linux 2.6.19-gentoo-r2/x86_64) root capetown Apr 02 2007
After more research, it appears that the bug that I am seeing is not the
DMD compiler's fault:
dmd -g -c nested.d
readelf -w nested.o
produces:
[snip]
<0><b>: Abbrev Number: 1 (DW_TAG_compile_unit)
DW_AT_stmt_list : 0
DW_AT_name : nested.d
DW_AT_comp_dir : (indirect string, offset: 0x0):
/home/cristiv/workspace/d
DW_AT_producer : Digital Mars D v1.010
[/snip]
So far we're okay! DW_AT_comp_dir is correct
dmd nested.o
(invokes) gcc nested.o -o nested -m32 -lphobos -lpthread -lm
readelf -w nested
produces:
[snip]
<0><121>: Abbrev Number: 1 (DW_TAG_compile_unit)
DW_AT_stmt_list : 0xc7
DW_AT_name : nested.d
DW_AT_comp_dir : (indirect string, offset: 0x0): short int
DW_AT_producer : Digital Mars D v1.010
DW_AT_language : 19 (Unknown: 13)
[/snip]
Directory is "short int"??? Obviously the linker screwed it up.
[cristiv orcas:~/workspace/d]$ gcc -v
Using built-in specs.
Target: x86_64-mandriva-linux-gnu
Configured with: ../configure --prefix=/usr --libexecdir=/usr/lib
--with-slibdir=/lib64 --mandir=/usr/share/man --infodir=/usr/share/info
--enable-shared --enable-threads=posix --enable-checking=release
--enable-languages=c,c++,ada,fortran,objc,obj-c++,java
--host=x86_64-mandriva-linux-gnu --with-cpu=generic --with-system-zlib
--enable-long-long --enable-__cxa_atexit --enable-clocale=gnu
--disable-libunwind-exceptions --enable-java-awt=gtk
--with-java-home=/usr/lib/jvm/java- 1.4.2-gcj-1.4.2.0/jre
--enable-gtk-cairo --enable-ssp --disable-libssp
Thread model: posix
gcc version 4.1.1 20060724 (prerelease) (4.1.1-3mdk)
John Demme wrote:
Apr 02 2007
John Demme Wrote:One of two things: -The current stack frame is shown correctly (except the symbol name is not demangled) and the next frame will be 000000000002 (or some other low number) then ???. These are the only two stack frames shown -Also, sometimes the same thing happens, but the second line is a line in some system library. Apr 03 2007
|