Cloud Debugger is deprecated and will be shutdown May 31, 2023. See the deprecations page and release notes for more information.

Package google.devtools.clouddebugger.v2

Index

Controller2

The Controller service provides the API for orchestrating a collection of debugger agents to perform debugging tasks. These agents are each attached to a process of an application which may include one or more replicas.

The debugger agents register with the Controller to identify the application being debugged, the Debuggee. All agents that register with the same data, represent the same Debuggee, and are assigned the same debuggee_id.

The debugger agents call the Controller to retrieve the list of active Breakpoints. Agents with the same debuggee_id get the same breakpoints list. An agent that can fulfill the breakpoint request updates the Controller with the breakpoint result. The controller selects the first result received and discards the rest of the results. Agents that poll again for active breakpoints will no longer have the completed breakpoint in the list and should remove that breakpoint from their attached process.

The Controller service does not provide a way to retrieve the results of a completed breakpoint. This functionality is available using the Debugger service.

ListActiveBreakpoints

rpc ListActiveBreakpoints(ListActiveBreakpointsRequest) returns (ListActiveBreakpointsResponse)

Returns the list of all active breakpoints for the debuggee.

The breakpoint specification (location, condition, and expressions fields) is semantically immutable, although the field values may change. For example, an agent may update the location line number to reflect the actual line where the breakpoint was set, but this doesn't change the breakpoint semantics.

This means that an agent does not need to check if a breakpoint has changed when it encounters the same breakpoint on a successive call. Moreover, an agent should remember the breakpoints that are completed until the controller removes them from the active list to avoid setting those breakpoints again.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud_debugger
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

RegisterDebuggee

rpc RegisterDebuggee(RegisterDebuggeeRequest) returns (RegisterDebuggeeResponse)

Registers the debuggee with the controller service.

All agents attached to the same application must call this method with exactly the same request content to get back the same stable debuggee_id. Agents should call this method again whenever google.rpc.Code.NOT_FOUND is returned from any controller method.

This protocol allows the controller service to disable debuggees, recover from data loss, or change the debuggee_id format. Agents must handle debuggee_id value changing upon re-registration.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud_debugger
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

UpdateActiveBreakpoint

rpc UpdateActiveBreakpoint(UpdateActiveBreakpointRequest) returns (UpdateActiveBreakpointResponse)

Updates the breakpoint state or mutable fields. The entire Breakpoint message must be sent back to the controller service.

Updates to active breakpoint fields are only allowed if the new value does not change the breakpoint specification. Updates to the location, condition and expressions fields should not alter the breakpoint semantics. These may only make changes such as canonicalizing a value or snapping the location to the correct line of code.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud_debugger
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

Debugger2

The Debugger service provides the API that allows users to collect run-time information from a running application, without stopping or slowing it down and without modifying its state. An application may include one or more replicated processes performing the same work.

A debugged application is represented using the Debuggee concept. The Debugger service provides a way to query for available debuggees, but does not provide a way to create one. A debuggee is created using the Controller service, usually by running a debugger agent with the application.

The Debugger service enables the client to set one or more Breakpoints on a Debuggee and collect the results of the set Breakpoints.

DeleteBreakpoint

rpc DeleteBreakpoint(DeleteBreakpointRequest) returns (Empty)

Deletes the breakpoint from the debuggee.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud_debugger
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

GetBreakpoint

rpc GetBreakpoint(GetBreakpointRequest) returns (GetBreakpointResponse)

Gets breakpoint information.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud_debugger
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ListBreakpoints

rpc ListBreakpoints(ListBreakpointsRequest) returns (ListBreakpointsResponse)

Lists all breakpoints for the debuggee.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud_debugger
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ListDebuggees

rpc ListDebuggees(ListDebuggeesRequest) returns (ListDebuggeesResponse)

Lists all the debuggees that the user has access to.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud_debugger
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

SetBreakpoint

rpc SetBreakpoint(SetBreakpointRequest) returns (SetBreakpointResponse)

Sets the breakpoint to the debuggee.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud_debugger
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

Breakpoint


Breakpoint (the resource)

Represents the breakpoint specification, status and results.

Fields
id

string

Breakpoint identifier, unique in the scope of the debuggee.

action

Action

Action that the agent should perform when the code at the breakpoint location is hit.

location

SourceLocation

Breakpoint source location.

condition

string

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

expressions[]

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.

log_message_format

string

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 log_message_format are not logged.

Example: Message received, id = $0, count = $1 with expressions = [ message.id, message.count ].

log_level

LogLevel

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

is_final_state

bool

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

create_time

Timestamp

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

final_time

Timestamp

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

user_email

string

E-mail address of the user that created this breakpoint

status

StatusMessage

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.

Example (non-final state): Still loading symbols...

Examples (final state):

  • Invalid line number referring to location
  • Field f not found in class C referring to condition
stack_frames[]

StackFrame

The stack at breakpoint time, where stack_frames[0] represents the most recently entered function.

evaluated_expressions[]

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.

variable_table[]

Variable

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.

labels

map<string, string>

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

canary_expire_time

Timestamp

The deadline for the breakpoint to stay in CANARY_ACTIVE state. The value is meaningless when the breakpoint is not in CANARY_ACTIVE state.

state

State

The current state of the breakpoint.

Action

Actions that can be taken when a breakpoint hits. Agents should reject breakpoints with unsupported or unknown action values.

Enums
CAPTURE Capture stack frame and variables and update the breakpoint. The data is only captured once. After that the breakpoint is set in a final state.
LOG Log each breakpoint hit. The breakpoint remains active until deleted or expired.

LogLevel

Log severity levels.

Enums
INFO Information log message.
WARNING Warning log message.
ERROR Error log message.

State

Breakpoint state.

Enums
STATE_UNSPECIFIED Breakpoint state UNSPECIFIED.
STATE_CANARY_PENDING_AGENTS Enabling canary but no agents are available.
STATE_CANARY_ACTIVE Enabling canary and successfully assigning canary agents.
STATE_ROLLING_TO_ALL Breakpoint rolling out to all agents.
STATE_IS_FINAL Breakpoint is hit/complete/failed.

Debuggee

Represents the debugged application. The application may include one or more replicated processes executing the same code. Each of these processes is attached with a debugger agent, carrying out the debugging commands. Agents attached to the same debuggee identify themselves as such by using exactly the same Debuggee message value when registering.

Fields
id

string

Unique identifier for the debuggee generated by the controller service.

project

string

Project the debuggee is associated with. Use project number or id when registering a Google Cloud Platform project.

uniquifier

string

Uniquifier to further distinguish the application. It is possible that different applications might have identical values in the debuggee message, thus, incorrectly identified as a single application by the Controller service. This field adds salt to further distinguish the application. Agents should consider seeding this field with value that identifies the code, binary, configuration and environment.

description

string

Human readable description of the debuggee. Including a human-readable project name, environment name and version information is recommended.

is_inactive

bool

If set to true, indicates that Controller service does not detect any activity from the debuggee agents and the application is possibly stopped.

agent_version

string

Version ID of the agent. Schema: domain/language-platform/vmajor.minor (for example google.com/java-gcp/v1.1).

is_disabled

bool

If set to true, indicates that the agent should disable itself and detach from the debuggee.

status

StatusMessage

Human readable message to be displayed to the user about this debuggee. Absence of this field indicates no status. The message can be either informational or an error status.

source_contexts[]

SourceContext

References to the locations and revisions of the source code used in the deployed application.

ext_source_contexts[]
(deprecated)

ExtendedSourceContext

References to the locations and revisions of the source code used in the deployed application.

labels

map<string, string>

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

canary_mode

CanaryMode

Used when setting breakpoint canary for this debuggee.

CanaryMode

Canary mode

Enums
CANARY_MODE_UNSPECIFIED CANARY_MODE_UNSPECIFIED is equivalent to CANARY_MODE_ALWAYS_DISABLED so that if the debuggee is not configured to use the canary feature, the feature will be disabled.
CANARY_MODE_ALWAYS_ENABLED Always enable breakpoint canary regardless of the value of breakpoint's canary option.
CANARY_MODE_ALWAYS_DISABLED Always disable breakpoint canary regardless of the value of breakpoint's canary option.
CANARY_MODE_DEFAULT_ENABLED Depends on the breakpoint's canary option. Enable canary by default if the breakpoint's canary option is not specified.
CANARY_MODE_DEFAULT_DISABLED Depends on the breakpoint's canary option. Disable canary by default if the breakpoint's canary option is not specified.

DeleteBreakpointRequest

Request to delete a breakpoint.

Fields
debuggee_id

string

Required. ID of the debuggee whose breakpoint to delete.

breakpoint_id

string

Required. ID of the breakpoint to delete.

client_version

string

Required. The client version making the call. Schema: domain/type/version (e.g., google.com/intellij/v1).

FormatMessage

Represents a message with parameters.

Fields
format

string

Format template for the message. The format uses placeholders $0, $1, etc. to reference parameters. $$ can be used to denote the $ character.

Examples:

  • Failed to load '$0' which helps debug $1 the first time it is loaded. Again, $0 is very important.
  • Please pay $$10 to use $0 instead of $1.
parameters[]

string

Optional parameters to be embedded into the message.

GetBreakpointRequest

Request to get breakpoint information.

Fields
debuggee_id

string

Required. ID of the debuggee whose breakpoint to get.

breakpoint_id

string

Required. ID of the breakpoint to get.

client_version

string

Required. The client version making the call. Schema: domain/type/version (e.g., google.com/intellij/v1).

GetBreakpointResponse

Response for getting breakpoint information.

Fields
breakpoint

Breakpoint

Complete breakpoint state. The fields id and location are guaranteed to be set.

ListActiveBreakpointsRequest

Request to list active breakpoints.

Fields
debuggee_id

string

Required. Identifies the debuggee.

wait_token

string

A token that, if specified, blocks the method call until the list of active breakpoints has changed, or a server-selected timeout has expired. The value should be set from the next_wait_token field in the last response. The initial value should be set to "init".

success_on_timeout

bool

If set to true (recommended), returns google.rpc.Code.OK status and sets the wait_expired response field to true when the server-selected timeout has expired.

If set to false (deprecated), returns google.rpc.Code.ABORTED status when the server-selected timeout has expired.

agent_id

string

Identifies the agent. This is the ID returned in the RegisterDebuggee response.

ListActiveBreakpointsResponse

Response for listing active breakpoints.

Fields
breakpoints[]

Breakpoint

List of all active breakpoints. The fields id and location are guaranteed to be set on each breakpoint.

next_wait_token

string

A token that can be used in the next method call to block until the list of breakpoints changes.

wait_expired

bool

If set to true, indicates that there is no change to the list of active breakpoints and the server-selected timeout has expired. The breakpoints field would be empty and should be ignored.

ListBreakpointsRequest

Request to list breakpoints.

Fields
debuggee_id

string

Required. ID of the debuggee whose breakpoints to list.

include_all_users

bool

When set to true, the response includes the list of breakpoints set by any user. Otherwise, it includes only breakpoints set by the caller.

include_inactive

bool

When set to true, the response includes active and inactive breakpoints. Otherwise, it includes only active breakpoints.

action

BreakpointActionValue

When set, the response includes only breakpoints with the specified action.

strip_results
(deprecated)

bool

This field is deprecated. The following fields are always stripped out of the result: stack_frames, evaluated_expressions and variable_table.

wait_token

string

A wait token that, if specified, blocks the call until the breakpoints list has changed, or a server selected timeout has expired. The value should be set from the last response. The error code google.rpc.Code.ABORTED (RPC) is returned on wait timeout, which should be called again with the same wait_token.

client_version

string

Required. The client version making the call. Schema: domain/type/version (e.g., google.com/intellij/v1).

BreakpointActionValue

Wrapper message for Breakpoint.Action. Defines a filter on the action field of breakpoints.

Fields
value

Action

Only breakpoints with the specified action will pass the filter.

ListBreakpointsResponse

Response for listing breakpoints.

Fields
breakpoints[]

Breakpoint

List of breakpoints matching the request. The fields id and location are guaranteed to be set on each breakpoint. The fields: stack_frames, evaluated_expressions and variable_table are cleared on each breakpoint regardless of its status.

next_wait_token

string

A wait token that can be used in the next call to list (REST) or ListBreakpoints (RPC) to block until the list of breakpoints has changes.

ListDebuggeesRequest

Request to list debuggees.

Fields
project

string

Required. Project number of a Google Cloud project whose debuggees to list.

include_inactive

bool

When set to true, the result includes all debuggees. Otherwise, the result includes only debuggees that are active.

client_version

string

Required. The client version making the call. Schema: domain/type/version (e.g., google.com/intellij/v1).

ListDebuggeesResponse

Response for listing debuggees.

Fields
debuggees[]

Debuggee

List of debuggees accessible to the calling user. The fields debuggee.id and description are guaranteed to be set. The description field is a human readable field provided by agents and can be displayed to users.

RegisterDebuggeeRequest

Request to register a debuggee.

Fields
debuggee

Debuggee

Required. Debuggee information to register. The fields project, uniquifier, description and agent_version of the debuggee must be set.

RegisterDebuggeeResponse

Response for registering a debuggee.

Fields
debuggee

Debuggee

Debuggee resource. The field id is guaranteed to be set (in addition to the echoed fields). If the field is_disabled is set to true, the agent should disable itself by removing all breakpoints and detaching from the application. It should however continue to poll RegisterDebuggee until reenabled.

agent_id

string

A unique ID generated for the agent. Each RegisterDebuggee request will generate a new agent ID.

SetBreakpointRequest

Request to set a breakpoint

Fields
debuggee_id

string

Required. ID of the debuggee where the breakpoint is to be set.

breakpoint

Breakpoint

Required. Breakpoint specification to set. The field location of the breakpoint must be set.

client_version

string

Required. The client version making the call. Schema: domain/type/version (e.g., google.com/intellij/v1).

canary_option

CanaryOption

The canary option set by the user upon setting breakpoint.

CanaryOption

Canary option

Enums
CANARY_OPTION_UNSPECIFIED Depends on the canary_mode of the debuggee.
CANARY_OPTION_TRY_ENABLE Enable the canary for this breakpoint if the canary_mode of the debuggee is not CANARY_MODE_ALWAYS_ENABLED or CANARY_MODE_ALWAYS_DISABLED.
CANARY_OPTION_TRY_DISABLE Disable the canary for this breakpoint if the canary_mode of the debuggee is not CANARY_MODE_ALWAYS_ENABLED or CANARY_MODE_ALWAYS_DISABLED.

SetBreakpointResponse

Response for setting a breakpoint.

Fields
breakpoint

Breakpoint

Breakpoint resource. The field id is guaranteed to be set (in addition to the echoed fields).

SourceLocation

Represents a location in the source code.

Fields
path

string

Path to the source file within the source context of the target binary.

line

int32

Line inside the file. The first line in the file has the value 1.

column

int32

Column within a line. The first column in a line as the value 1. Agents that do not support setting breakpoints on specific columns ignore this field.

StackFrame

Represents a stack frame context.

Fields
function

string

Demangled function name at the call site.

location

SourceLocation

Source location of the call site.

arguments[]

Variable

Set of arguments passed to this function. Note that this might not be populated for all stack frames.

locals[]

Variable

Set of local variables at the stack frame location. Note that this might not be populated for all stack frames.

StatusMessage

Represents a contextual status message. The message can indicate an error or informational status, and refer to specific parts of the containing object. For example, the Breakpoint.status field can indicate an error referring to the BREAKPOINT_SOURCE_LOCATION with the message Location not found.

Fields
is_error

bool

Distinguishes errors from informational messages.

refers_to

Reference

Reference to which the message applies.

description

FormatMessage

Status message text.

Reference

Enumerates references to which the message applies.

Enums
UNSPECIFIED Status doesn't refer to any particular input.
BREAKPOINT_SOURCE_LOCATION Status applies to the breakpoint and is related to its location.
BREAKPOINT_CONDITION Status applies to the breakpoint and is related to its condition.
BREAKPOINT_EXPRESSION Status applies to the breakpoint and is related to its expressions.
BREAKPOINT_AGE Status applies to the breakpoint and is related to its age.
BREAKPOINT_CANARY_FAILED Status applies to the breakpoint when the breakpoint failed to exit the canary state.
VARIABLE_NAME Status applies to the entire variable.
VARIABLE_VALUE Status applies to variable value (variable name is valid).

UpdateActiveBreakpointRequest

Request to update an active breakpoint.

Fields
debuggee_id

string

Required. Identifies the debuggee being debugged.

breakpoint

Breakpoint

Required. Updated breakpoint information. The field id must be set. The agent must echo all Breakpoint specification fields in the update.

UpdateActiveBreakpointResponse

Response for updating an active breakpoint. The message is defined to allow future extensions.

Variable

Represents a variable or an argument possibly of a compound object type. Note how the following variables are represented:

1) A simple variable:

int x = 5

{ name: "x", value: "5", type: "int" }  // Captured variable

2) A compound object:

struct T {
    int m1;
    int m2;
};
T x = { 3, 7 };

{  // Captured variable
    name: "x",
    type: "T",
    members { name: "m1", value: "3", type: "int" },
    members { name: "m2", value: "7", type: "int" }
}

3) A pointer where the pointee was captured:

T x = { 3, 7 };
T* p = &x;

{   // Captured variable
    name: "p",
    type: "T*",
    value: "0x00500500",
    members { name: "m1", value: "3", type: "int" },
    members { name: "m2", value: "7", type: "int" }
}

4) A pointer where the pointee was not captured:

T* p = new T;

{   // Captured variable
    name: "p",
    type: "T*",
    value: "0x00400400"
    status { is_error: true, description { format: "unavailable" } }
}

The status should describe the reason for the missing value, such as <optimized out>, <inaccessible>, <pointers limit reached>.

Note that a null pointer should not have members.

5) An unnamed value:

int* p = new int(7);

{   // Captured variable
    name: "p",
    value: "0x00500500",
    type: "int*",
    members { value: "7", type: "int" } }

6) An unnamed pointer where the pointee was not captured:

int* p = new int(7);
int** pp = &p;

{  // Captured variable
    name: "pp",
    value: "0x00500500",
    type: "int**",
    members {
        value: "0x00400400",
        type: "int*"
        status {
            is_error: true,
            description: { format: "unavailable" } }
        }
    }
}

To optimize computation, memory and network traffic, variables that repeat in the output multiple times can be stored once in a shared variable table and be referenced using the var_table_index field. The variables stored in the shared table are nameless and are essentially a partition of the complete variable. To reconstruct the complete variable, merge the referencing variable with the referenced variable.

When using the shared variable table, the following variables:

T x = { 3, 7 };
T* p = &x;
T& r = x;

{ name: "x", var_table_index: 3, type: "T" }  // Captured variables
{ name: "p", value "0x00500500", type="T*", var_table_index: 3 }
{ name: "r", type="T&", var_table_index: 3 }

{  // Shared variable table entry #3:
    members { name: "m1", value: "3", type: "int" },
    members { name: "m2", value: "7", type: "int" }
}

Note that the pointer address is stored with the referencing variable and not with the referenced variable. This allows the referenced variable to be shared between pointers and references.

The type field is optional. The debugger agent may or may not support it.

Fields
name

string

Name of the variable, if any.

value

string

Simple value of the variable.

type

string

Variable type (e.g. MyClass). If the variable is split with var_table_index, type goes next to value. The interpretation of a type is agent specific. It is recommended to include the dynamic type rather than a static type of an object.

members[]

Variable

Members contained or pointed to by the variable.

var_table_index

Int32Value

Reference to a variable in the shared variable table. More than one variable can reference the same variable in the table. The var_table_index field is an index into variable_table in Breakpoint.

status

StatusMessage

Status associated with the variable. This field will usually stay unset. A status of a single variable only applies to that variable or expression. The rest of breakpoint data still remains valid. Variables might be reported in error state even when breakpoint is not in final state.

The message may refer to variable name with refers_to set to VARIABLE_NAME. Alternatively refers_to will be set to VARIABLE_VALUE. In either case variable value and members will be unset.

Example of error message applied to name: Invalid expression syntax.

Example of information message applied to value: Not captured.

Examples of error message applied to value:

  • Malformed string,
  • Field f not found in class C
  • Null pointer dereference