Debugging support for D - wiki

Jacob Carlborg doob at me.com
Thu Sep 26 08:13:58 PDT 2013


On 2013-09-26 14:22, Bruno Medeiros wrote:

> Why would that be nice? It saves you the small hassle of downloading
> GCC+GDB+GDC into it's own installation. With precompiled binaries for
> your platform, that should take only 15 minutes of your time and then
> you're set (well, a bit again when you want to update).

To avoid what you just listed, that's why it's nice :). Why wouldn't I 
want to use the default tool chain.

> But having up-to-date tools with up-to-date functionality far outweights in
> benefits that small hassle.

I do have up-to-date tools with with up-to-date functionality, it's just 
a different tool chain than GCC. Also, I would consider the LLVM tool 
chain more up-to-date than GCC.

> Or are there downsides to that approach? Does using the GCC toolchain on
> Mac OS X have shortcomings in functionality?  The only reasons I can
> think so far, is if you want to work with LLVM/LLDB specifically (not
> merely because it's the compiler that ships with OSX, but because you
> prefer LLDB over GDB). Or if you want to use OSX specific libraries in
> your D application? (with might somewhat be tied to the OSX toolchain)

As I said, I think that "sudo" is required to run GDB from Macports. 
That's quite annoying, if that's the case.

The GCC tool chain is missing a couple of features which the LLVM tool 
chain now has. These are mainly C/C++ and Objective-C/C++ features:

* Blocks
* Modules
* A bunch of new Objective-C features
* TLS

The ones that affect D would be blocks and TLS.

It should be possible to use a C function, from D, which uses blocks. 
One just have to figure out what the runtime representation of a block 
looks like.

In Mac OS X 10.7 Apple introduce native support for TLS. The compiler 
and linker parts were only implemented in the LLVM tool chain. LDC can 
take advantage of this. GDC doesn't support native TLS on Mac OS X and, 
as far as I recall, it doesn't even support emulated TLS which DMD does.

I might end up needing a C library that only compiles with the LLVM tool 
chain. Such as one which uses blocks.

I also might want to use Mac OS X specific libraries. GUI applications 
are a good examples of this.

Also, if D is ever going to work in iOS, I think the best bet is on LDC. 
Because it uses the same tool chain as Apple does.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list