October 17, 2013 Re: Mono-D 0.5.4.1 - Build, completion & other fixes + Unittests via rdmd | ||||
---|---|---|---|---|
| ||||
Posted in reply to Timothee Cour | On 2013-10-17 09:42, Timothee Cour wrote: > on OSX, lldb has better support than gdb. Not for D. Break points doesn't work in LLDB but they do work in GDB. The backtrace seem to be slightly incorrect as well. The line number for frame 0 is off by one. Printing a variable doesn't seem to work. -- /Jacob Carlborg |
October 18, 2013 Re: Mono-D 0.5.4.1 - Build, completion & other fixes + Unittests via rdmd | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dicebot | On 16/10/2013 13:42, Dicebot wrote: > On Wednesday, 16 October 2013 at 12:38:40 UTC, 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? :/ > > Well I do debug `dmd -gc` programs with gdb relatively frequently. What > exactly is of interest? We are talking about DMD+GDB on Windows. -- Bruno Medeiros - Software Engineer |
October 18, 2013 Re: Mono-D 0.5.4.1 - Build, completion & other fixes + Unittests via rdmd | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | 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. -- Bruno Medeiros - Software Engineer |
October 18, 2013 Re: Mono-D 0.5.4.1 - Build, completion & other fixes + Unittests via rdmd | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bruno Medeiros | On 18 October 2013 12:43, Bruno Medeiros <brunodomedeiros+dng@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) Regards -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0'; |
October 22, 2013 Re: Mono-D 0.5.4.1 - Build, completion & other fixes + Unittests via rdmd | ||||
---|---|---|---|---|
| ||||
Posted in reply to Iain Buclaw | On 18/10/2013 12:58, Iain Buclaw wrote: > On 18 October 2013 12:43, Bruno Medeiros <brunodomedeiros+dng@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) > > Regards > Thanks for the clarification, I didn't know GDB could read COFF as well. My main dev machine is 32 bit (old yeah) so I haven't had yet the chance to try DMD-64 on Windows. Will probably try it at some point on my desktop. -- Bruno Medeiros - Software Engineer |
October 22, 2013 Re: Mono-D 0.5.4.1 - Build, completion & other fixes + Unittests via rdmd | ||||
---|---|---|---|---|
| ||||
Attachments:
| On 18 October 2013 21:58, Iain Buclaw <ibuclaw@ubuntu.com> wrote:
> On 18 October 2013 12:43, Bruno Medeiros <brunodomedeiros+dng@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.
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.
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.
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.
|
October 22, 2013 Re: Mono-D 0.5.4.1 - Build, completion & other fixes + Unittests via rdmd | ||||
---|---|---|---|---|
| ||||
On 22 October 2013 13:29, Manu <turkeyman@gmail.com> wrote: > On 18 October 2013 21:58, Iain Buclaw <ibuclaw@ubuntu.com> wrote: >> >> On 18 October 2013 12:43, Bruno Medeiros <brunodomedeiros+dng@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'; |
October 22, 2013 Re: Mono-D 0.5.4.1 - Build, completion & other fixes + Unittests via rdmd | ||||
---|---|---|---|---|
| ||||
Attachments:
| On 22 October 2013 23:48, Iain Buclaw <ibuclaw@ubuntu.com> wrote: > On 22 October 2013 13:29, Manu <turkeyman@gmail.com> wrote: > > On 18 October 2013 21:58, Iain Buclaw <ibuclaw@ubuntu.com> wrote: > >> > >> On 18 October 2013 12:43, Bruno Medeiros <brunodomedeiros+dng@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) > I didn't say that it did. It's a practical problem. it makes GCC COFF output kinda pointless. 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. > 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. So whatever it writes is apparently not recognised by link.exe (mustn't be VC8?)... I'm aware GDB can't read CV8/PDB, I'm not sure what your point is? I was just adding detail to your post about the state of COFF support in Windows. 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. > 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. > 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. ;-) > Really? What is it? 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. |
October 22, 2013 Re: Mono-D 0.5.4.1 - Build, completion & other fixes + Unittests via rdmd | ||||
---|---|---|---|---|
| ||||
Posted in reply to Manu | On Tuesday, 22 October 2013 at 14:39:55 UTC, Manu wrote:
> Well whatever object format it is, it seems it's not COFF by default, [...]
---
$ gcc --version && gcc -c test.c && file test.o
gcc.exe (rubenvb-4.8.0) 4.8.0
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
test.o: MS Windows COFF Intel 80386 object file
---
David
|
October 22, 2013 Re: Mono-D 0.5.4.1 - Build, completion & other fixes + Unittests via rdmd | ||||
---|---|---|---|---|
| ||||
Posted in reply to David Nadlinger | On 22 October 2013 15:58, David Nadlinger <code@klickverbot.at> wrote: > On Tuesday, 22 October 2013 at 14:39:55 UTC, Manu wrote: >> >> Well whatever object format it is, it seems it's not COFF by default, [...] > > > --- > $ gcc --version && gcc -c test.c && file test.o > gcc.exe (rubenvb-4.8.0) 4.8.0 > Copyright (C) 2013 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > > test.o: MS Windows COFF Intel 80386 object file > --- > Thanks for having faith in my words... :o) -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0'; |
Copyright © 1999-2021 by the D Language Foundation