Reference documentation and code samples for the Stackdriver Debugger Client class StackFrame.
Represents a stack frame context.
Example:
use Google\Cloud\Debugger\SourceLocation;
use Google\Cloud\Debugger\StackFrame;
$location = new SourceLocation('/path/to/file.php', 10);
$stackFrame = new StackFrame('function-name', $location);
Methods
__construct
Instantiate a new StackFrame.
Parameters | |
---|---|
Name | Description |
function |
string
Demangled function name at the call site. |
location |
Google\Cloud\Debugger\SourceLocation
The source location |
fromJson
Instantiate a new StackFrame from JSON form
Example:
$stackFrame = StackFrame::fromJson([
'function' => 'function-name',
'location' => [
'path' => '/path/to/file.php',
'line' => 10
]
]);
Parameters | |
---|---|
Name | Description |
data |
array
{ @type string $function Demangled function name at the call site. @type SourceLocation $location The source location } |
↳ function |
string
Demangled function name at the call site. |
↳ location |
SourceLocation
The source location |
Returns | |
---|---|
Type | Description |
Google\Cloud\Debugger\StackFrame |
addLocal
Register a local variable in this stack frame.
Example:
$stackFrame->addLocal($variable);
Parameter | |
---|---|
Name | Description |
variable |
Google\Cloud\Debugger\Variable
|
locals
Returns the captured locals for this stack frame.
Example:
$locals = $stackFrame->locals();
Returns | |
---|---|
Type | Description |
array<Google\Cloud\Debugger\Variable> |
info
Return a serializable version of this object
Returns | |
---|---|
Type | Description |
array |