BadScript 2
Loading...
Searching...
No Matches
BadScript2.Debugging.BadDebugger Class Reference

Public Debugger Interface. More...

Static Public Member Functions

static void Attach (IBadDebugger debugger)
 Attaches a debugger to the system.
 
static void Detach ()
 Detaches the debugger from the system.
 

Static Package Functions

static void Step (BadDebuggerStep stepInfo)
 Sends a step event to the debugger.
 

Properties

static bool IsAttached [get, private set]
 True if a debugger is attached.
 

Static Private Attributes

static ? IBadDebugger s_Debugger
 The currently attached debugger.
 

Detailed Description

Public Debugger Interface.

Definition at line 12 of file BadDebugger.cs.

Member Function Documentation

◆ Attach()

static void BadScript2.Debugging.BadDebugger.Attach ( IBadDebugger  debugger)
static

Attaches a debugger to the system.

Parameters
debuggerThe debugger to attach.
Exceptions
BadRuntimeExceptionGets raised if there is already a debugger attached

Definition at line 29 of file BadDebugger.cs.

30 {
31 if (IsAttached)
32 {
33 throw new BadRuntimeException("Already a Debugger Attached");
34 }
35
36 IsAttached = true;
37 s_Debugger = debugger;
38 BadLogger.Warn($"Debugger '{debugger}' is Attached");
39 }
Public facing interface for a logger.
Definition BadLogger.cs:7
static void Warn(string message)
Writes a Warning to the Message Handler.
Definition BadLogger.cs:56
static ? IBadDebugger s_Debugger
The currently attached debugger.
static bool IsAttached
True if a debugger is attached.

◆ Detach()

static void BadScript2.Debugging.BadDebugger.Detach ( )
static

Detaches the debugger from the system.

Definition at line 44 of file BadDebugger.cs.

45 {
46 BadLogger.Warn($"Debugger '{s_Debugger}' is Detached");
47 IsAttached = false;
48 s_Debugger = null;
49 }

◆ Step()

static void BadScript2.Debugging.BadDebugger.Step ( BadDebuggerStep  stepInfo)
staticpackage

Sends a step event to the debugger.

Parameters
stepInfoThe Step info

Definition at line 55 of file BadDebugger.cs.

56 {
57 s_Debugger?.Step(stepInfo);
58 }
void Step(BadDebuggerStep stepInfo)
Gets called on every step when the Debugger is attached.

Member Data Documentation

◆ s_Debugger

? IBadDebugger BadScript2.Debugging.BadDebugger.s_Debugger
staticprivate

The currently attached debugger.

Definition at line 17 of file BadDebugger.cs.

Property Documentation

◆ IsAttached

bool BadScript2.Debugging.BadDebugger.IsAttached
staticgetprivate set

True if a debugger is attached.

Definition at line 22 of file BadDebugger.cs.

22{ get; private set; }

The documentation for this class was generated from the following file: