ScriptDebugger

Show Deprecated
Not Creatable

A ScriptDebugger is used to handle the debugging of a specific script. It can be retrieved from the DebuggerManager.

Summary

Properties

The current line that the script is on.

READ ONLY
NOT REPLICATED

Describes if this ScriptDebugger is actually debugging the script attached to it.

READ ONLY
NOT REPLICATED

Describes if this ScriptDebugger is paused.

READ ONLY
NOT REPLICATED

The script object this debugger is linked to.

READ ONLY
NOT REPLICATED

Events


Fires when a DebuggerBreakpoint is added to the script.


Fires when a DebuggerBreakpoint is removed from the script.


Fires when a DebuggerBreakpoint is encountered by the script.


Fires when the game is resumed after being paused by a breakpoint.


Fires when a DebuggerWatch is added to this script debugger.


Fires when a DebuggerWatch is removed from this script debugger.

Methods

AddWatch(expression: string): Instance  

Adds a DebuggerWatch with the given expression.


Returns a list of DebuggerBreakpoint present in the script.

GetGlobals(stackFrame: number): table  

Returns a dictionary of all variables that are present in the global environment of the stack frame.

GetLocals(stackFrame: number): table  

Returns a dictionary of all local variables in the specified stack frame.


Returns an array of all active call stack frames in the script.

GetUpvalues(stackFrame: number): table  

Returns a dictionary of all upvalues present in the specified stack frame.


Returns the current value of a variable being watched by a DebuggerWatch.


Returns a list with all the DebuggerWatch instances for this debugger.

SetBreakpoint(line: number, isContextDependentBreakpoint: boolean): Instance  

Sets the specified line of the script as a breakpoint. Returns a DebuggerBreakpoint that you can use to manage the breakpoint.

SetGlobal(name: string, value: Variant, stackFrame: number): void  

Sets the value of the variable name as value in the global environment of the specified stack frame.

SetLocal(name: string, value: Variant, stackFrame: number): void  

Sets the value of the variable name as value in the specified stack frame.

SetUpvalue(name: string, value: Variant, stackFrame: number): void  

Sets the value of the upvalue name as value in the specified stack frame.

Properties

CurrentLine

Read Only
Not Replicated

The current line that the script is on.

IsDebugging

Read Only
Not Replicated

Describes if this ScriptDebugger is actually debugging the script attached to it.

IsPaused

Read Only
Not Replicated

Describes if this ScriptDebugger is paused.

Script

Read Only
Not Replicated

The script object this debugger is linked to.

Events

BreakpointAdded

Fires when a DebuggerBreakpoint is added to the script.

Parameters

breakpoint: Instance

BreakpointRemoved

Fires when a DebuggerBreakpoint is removed from the script.

Parameters

breakpoint: Instance

EncounteredBreak

Fires when a DebuggerBreakpoint is encountered by the script.

Parameters

line: number
breakReason: BreakReason

Resuming

Fires when the game is resumed after being paused by a breakpoint.


WatchAdded

Fires when a DebuggerWatch is added to this script debugger.

Parameters

watch: Instance

WatchRemoved

Fires when a DebuggerWatch is removed from this script debugger.

Parameters

watch: Instance

Methods

AddWatch

Adds a DebuggerWatch with the given expression.

Parameters

expression: string

Returns

GetBreakpoints

Returns a list of DebuggerBreakpoint present in the script.


Returns

GetGlobals

Returns a dictionary of all variables that are present in the global environment of the stack frame, where the keys are the names of the variables, and the values are the actual values of the variables.
Each stack frame might see different global variables if function environments are different.

Parameters

stackFrame: number
Default Value: "0"

Returns

GetLocals

Returns a dictionary of all local variables in the specified stack frame, where the keys are the names of the variables, and the values are the actual values of the variables.

Parameters

stackFrame: number
Default Value: "0"

Returns

GetStack

Returns an array of all active call stack frames in the script.


Returns

GetUpvalues

Returns a dictionary of all upvalues present in the specified stack frame, where the keys are the names of the upvalues, and the values are the actual values of the upvalues.

Parameters

stackFrame: number
Default Value: "0"

Returns

GetWatchValue

Returns the current value of a variable being watched by a DebuggerWatch.

Parameters

watch: Instance

Returns

GetWatches

Returns a list with all the DebuggerWatch instances for this debugger.


Returns

SetBreakpoint

Sets the specified line of the script as a breakpoint. Returns a DebuggerBreakpoint that you can use to manage the breakpoint.

Parameters

line: number
isContextDependentBreakpoint: boolean

Whether the breakpoint is unique for a single script instance or not.


Returns

SetGlobal

void

Sets the value of the variable name as value in the global environment of the specified stack frame.

Parameters

name: string
value: Variant
stackFrame: number

Returns

void

SetLocal

void

Sets the value of the variable name as value in the specified stack frame.

Parameters

name: string
value: Variant
stackFrame: number
Default Value: "0"

Returns

void

SetUpvalue

void

Sets the value of the upvalue name as value in the specified stack frame.

Parameters

name: string
value: Variant
stackFrame: number
Default Value: "0"

Returns

void