Quantcast
Channel: Processors
Viewing all articles
Browse latest Browse all 125121

Forum Post: RE: Detect if program is running under debugger

$
0
0

 

  You could write the code this way: 

int resetOnError = 1;

void errorHandler(void) { 

 if (error) {

   asm(" ESTOP_1");

  if (resetOnError) {

       logError(error);

       reset();

 }

}

}

In this way the code would break if the debugger were attached; otherwise the breakpoint would be ignored.  In the debugger, you could change 'resetOnError' to zero before continuing execution.

Regards,

 Bill

 

 

 

 

 

 

 

 


Viewing all articles
Browse latest Browse all 125121

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>