BUG (beta build 3020) - Debugger won't break at breakpoints on scripts

 

This is an inconsistent bug. As soon as I see any pattern I'll report it.

Simple script, 2 or 3 breakpoints, when I click the button or hit F5 to start debugging, the script loads, runs, and skips all the breakpoints.

To get it to work properly I have to close MetaEditor and the MT5 terminal program, then open them again and hit F5.

 
OK, it turns out that all I need to do is close MT5 (not MetaEditor). Then when I hit F5 it opens MT5 back up and the breakpoints work.
 

OK, looks like the debugger is a single-shot. If you compile and run the debugger, it won't pause at breakpoints. If you close MT5 and reopen it (either directly or by F5 in MetaEditor) it runs the script and pauses at the breakpoints.

And that's it. That's all you get.

Any further attempts (even immediately after the 1st debugging session ends) to run the unchanged .ex5 file will skip all the breakpoints... until after you close MT5 and reopen it again.

Here's the code I'm debugging:

#include <Globals MJM.mqh>          // I've got some #defines etc. there along with the ShowLastErrorMsg() function
#include <Object routines MJM.mqh>  // Where the deficit-compensating functions reside

//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
{
   datetime dtDTM0                           = D'2021.06.01 00:00:00';
   datetime dtDTM1                           = D'2021.06.01 07:00:00';
   double   dPrc0                            = 1.418;
   double   dPrc1                            = 1.424;
   string sNmeDP = "DtPrcObj";
      ResetLastError(); 
   int iDPIX = ObjectCreate(sNmeDP,OBJ_RECTANGLE,0,0,dtDTM0,dPrc0,dtDTM1,dPrc1); 
      iErr=_LastError; 
      if(iErr>0)
         ShowLastErrorMsg(iErr,__FILE__+" called by "+__FILE__,__FUNCTION__,__LINE__,
                          " ObjectCreate for <"+sNmeDP+">");
   return;
}

The breakpoints in question are on the 'string sNmeDP = "DtPrcObj"; ' statement and on the 'return;' statement.


 
The current beta is 3021.
 
Alain Verleyen:
The current beta is 3021.

Does that imply the problem has been fixed in 3021?

 
Alain Verleyen:
The current beta is 3021.

Awesome. I don't have 3021. And I can't find any way to get 3021.


I followed instructions I found at https://www.metatrader5.com/en/releasenotes,


but the /beta switch gave me build 2981 lol.

But then MT5 informed me it downloaded updates, so I restarted the program, updates were applied, and that got me right back to:


So where can I find build 3021?

What's new in MetaTrader 5
What's new in MetaTrader 5
  • www.metatrader5.com
If a Take Profit triggers on the server while your computer is turned off, you will receive a notification about a closed position from the server.
 
Millard Melnyk:

Awesome. I don't have 3021. And I can't find any way to get 3021.


I followed instructions I found at https://www.metatrader5.com/en/releasenotes,


but the /beta switch gave me build 2981 lol.

But then MT5 informed me it downloaded updates, so I restarted the program, updates were applied, and that got me right back to:


So where can I find build 3021?

LMAO nvm. Duhr. Found it.


 
Alain Verleyen:
The current beta is 3021.

OK, 3021 installed and I can confirm the problem I reported has been fixed.