running under a debugger
Posted: Mon May 16, 2011 10:21 pm
Hi All,
Is there anyway to check if my application is running under a debugger?

Is there anyway to check if my application is running under a debugger?
http://www.purebasic.com
https://www.purebasic.fr/english/
Code: Select all
CompilerIf #PB_Compiler_Debugger
;do your debugger based code changes here, or set a variable such as 'usingDebugger = 1'
CompilerElse
;do your non-debugger code here
CompilerEndifCode: Select all
If Not #PB_Compiler_Debugger ; 0=off 1=on
MessageRequester("Debugger off","")
EndIfHere's a shorter version of the above:WilliamL wrote:Yeah, that's where I saw it.Thanks Demivec!
Just remember, if the debugger is off then no Debug messages!Code: Select all
If Not #PB_Compiler_Debugger ; 0=off 1=on MessageRequester("Debugger off","") EndIf
Code: Select all
Debug "Debugger on"Code: Select all
Debug "Debugger on"