www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - debug public release private

reply Gorge Jingale <Frifj mail.com> writes:
debug mixin("public"); else mixin("private");

Doesn't work.

It's nice to have public members when debugging because they show 
up in the debugger and one can access internals for checking. One 
can enable per line using debug but it requires lots of duplicate 
code.


Is there any easy way to do this?
Jul 24 2016
next sibling parent Cauterite <cauterite gmail.com> writes:
On Monday, 25 July 2016 at 04:58:55 UTC, Gorge Jingale wrote:
 debug mixin("public"); else mixin("private");
Perhaps you could build a patched DMD which ignores 'private'. Then when you want to compile with -debug, use this custom DMD, and use the standard DMD the rest of the time. I imagine it'd be a pretty simple patch, but I'm not certain.
Jul 24 2016
prev sibling parent Jonathan M Davis via Digitalmars-d-learn writes:
On Monday, July 25, 2016 04:58:55 Gorge Jingale via Digitalmars-d-learn wrote:
 debug mixin("public"); else mixin("private");

 Doesn't work.

 It's nice to have public members when debugging because they show
 up in the debugger and one can access internals for checking. One
 can enable per line using debug but it requires lots of duplicate
 code.


 Is there any easy way to do this?
What kind of deubgger cares about public or private? I don't think that I've ever seen a debugger that did. Debuggers normally give you access to everything. - Jonathan M Davis
Jul 25 2016