BadScript 2
Loading...
Searching...
No Matches
BadDebugger.cs
Go to the documentation of this file.
3
8
12public static class BadDebugger
13{
17 private static IBadDebugger? s_Debugger;
18
22 public static bool IsAttached { get; private set; }
23
29 public static void Attach(IBadDebugger debugger)
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 }
40
44 public static void Detach()
45 {
46 BadLogger.Warn($"Debugger '{s_Debugger}' is Detached");
47 IsAttached = false;
48 s_Debugger = null;
49 }
50
55 internal static void Step(BadDebuggerStep stepInfo)
56 {
57 s_Debugger?.Step(stepInfo);
58 }
59}
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
Public Debugger Interface.
static ? IBadDebugger s_Debugger
The currently attached debugger.
static void Step(BadDebuggerStep stepInfo)
Sends a step event to the debugger.
static bool IsAttached
True if a debugger is attached.
static void Attach(IBadDebugger debugger)
Attaches a debugger to the system.
static void Detach()
Detaches the debugger from the system.
Defines the Debugging Interface.
void Step(BadDebuggerStep stepInfo)
Gets called on every step when the Debugger is attached.
Contains Logging system for the BadScript Runtime.
Definition BadLog.cs:6
Contains the debugging abstractions for the BadScript2 Runtime.
Definition BadDebugger.cs:7
Contains the Error Objects for the BadScript2 Language.
Represents a Debugging Step.