Class Controller2Client (2.11.0)

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.

Equality

Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection> objects compare equal. Objects that compare equal share the same underlying resources.

Performance

Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.

Thread Safety

Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.

Constructors

Controller2Client(Controller2Client const &)

Copy and move support

Parameter
NameDescription
Controller2Client const &

Controller2Client(Controller2Client &&)

Copy and move support

Parameter
NameDescription
Controller2Client &&

Controller2Client(std::shared_ptr< Controller2Connection >, Options)

Parameters
NameDescription
connection std::shared_ptr< Controller2Connection >
opts Options

Operators

operator=(Controller2Client const &)

Copy and move support

Parameter
NameDescription
Controller2Client const &
Returns
TypeDescription
Controller2Client &

operator=(Controller2Client &&)

Copy and move support

Parameter
NameDescription
Controller2Client &&
Returns
TypeDescription
Controller2Client &

Functions

RegisterDebuggee(google::devtools::clouddebugger::v2::Debuggee const &, Options)

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.

Parameters
NameDescription
debuggee google::devtools::clouddebugger::v2::Debuggee const &

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

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::devtools::clouddebugger::v2::RegisterDebuggeeResponse >

the result of the RPC. The response message type (google.devtools.clouddebugger.v2.RegisterDebuggeeResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

RegisterDebuggee(google::devtools::clouddebugger::v2::RegisterDebuggeeRequest const &, Options)

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.

Parameters
NameDescription
request google::devtools::clouddebugger::v2::RegisterDebuggeeRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.devtools.clouddebugger.v2.RegisterDebuggeeRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::devtools::clouddebugger::v2::RegisterDebuggeeResponse >

the result of the RPC. The response message type (google.devtools.clouddebugger.v2.RegisterDebuggeeResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

ListActiveBreakpoints(std::string const &, Options)

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.

Parameters
NameDescription
debuggee_id std::string const &

Required. Identifies the debuggee.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::devtools::clouddebugger::v2::ListActiveBreakpointsResponse >

the result of the RPC. The response message type (google.devtools.clouddebugger.v2.ListActiveBreakpointsResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

ListActiveBreakpoints(google::devtools::clouddebugger::v2::ListActiveBreakpointsRequest const &, Options)

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.

Parameters
NameDescription
request google::devtools::clouddebugger::v2::ListActiveBreakpointsRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.devtools.clouddebugger.v2.ListActiveBreakpointsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::devtools::clouddebugger::v2::ListActiveBreakpointsResponse >

the result of the RPC. The response message type (google.devtools.clouddebugger.v2.ListActiveBreakpointsResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

UpdateActiveBreakpoint(std::string const &, google::devtools::clouddebugger::v2::Breakpoint const &, Options)

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.

Parameters
NameDescription
debuggee_id std::string const &

Required. Identifies the debuggee being debugged.

breakpoint google::devtools::clouddebugger::v2::Breakpoint const &

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

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::devtools::clouddebugger::v2::UpdateActiveBreakpointResponse >

the result of the RPC. The response message type (google.devtools.clouddebugger.v2.UpdateActiveBreakpointResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

UpdateActiveBreakpoint(google::devtools::clouddebugger::v2::UpdateActiveBreakpointRequest const &, Options)

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.

Parameters
NameDescription
request google::devtools::clouddebugger::v2::UpdateActiveBreakpointRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.devtools.clouddebugger.v2.UpdateActiveBreakpointRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::devtools::clouddebugger::v2::UpdateActiveBreakpointResponse >

the result of the RPC. The response message type (google.devtools.clouddebugger.v2.UpdateActiveBreakpointResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.