![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
The call stack is shown at the left window(the debug tab), its shows the functions that were called up to that point:
While your project to enhance debugging is great, they are not the same as the debug info the compiler
adds to the executable. I do something similar but simpler by having a "panic" macro to create a critical
error on my indicators if something goes wrong and the indicator cannot recover.
The function names and symbol tables are removed, stuff that maps memory location to names and allows
the debugger to have a call stack with the correct names. I am guessing they are also doing other optimizations.
I did a test and it made a huge difference on one of my indicators:
Release version:
Debug version:
Yes, I know about SYMBOLS and additional debug data within the code. Inserted by compiler at compile time, I need to check, why my code has given me the impression by insignificant size change. Good to see, the compiler does its job correctly in this concern.
Here is the most recent version of the lib_debug.mqh project, although its just a small helper for me.
I have added following macro to the lib:
DBG_STOP_ARRAY_OUT_OF_RANGE(array, index)
it will be used as follows:
The macro will be removed if the file is compiled in release mode, so only works in debug mode. To forcefully enable debug mode, define compiler flag before including the lib_debug.mqh header
#define LIB_DEBUG
For call stack trace in logfile, follow this example:
In this example, the call stack tracing is individually configurable per function, this way I can trace certain execution paths throughout the code.
It is important to use the return-macro instead of the normal return expression. - Also, do not use a function call within the brackets, it will be called twice by the macro. - I havenot found any other way to do it jet.
For functions without return value:
I am currently to "lazy" to update the source in codebase...Yes, I know about SYMBOLS and additional debug data within the code. Inserted by compiler at compile time, I need to check, why my code has given me the impression by insignificant size change. Good to see, the compiler does its job correctly in this concern.
Here is the most recent version of the lib_debug.mqh project, although its just a small helper for me.
I have added following macro to the lib:
DBG_STOP_ARRAY_OUT_OF_RANGE(array, index)
it will be used as follows:
The macro will be removed if the file is compiled in release mode, so only works in debug mode. To forcefully enable debug mode, define compiler flag before including the lib_debug.mqh header
#define LIB_DEBUG
For call stack trace in logfile, follow this example:
In this example, the call stack tracing is individually configurable per function, this way I can trace certain execution paths throughout the code.
It is important to use the return-macro instead of the normal return expression. - Also, do not use a function call within the brackets, it will be called twice by the macro. - I havenot found any other way to do it jet.
For functions without return value:
I am currently to "lazy" to update the source in codebase...