running under a debugger

Mac OSX specific forum
spacebuddy
Enthusiast
Enthusiast
Posts: 364
Joined: Thu Jul 02, 2009 5:42 am

running under a debugger

Post by spacebuddy »

Hi All,

Is there anyway to check if my application is running under a debugger?
:D
WilliamL
Addict
Addict
Posts: 1259
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

Re: running under a debugger

Post by WilliamL »

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?
MacBook Pro-M1 (2021), Tahoe 26.2, PB 6.30b6
User avatar
Demivec
Addict
Addict
Posts: 4283
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: running under a debugger

Post by Demivec »

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
CompilerEndif
WilliamL
Addict
Addict
Posts: 1259
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

Re: running under a debugger

Post by WilliamL »

Yeah, that's where I saw it. :oops: Thanks Demivec!

Code: Select all

If Not #PB_Compiler_Debugger ; 0=off 1=on
    MessageRequester("Debugger off","")
EndIf
Just remember, if the debugger is off then no Debug messages!
MacBook Pro-M1 (2021), Tahoe 26.2, PB 6.30b6
User avatar
Demivec
Addict
Addict
Posts: 4283
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: running under a debugger

Post by Demivec »

WilliamL wrote:Yeah, that's where I saw it. :oops: Thanks Demivec!

Code: Select all

If Not #PB_Compiler_Debugger ; 0=off 1=on
    MessageRequester("Debugger off","")
EndIf
Just remember, if the debugger is off then no Debug messages!
Here's a shorter version of the above:

Code: Select all

Debug "Debugger on"
:)
WilliamL
Addict
Addict
Posts: 1259
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

Re: running under a debugger

Post by WilliamL »

Code: Select all

Debug "Debugger on"
I like it! (KISS - KeepItSimpleStupid) :D
MacBook Pro-M1 (2021), Tahoe 26.2, PB 6.30b6
Post Reply