DMD 1.005 release

Sean Kelly sean at f4.ca
Tue Feb 6 12:01:58 PST 2007


BCS wrote:
> Sean Kelly wrote:
>>
>>
>> The most obvious danger is simply being able to eyeball what the 
>> source code for a module actually is, but that's been an issue for any 
>> sufficiently complex template code anyway.  
> 
> How are #line directives handled? is their any way to tell the debugger 
> to look at another file:
> 
> mixin(MixInThisFile("foo"));
> 
> // results in this
> 
> // stuff
> #line foo, 127
> // stuff from foo:127
> 
> #line ... // revert back to original file:line
> 
> Then, in the debugger, it would start stepping you through foo in the 
> correct place.

I suspect that generating debug info will require the mixed-in code to 
be expanded in place with the proper #line directives, etc, in the 
object file.

>> If there were a way to emit the "expanded" source we could even use 
>> this as a "standalone" code generation tool of sorts.  Nice work!
> 
> Put in a pragma msg in place of the mixin and you get the code.

Yup.  I think for a standalone code generator, it would probably be 
better to generate the output file completely through pragma(msg) so as 
to omit the template code used for processing the mixins.  For example, 
I figure it shouldn't be terribly difficult to do D codegen from a UML 
file in template code, etc.


Sean



More information about the Digitalmars-d-announce mailing list