Unpredictable debugging results from large code base executable

 

Hello,

I was wondering if anyone has experienced the problem above. My code base is 5650 lines long, split into 2 modules and an indicator. When I run the code through the debugger, there's one DebugBreak() and then I run an ExpertRemove() on the code to stop it running, although I need to stop the execution through the debugger. My code is full of logging code, and from the results, I can see that at a specific time, the variable values logged vary with different executions. I'm not changing my code in between times, and it was working on a slightly smaller code base. The added code to my knowledge had no impact on the code.

I can't share my code as it's too sensitive, but I'm worried I'm going to have to recode it into C++ and integrate it into an indicator via a DLL.

Any ideas? 

Thanks.

 
imamushroomAny ideas
About what? You haven't provided any code, any logs, any problem.
          Be precise and informative about your problem.
 
imamushroomI was wondering if anyone has experienced the problem above.

If you, with access to your full code, access to your log output, access to the debugger output, are not able to figure out what is wrong, how would we with no access what-so-ever, figure out what is wrong?

imamushroom... but I'm worried I'm going to have to recode it into C++ and integrate it into an indicator via a DLL.

Rewriting it in C++ is not a solution. It is an escape! You will have to debug it (in parts if necessary) and figure out what is wrong.

When compiling your code, make sure you have absolutely no warnings at all. Warnings are inconsistencies that can cause runtime problems, so fix all of them as well.

EDIT: Also, if you are dependant on the Standard Library, please note that there were changes in build 5200 (at least some users reported that). I personally do not use the Standard Library, so have no idea what changed.

EDIT2: Please ignore the 5200 part. I did not notice it was a MQL4 question, not MQL5.

 
William Roeder #:
About what? You haven't provided any code, any logs, any problem.
          Be precise and informative about your problem.

Thank you for your response. Can you tell me which Metatrader4 logs you require please. As I mentioned, my strategy and logs are too sensitive to post here.

 
Fernando Carreiro #:

If you, with access to your full code, access to your log output, access to the debugger output, are not able to figure out what is wrong, how would we with no access what-so-ever, figure out what is wrong?

Rewriting it in C++ is not a solution. It is an escape! You will have to debug it (in parts if necessary) and figure out what is wrong.

When compiling your code, make sure you have absolutely no warnings at all. Warnings are inconsistencies that can cause runtime problems, so fix all of them as well.

EDIT: Also, if you are dependant on the Standard Library, please note that there were changes in build 5200 (at least some users reported that). I personally do not use the Standard Library, so have no idea what changed.

Thanks for your comments. I've a clean build using strict. I've noted the potential problems with 5200 and will investigate.

 
imamushroom #I've noted the potential problems with 5200 and will investigate.

Please ignore my comments on build 5200. That is only for MQL5. I did not notice that I this was a MQL4 question.

 
Fernando Carreiro #:

Please ignore my comments on build 5200. That is only for MQL5. I did not notice that I this was a MQL4 question.

ok thanks