Is there anyway to check if my application is running under a debugger?
running under a debugger
-
spacebuddy
- Enthusiast

- Posts: 364
- Joined: Thu Jul 02, 2009 5:42 am
running under a debugger
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?
Re: running under a debugger
That's a good question. I thought there was but I can't remember where I saw it.
Until somebody comes up with an answer you can use:
EnableDebugger
DisableDebugger
Anybody got an answer?
Until somebody comes up with an answer you can use:
EnableDebugger
DisableDebugger
Anybody got an answer?
MacBook Pro-M1 (2021), Tahoe 26.2, PB 6.30b6
Re: running under a debugger
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
CompilerEndifRe: running under a debugger
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","")
EndIfMacBook Pro-M1 (2021), Tahoe 26.2, PB 6.30b6
Re: running under a debugger
Here'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"Re: running under a debugger
Code: Select all
Debug "Debugger on"MacBook Pro-M1 (2021), Tahoe 26.2, PB 6.30b6
