Skip to content
This repository has been archived by the owner on Aug 23, 2024. It is now read-only.

debug code support #97

Closed
modom opened this issue Oct 10, 2018 · 9 comments
Closed

debug code support #97

modom opened this issue Oct 10, 2018 · 9 comments

Comments

@modom
Copy link

modom commented Oct 10, 2018

Support marking of some lines of code as debug-only.
Some kind of simple preprocessor.
For example like in C/C++:

#ifdef DEBUG
Echo("Debug Code here.");
#endif

or any other type of marking (for example; //@debug to mark the line as debug, and/or //@debug-begin //@debug-end to mark the debug code section inbetween).

The inclusion/exclusion during deployment of debug code should be selectable in MDK options.

If marked wrongly, this might cause some code being undeployable in debug or release configuration - however that's problem of use, nothing to take care of in MDK (only if it would be easy to implement warning).

@modom
Copy link
Author

modom commented Oct 10, 2018

Or more C#-friendly:

#region mdk debug
Echo("Debug Code Here.");
#endregion

@kwilliams1987
Copy link
Contributor

Doesn't the #if DEBUG convention already work for this?

@malware-dev
Copy link
Owner

It should use the traditional #if DEBUG, yes, but I believe the request is about actually removing the debug code from deployment.

This is a common use case and is essentially an extension of the .debug.cs feature., so it might be considered, especially if it's to be an option. I cannot promise anything at this time though.

@malware-dev
Copy link
Owner

Maybe it should take the Debug/Release configuration into account, simply. That would be a normal workflow after all.

@modom
Copy link
Author

modom commented Oct 10, 2018

@malware-dev @kwilliams1987 Yes, sorry I didn't wrote it specifically - removal of debug code is the aim of this request :)

@malware-dev malware-dev added this to To Do in MDK Main Dec 1, 2018
@malware-dev malware-dev moved this from To Do to Accepted in MDK Main Dec 1, 2018
@hades200082
Copy link

I'd prefer if it simply worked with the existing if DEBUG syntax

@swarr
Copy link

swarr commented Mar 5, 2021

Seems that MDK does not use symbols defined in project, as a workaround - symbol could be defined in start of each file by code:
#define DEBUG

It would be great if any symbols defined in project properties would be used, this will allow to turn on/off debug code by just configuring proper symbols in project.

@malware-dev
Copy link
Owner

MDK is just a publisher. Any support like this has to be explicitly made to actively remove code within such sections, and that's more effort that I'm ready to put into this at this point. The actual interpretation of the published code is fully up to SE, not MDK.

@malware-dev
Copy link
Owner

Closing because this site is being archived due to complete replacement at https://github.com/malforge/mdk2. If issue persist, please create new issue there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
MDK Main
  
Accepted
Development

No branches or pull requests

5 participants