DMD on Linux?

Cristian Vlasceanu cristian at zero-bugs.com
Mon Apr 2 22:23:27 PDT 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 at 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:
> 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 at capetown
>> Very strange, indeed DMD 1.010 seems to work fine on one Ubuntu x86_64
>> installation, but it acts up on my Mandriva 2007 and Suse 10.0 systems.
>>
>> As for the stack trace problems, what is the behavior that you are seeing
>> in Zero?
>>
>> Thanks
>>    Cristian
> 
> 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.
> 
> Additionally, if I open a file by hand after loading a program, I can't set
> a breakpoint in it.  If I step into a function in that file, it opens
> another tab with the same file and I'm able to set breakpoints only in that
> one.  I'd be nice if there was a dropdown or something with a list of all
> the files the program refers to and I can select them to open them.
> 


More information about the Digitalmars-d-debugger mailing list