On 22 October 2013 13:29, Manu <turkey...@gmail.com> wrote: > On 18 October 2013 21:58, Iain Buclaw <ibuc...@ubuntu.com> wrote: >> >> On 18 October 2013 12:43, Bruno Medeiros <brunodomedeiros+...@gmail.com> >> wrote: >> > On 16/10/2013 22:21, Andrei Alexandrescu wrote: >> >> >> >> On 10/16/13 5:38 AM, Bruno Medeiros wrote: >> >>> >> >>> On 08/10/2013 14:18, Alexander Bothe wrote: >> >>>> >> >>>> Are there any plans/tricks/hacks on how to get programs built >> >>>> with dmd debuggable with gdb? Then we also could release the >> >>>> addin for Windows as well! >> >>>> (Afaik I asked the same question some time ago, but well, perhaps >> >>>> something did change over the time :-)) >> >>> >> >>> >> >>> I was wondering the same as well... But from the lack of answers I >> >>> think >> >>> not much can be done? :/ >> >> >> >> >> >> What are the matters involved? I did get basic debugging sessions >> >> working, but I forgot whether it was dmd or gdc. >> >> >> >> Andrei >> >> >> > >> > If that was under Windows, it must have been GDC then. The debug format >> > that >> > DMD emits on Windows (OMF for x32 and COFF for x64, if I'm correct) is >> > not >> > understood by GDB, which I guess only understands DWARF. >> > >> > >> >> GCC is able to emit COFF object code - and GDB can read COFF debug >> code - though admitedly COFF is a woeful excuse of an object/debug >> file format. :o) > > > 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. > > 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. >
Incompatibility with MS CRT has nothing to do with COFF. :o) Also, it's not likely DWARF debug information that it emits, as the COFF object format defines its own intrinsic symbolic debug format. GDB can't read CV8/PDB. If you are using GCC, you'll be using the GCC toolchain. If you are using MSVC, you'll be using the MSVC toolchain. It's as black and white as that. > 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. > Except that GCC does not emit ELF on windows. ;-) -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0';