digitalmars.D.learn - debug mixins
- Inquie (16/16) Mar 14 2017 So, is it possible to debug string mixins?
- Jonathan M Davis via Digitalmars-d-learn (3/19) Mar 14 2017 Related: https://issues.dlang.org/show_bug.cgi?id=5051
- Inquie (3/8) Mar 15 2017 So, after 3 years, nothing?
- Jonathan M Davis via Digitalmars-d-learn (6/17) Mar 16 2017 Not as far as I know, but it's a nice-to-have, not a necessity, and ther...
- Stefan Koch (6/23) Mar 14 2017 In dmd ~master. there is an undocumented switch called -vcg-ast.
So, is it possible to debug string mixins? I ran visual D and tried to step in to a function that was generated by a mixin and it brought an open file dialog box asking me to load the source code where the function was located... of course, it wasn't located anywhere except in the mixin string. This leads to the idea, why can't the compiler simply output the mixin string to a file then the debugger can load that source file? One of the most frustrating things about D is not having the ability to debug it's powerful meta programming in any reasonable way. (bad enough having to resort to using pragma(msg)) But we can't even debug the results of those meta programming in the case of string mixins because there is no way to step in to them... It seems all the machinery is there, but just a few extra steps are needed.
Mar 14 2017
On Wednesday, March 15, 2017 03:43:20 Inquie via Digitalmars-d-learn wrote:So, is it possible to debug string mixins? I ran visual D and tried to step in to a function that was generated by a mixin and it brought an open file dialog box asking me to load the source code where the function was located... of course, it wasn't located anywhere except in the mixin string. This leads to the idea, why can't the compiler simply output the mixin string to a file then the debugger can load that source file? One of the most frustrating things about D is not having the ability to debug it's powerful meta programming in any reasonable way. (bad enough having to resort to using pragma(msg)) But we can't even debug the results of those meta programming in the case of string mixins because there is no way to step in to them... It seems all the machinery is there, but just a few extra steps are needed.Related: https://issues.dlang.org/show_bug.cgi?id=5051 - Jonathan M Davis
Mar 14 2017
On Wednesday, 15 March 2017 at 03:50:21 UTC, Jonathan M Davis wrote:On Wednesday, March 15, 2017 03:43:20 Inquie via Digitalmars-d-learn wrote:So, after 3 years, nothing?[...]Related: https://issues.dlang.org/show_bug.cgi?id=5051 - Jonathan M Davis
Mar 15 2017
On Wednesday, March 15, 2017 13:01:36 Inquie via Digitalmars-d-learn wrote:On Wednesday, 15 March 2017 at 03:50:21 UTC, Jonathan M Davis wrote:Not as far as I know, but it's a nice-to-have, not a necessity, and there's a lot of stuff to get done. Someone is going to have to be interested enough in it to spend the time doing it as opposed to something else that they're interested in getting done, and no one seems to have done that yet. - Jonathan M DavisOn Wednesday, March 15, 2017 03:43:20 Inquie via Digitalmars-d-learn wrote:So, after 3 years, nothing?[...]Related: https://issues.dlang.org/show_bug.cgi?id=5051 - Jonathan M Davis
Mar 16 2017
On Wednesday, 15 March 2017 at 03:43:20 UTC, Inquie wrote:So, is it possible to debug string mixins? I ran visual D and tried to step in to a function that was generated by a mixin and it brought an open file dialog box asking me to load the source code where the function was located... of course, it wasn't located anywhere except in the mixin string. This leads to the idea, why can't the compiler simply output the mixin string to a file then the debugger can load that source file? One of the most frustrating things about D is not having the ability to debug it's powerful meta programming in any reasonable way. (bad enough having to resort to using pragma(msg)) But we can't even debug the results of those meta programming in the case of string mixins because there is no way to step in to them... It seems all the machinery is there, but just a few extra steps are needed.In dmd ~master. there is an undocumented switch called -vcg-ast. It will produce a file with everything expanded. (Only if the code compiles with no errors). It produces a cg-file which may or may not contain a valid source representation of the actual code compiled.
Mar 14 2017