<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 18 October 2013 21:58, Iain Buclaw <span dir="ltr"><<a href="mailto:ibuclaw@ubuntu.com" target="_blank">ibuclaw@ubuntu.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class=""><div class="h5">On 18 October 2013 12:43, Bruno Medeiros <<a href="mailto:brunodomedeiros%2Bdng@gmail.com">brunodomedeiros+dng@gmail.com</a>> wrote:<br>
> On 16/10/2013 22:21, Andrei Alexandrescu wrote:<br>
>><br>
>> On 10/16/13 5:38 AM, Bruno Medeiros wrote:<br>
>>><br>
>>> On 08/10/2013 14:18, Alexander Bothe wrote:<br>
>>>><br>
>>>> Are there any plans/tricks/hacks on how to get programs built<br>
>>>> with dmd debuggable with gdb? Then we also could release the<br>
>>>> addin for Windows as well!<br>
>>>> (Afaik I asked the same question some time ago, but well, perhaps<br>
>>>> something did change over the time :-))<br>
>>><br>
>>><br>
>>> I was wondering the same as well... But from the lack of answers I think<br>
>>> not much can be done? :/<br>
>><br>
>><br>
>> What are the matters involved? I did get basic debugging sessions<br>
>> working, but I forgot whether it was dmd or gdc.<br>
>><br>
>> Andrei<br>
>><br>
><br>
> If that was under Windows, it must have been GDC then. The debug format that<br>
> DMD emits on Windows (OMF for x32 and COFF for x64, if I'm correct) is not<br>
> understood by GDB, which I guess only understands DWARF.<br>
><br>
><br>
<br>
</div></div>GCC is able to emit COFF object code - and GDB can read COFF debug<br>
code - though admitedly COFF is a woeful excuse of an object/debug<br>
file format. :o)<br></blockquote><div><br></div><div>DMD for Win64 uses COFF so it's compatible with the windows ecosystem at large (and ideally Win32 will move that way too in the future). Almost all dev tools/environments/libraries are distributed as MS-COFF libs.</div>
<div><br></div><div>GCC COFF output isn't very useful in the windows context. I tried it. It tried to link, but GCC produces countless intrinsic calls to the gnu runtime libs, and they are quite incompatible with the MS CRT. It also seems to populate the COFF objects with DWARF debug info instead of CV8 that VisualC's linker extracts and writes into a PDB file, so you can't debug GDC's COFF output with standard tools.</div>
<div><br></div><div>So if you're not interacting with the MS ecosystem (the de facto standard on windows), then you might as well just use elf + dwarf from GCC.</div><div><br></div><div>I guess the usefulness of Mono-D in windows is an environment that DOES support building+linking+debugging elf+dwarf based projects. This does exclude DMD, since it primarily tries to work in conjunction with the OS standards, but there's plenty of reasons to want to work with GDC in windows, and Mono-D would be the go-to environment for that.</div>
<div><br></div><div>Ideally I'd like a command-line choice of object+debug format from all compilers so they can work in either of windows's fragmented ecosystems... but due to the intrinsic calls to glibc thing, GDC doesn't seem like it will ever be a good match for developing windows code. LDC seems promising that it may support either ecosystem, and DMD could theoretically write ELF+DWARF on a command line switch (it obviously has code to write those formats), but I haven't seen much demand for it.</div>
</div></div></div>