google-cloud-debugger - Class Google::Cloud::Debugger::Breakpoint (v0.42.2)

Reference documentation and code samples for the google-cloud-debugger class Google::Cloud::Debugger::Breakpoint.

Breakpoint

Abstract class that represents a breakpoint, which can be set and triggered in a debuggee application. Maps to gRPC struct V2::Breakpoint.

Inherits

  • Object

Includes

  • MonitorMixin

Methods

#action

def action() -> Symbol

Action to take when a breakpoint is hit. Either :CAPTURE or :LOG.

Returns
  • (Symbol)

#action=

def action=(value) -> Symbol

Action to take when a breakpoint is hit. Either :CAPTURE or :LOG.

Parameter
  • value (Symbol)
Returns
  • (Symbol)

#app_root

def app_root() -> String

Absolute path to the debuggee Ruby application root directory.

Returns
  • (String)

#app_root=

def app_root=(value) -> String

Absolute path to the debuggee Ruby application root directory.

Parameter
  • value (String)
Returns
  • (String)

#check_condition

def check_condition(binding) -> Boolean

Evaluate the breakpoint's condition expression against a given binding object. Returns true if the condition expression evalutes to true or there isn't a condition; otherwise false. Set breakpoint to error state if exception happens.

Parameter
  • binding (Binding) — A Ruby Binding object
Returns
  • (Boolean) — True if condition evalutes to true or there isn't a condition. False if condition evaluates to false or error raised during evaluation.

#complete

def complete()

Marks a breakpoint as complete if this breakpoint isn't completed already. Set @is_final_state to true and set @final_time.

#complete?

def complete?() -> Boolean

Check if the breakpoint has been evaluated or set to a final error state.

Returns
  • (Boolean)

#condition

def condition()

Condition that triggers the breakpoint. The condition is a compound boolean expression composed using expressions in a programming language at the source location.

#condition=

def condition=(value)

Condition that triggers the breakpoint. The condition is a compound boolean expression composed using expressions in a programming language at the source location.

#create_time

def create_time() -> Time

Time this breakpoint was created by the server in seconds resolution.

Returns
  • (Time)

#create_time=

def create_time=(value) -> Time

Time this breakpoint was created by the server in seconds resolution.

Parameter
  • value (Time)
Returns
  • (Time)

#eql?

def eql?(other) -> Boolean

Check if two breakpoints are equal to each other

Returns
  • (Boolean)

#evaluated_expressions

def evaluated_expressions() -> Array<Google::Cloud::Debugger::Breakpoint::Variable>

Values of evaluated expressions at breakpoint time. The evaluated expressions appear in exactly the same order they are listed in the expressions field. The name field holds the original expression text, the value or members field holds the result of the evaluated expression. If the expression cannot be evaluated, the status inside the Variable will indicate an error and contain the error text.

#evaluated_expressions=

def evaluated_expressions=(value) -> Array<Google::Cloud::Debugger::Breakpoint::Variable>

Values of evaluated expressions at breakpoint time. The evaluated expressions appear in exactly the same order they are listed in the expressions field. The name field holds the original expression text, the value or members field holds the result of the evaluated expression. If the expression cannot be evaluated, the status inside the Variable will indicate an error and contain the error text.

#evaluated_log_message

def evaluated_log_message()

The evaluated log message when action is LOG.

#evaluated_log_message=

def evaluated_log_message=(value)

The evaluated log message when action is LOG.

#expressions

def expressions() -> Array<String>

List of read-only expressions to evaluate at the breakpoint location. The expressions are composed using expressions in the programming language at the source location. If the breakpoint action is LOG, the evaluated expressions are included in log statements.

Returns
  • (Array<String>)

#expressions=

def expressions=(value) -> Array<String>

List of read-only expressions to evaluate at the breakpoint location. The expressions are composed using expressions in the programming language at the source location. If the breakpoint action is LOG, the evaluated expressions are included in log statements.

Parameter
  • value (Array<String>)
Returns
  • (Array<String>)

#final_time

def final_time() -> Time

Time this breakpoint was finalized as seen by the server in seconds resolution.

Returns
  • (Time)

#final_time=

def final_time=(value) -> Time

Time this breakpoint was finalized as seen by the server in seconds resolution.

Parameter
  • value (Time)
Returns
  • (Time)

#full_path

def full_path()

Get full absolute file path by combining the relative file path with application root directory path.

#id

def id()

Breakpoint identifier, unique in the scope of the debuggee.

#id=

def id=(value)

Breakpoint identifier, unique in the scope of the debuggee.

#is_final_state

def is_final_state() -> Boolean

When true, indicates that this is a final result and the breakpoint state will not change from here on.

Returns
  • (Boolean)

#is_final_state=

def is_final_state=(value) -> Boolean

When true, indicates that this is a final result and the breakpoint state will not change from here on.

Parameter
  • value (Boolean)
Returns
  • (Boolean)

#labels

def labels() -> Hash<String, String>

A set of custom breakpoint properties, populated by the agent, to be displayed to the user.

Returns
  • (Hash<String, String>)

#labels=

def labels=(value) -> Hash<String, String>

A set of custom breakpoint properties, populated by the agent, to be displayed to the user.

Parameter
  • value (Hash<String, String>)
Returns
  • (Hash<String, String>)

#line

def line() -> Integer

Get the line number of this breakpoint

Returns
  • (Integer) — The line number for this breakpoint
Example
breakpoint =
  Google::Cloud::Debugger::Breakpoint.new nil, "path/to/file.rb", 11
breakpoint.line #=> 11

#location

def location() -> Google::Cloud::Debugger::Breakpoint::SourceLocation

Breakpoint source location.

#location=

def location=(value) -> Google::Cloud::Debugger::Breakpoint::SourceLocation

Breakpoint source location.

#log_level

def log_level()

Indicates the severity of the log. Only relevant when action is LOG.

#log_level=

def log_level=(value)

Indicates the severity of the log. Only relevant when action is LOG.

#log_message_format

def log_message_format()

Only relevant when action is LOG. Defines the message to log when the breakpoint hits. The message may include parameter placeholders $0, $1, etc. These placeholders are replaced with the evaluated value of the appropriate expression. Expressions not referenced in logMessageFormat are not logged.

#log_message_format=

def log_message_format=(value)

Only relevant when action is LOG. Defines the message to log when the breakpoint hits. The message may include parameter placeholders $0, $1, etc. These placeholders are replaced with the evaluated value of the appropriate expression. Expressions not referenced in logMessageFormat are not logged.

#path

def path() -> String

Get the file path of this breakpoint

Returns
  • (String) — The file path for this breakpoint
Example
breakpoint =
  Google::Cloud::Debugger::Breakpoint.new nil, "path/to/file.rb"
breakpoint.path #=> "path/to/file.rb"

#set_error_state

def set_error_state(message, refers_to: StatusMessage::UNSPECIFIED, is_final: true) -> Google::Cloud::Debugger::Breakpoint::StatusMessage

Set breakpoint to an error state, which initializes the @status instance variable with the error message. Also mark this breakpoint as completed if is_final is true.

Parameters
  • message (String) — The error message
  • refers_to (Symbol) (defaults to: StatusMessage::UNSPECIFIED) — Enum that specifies what the error refers to. Defaults :UNSPECIFIED. See StatusMessage class for list of possible values
  • is_final (Boolean) (defaults to: true) — Marks the breakpoint as final if true. Defaults true.
Returns

#stack_frames

def stack_frames() -> Array<Google::Cloud::Debugger::Breakpoint::StackFrame>

The stack at breakpoint time.

#stack_frames=

def stack_frames=(value) -> Array<Google::Cloud::Debugger::Breakpoint::StackFrame>

The stack at breakpoint time.

#status

def status()

Breakpoint status.

The status includes an error flag and a human readable message. This field is usually unset. The message can be either informational or an error message. Regardless, clients should always display the text message back to the user.

Error status indicates complete failure of the breakpoint.

#status=

def status=(value)

Breakpoint status.

The status includes an error flag and a human readable message. This field is usually unset. The message can be either informational or an error message. Regardless, clients should always display the text message back to the user.

Error status indicates complete failure of the breakpoint.

#user_email

def user_email()

E-mail address of the user that created this breakpoint

#user_email=

def user_email=(value)

E-mail address of the user that created this breakpoint

#valid?

def valid?() -> Boolean

Check if the breakpoint is valid or not. Invoke validation function if breakpoint hasn't been finallized yet.

Returns
  • (Boolean)

#variable_table

def variable_table()

The variable_table exists to aid with computation, memory and network traffic optimization. It enables storing a variable once and reference it from multiple variables, including variables stored in the variable_table itself. For example, the same this object, which may appear at many levels of the stack, can have all of its data stored once in this table. The stack frame variables then would hold only a reference to it.

The variable var_table_index field is an index into this repeated field. The stored objects are nameless and get their name from the referencing variable. The effective variable is a merge of the referencing variable and the referenced variable.

#variable_table=

def variable_table=(value)

The variable_table exists to aid with computation, memory and network traffic optimization. It enables storing a variable once and reference it from multiple variables, including variables stored in the variable_table itself. For example, the same this object, which may appear at many levels of the stack, can have all of its data stored once in this table. The stack frame variables then would hold only a reference to it.

The variable var_table_index field is an index into this repeated field. The stored objects are nameless and get their name from the referencing variable. The effective variable is a merge of the referencing variable and the referenced variable.