<div dir="ltr">On 22 October 2013 23:48, Iain Buclaw <span dir="ltr"><<a href="mailto:ibuclaw@ubuntu.com" target="_blank">ibuclaw@ubuntu.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 22 October 2013 13:29, Manu <<a href="mailto:turkeyman@gmail.com">turkeyman@gmail.com</a>> wrote:<br>
> On 18 October 2013 21:58, Iain Buclaw <<a href="mailto:ibuclaw@ubuntu.com">ibuclaw@ubuntu.com</a>> wrote:<br>
>><br>
>> On 18 October 2013 12:43, Bruno Medeiros <<a href="mailto:brunodomedeiros%2Bdng@gmail.com">brunodomedeiros+dng@gmail.com</a>><br>
>> 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<br>
>> >>> 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<br>
>> > that<br>
>> > DMD emits on Windows (OMF for x32 and COFF for x64, if I'm correct) is<br>
>> > not<br>
>> > understood by GDB, which I guess only understands DWARF.<br>
>> ><br>
>> ><br>
>><br>
>> 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>
><br>
><br>
> DMD for Win64 uses COFF so it's compatible with the windows ecosystem at<br>
> large (and ideally Win32 will move that way too in the future). Almost all<br>
> dev tools/environments/libraries are distributed as MS-COFF libs.<br>
><br>
> GCC COFF output isn't very useful in the windows context. I tried it. It<br>
> tried to link, but GCC produces countless intrinsic calls to the gnu runtime<br>
> libs, and they are quite incompatible with the MS CRT. It also seems to<br>
> populate the COFF objects with DWARF debug info instead of CV8 that<br>
> VisualC's linker extracts and writes into a PDB file, so you can't debug<br>
> GDC's COFF output with standard tools.<br>
><br>
<br>
</div></div>Incompatibility with MS CRT has nothing to do with COFF. :o)<br></blockquote><div><br></div><div>I didn't say that it did.</div><div>It's a practical problem. it makes GCC COFF output kinda pointless.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Also, it's not likely DWARF debug information that it emits, as the<br>
COFF object format defines its own intrinsic symbolic debug format.<br>
GDB can't read CV8/PDB.<br></blockquote><div><br></div><div>Well I can say from experience that GDC built to output COFF was able to link using the MS linker (although there are loads of problems due to CRT conflicts), but it didn't see the debug information at all.</div>
<div>So whatever it writes is apparently not recognised by link.exe (mustn't be VC8?)...</div><div><br></div><div>I'm aware GDB can't read CV8/PDB, I'm not sure what your point is?</div><div>I was just adding detail to your post about the state of COFF support in Windows.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
If you are using GCC, you'll be using the GCC toolchain.  If you are<br>
using MSVC, you'll be using the MSVC toolchain.  It's as black and<br>
white as that.<br></blockquote><div><br></div><div>Yes, that's basically the point I was making... and it influences your choice of D compilers, and tooling, hence Mono-D has a place in Windows even though it may not support DMD for debugging.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
> So if you're not interacting with the MS ecosystem (the de facto standard on<br>
> windows), then you might as well just use elf + dwarf from GCC.<br>
><br>
<br>
</div>Except that GCC does not emit ELF on windows.  ;-)<br></blockquote><div><br></div><div>Really? What is it?</div><div>Well whatever object format it is, it seems it's not COFF by default, and appears it does support DWARF since I've debugged GCC code with GDB before.</div>
</div></div></div>