Class Variable.Builder (1.22.0)

public static final class Variable.Builder extends GeneratedMessageV3.Builder<Variable.Builder> implements VariableOrBuilder

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 = &amp;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 = &amp;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 = &amp;x;
 T&amp; 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&amp;", 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.

Protobuf type google.devtools.clouddebugger.v2.Variable

Implements

VariableOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addAllMembers(Iterable<? extends Variable> values)

public Variable.Builder addAllMembers(Iterable<? extends Variable> values)

Members contained or pointed to by the variable.

repeated .google.devtools.clouddebugger.v2.Variable members = 3;

Parameter
NameDescription
valuesIterable<? extends com.google.devtools.clouddebugger.v2.Variable>
Returns
TypeDescription
Variable.Builder

addMembers(Variable value)

public Variable.Builder addMembers(Variable value)

Members contained or pointed to by the variable.

repeated .google.devtools.clouddebugger.v2.Variable members = 3;

Parameter
NameDescription
valueVariable
Returns
TypeDescription
Variable.Builder

addMembers(Variable.Builder builderForValue)

public Variable.Builder addMembers(Variable.Builder builderForValue)

Members contained or pointed to by the variable.

repeated .google.devtools.clouddebugger.v2.Variable members = 3;

Parameter
NameDescription
builderForValueVariable.Builder
Returns
TypeDescription
Variable.Builder

addMembers(int index, Variable value)

public Variable.Builder addMembers(int index, Variable value)

Members contained or pointed to by the variable.

repeated .google.devtools.clouddebugger.v2.Variable members = 3;

Parameters
NameDescription
indexint
valueVariable
Returns
TypeDescription
Variable.Builder

addMembers(int index, Variable.Builder builderForValue)

public Variable.Builder addMembers(int index, Variable.Builder builderForValue)

Members contained or pointed to by the variable.

repeated .google.devtools.clouddebugger.v2.Variable members = 3;

Parameters
NameDescription
indexint
builderForValueVariable.Builder
Returns
TypeDescription
Variable.Builder

addMembersBuilder()

public Variable.Builder addMembersBuilder()

Members contained or pointed to by the variable.

repeated .google.devtools.clouddebugger.v2.Variable members = 3;

Returns
TypeDescription
Variable.Builder

addMembersBuilder(int index)

public Variable.Builder addMembersBuilder(int index)

Members contained or pointed to by the variable.

repeated .google.devtools.clouddebugger.v2.Variable members = 3;

Parameter
NameDescription
indexint
Returns
TypeDescription
Variable.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Variable.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Variable.Builder
Overrides

build()

public Variable build()
Returns
TypeDescription
Variable

buildPartial()

public Variable buildPartial()
Returns
TypeDescription
Variable

clear()

public Variable.Builder clear()
Returns
TypeDescription
Variable.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public Variable.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
Variable.Builder
Overrides

clearMembers()

public Variable.Builder clearMembers()

Members contained or pointed to by the variable.

repeated .google.devtools.clouddebugger.v2.Variable members = 3;

Returns
TypeDescription
Variable.Builder

clearName()

public Variable.Builder clearName()

Name of the variable, if any.

string name = 1;

Returns
TypeDescription
Variable.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Variable.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
Variable.Builder
Overrides

clearStatus()

public Variable.Builder clearStatus()

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

.google.devtools.clouddebugger.v2.StatusMessage status = 5;

Returns
TypeDescription
Variable.Builder

clearType()

public Variable.Builder clearType()

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.

string type = 6;

Returns
TypeDescription
Variable.Builder

This builder for chaining.

clearValue()

public Variable.Builder clearValue()

Simple value of the variable.

string value = 2;

Returns
TypeDescription
Variable.Builder

This builder for chaining.

clearVarTableIndex()

public Variable.Builder clearVarTableIndex()

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.

.google.protobuf.Int32Value var_table_index = 4;

Returns
TypeDescription
Variable.Builder

clone()

public Variable.Builder clone()
Returns
TypeDescription
Variable.Builder
Overrides

getDefaultInstanceForType()

public Variable getDefaultInstanceForType()
Returns
TypeDescription
Variable

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getMembers(int index)

public Variable getMembers(int index)

Members contained or pointed to by the variable.

repeated .google.devtools.clouddebugger.v2.Variable members = 3;

Parameter
NameDescription
indexint
Returns
TypeDescription
Variable

getMembersBuilder(int index)

public Variable.Builder getMembersBuilder(int index)

Members contained or pointed to by the variable.

repeated .google.devtools.clouddebugger.v2.Variable members = 3;

Parameter
NameDescription
indexint
Returns
TypeDescription
Variable.Builder

getMembersBuilderList()

public List<Variable.Builder> getMembersBuilderList()

Members contained or pointed to by the variable.

repeated .google.devtools.clouddebugger.v2.Variable members = 3;

Returns
TypeDescription
List<Builder>

getMembersCount()

public int getMembersCount()

Members contained or pointed to by the variable.

repeated .google.devtools.clouddebugger.v2.Variable members = 3;

Returns
TypeDescription
int

getMembersList()

public List<Variable> getMembersList()

Members contained or pointed to by the variable.

repeated .google.devtools.clouddebugger.v2.Variable members = 3;

Returns
TypeDescription
List<Variable>

getMembersOrBuilder(int index)

public VariableOrBuilder getMembersOrBuilder(int index)

Members contained or pointed to by the variable.

repeated .google.devtools.clouddebugger.v2.Variable members = 3;

Parameter
NameDescription
indexint
Returns
TypeDescription
VariableOrBuilder

getMembersOrBuilderList()

public List<? extends VariableOrBuilder> getMembersOrBuilderList()

Members contained or pointed to by the variable.

repeated .google.devtools.clouddebugger.v2.Variable members = 3;

Returns
TypeDescription
List<? extends com.google.devtools.clouddebugger.v2.VariableOrBuilder>

getName()

public String getName()

Name of the variable, if any.

string name = 1;

Returns
TypeDescription
String

The name.

getNameBytes()

public ByteString getNameBytes()

Name of the variable, if any.

string name = 1;

Returns
TypeDescription
ByteString

The bytes for name.

getStatus()

public StatusMessage getStatus()

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

.google.devtools.clouddebugger.v2.StatusMessage status = 5;

Returns
TypeDescription
StatusMessage

The status.

getStatusBuilder()

public StatusMessage.Builder getStatusBuilder()

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

.google.devtools.clouddebugger.v2.StatusMessage status = 5;

Returns
TypeDescription
StatusMessage.Builder

getStatusOrBuilder()

public StatusMessageOrBuilder getStatusOrBuilder()

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

.google.devtools.clouddebugger.v2.StatusMessage status = 5;

Returns
TypeDescription
StatusMessageOrBuilder

getType()

public String getType()

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.

string type = 6;

Returns
TypeDescription
String

The type.

getTypeBytes()

public ByteString getTypeBytes()

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.

string type = 6;

Returns
TypeDescription
ByteString

The bytes for type.

getValue()

public String getValue()

Simple value of the variable.

string value = 2;

Returns
TypeDescription
String

The value.

getValueBytes()

public ByteString getValueBytes()

Simple value of the variable.

string value = 2;

Returns
TypeDescription
ByteString

The bytes for value.

getVarTableIndex()

public Int32Value getVarTableIndex()

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.

.google.protobuf.Int32Value var_table_index = 4;

Returns
TypeDescription
Int32Value

The varTableIndex.

getVarTableIndexBuilder()

public Int32Value.Builder getVarTableIndexBuilder()

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.

.google.protobuf.Int32Value var_table_index = 4;

Returns
TypeDescription
Builder

getVarTableIndexOrBuilder()

public Int32ValueOrBuilder getVarTableIndexOrBuilder()

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.

.google.protobuf.Int32Value var_table_index = 4;

Returns
TypeDescription
Int32ValueOrBuilder

hasStatus()

public boolean hasStatus()

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

.google.devtools.clouddebugger.v2.StatusMessage status = 5;

Returns
TypeDescription
boolean

Whether the status field is set.

hasVarTableIndex()

public boolean hasVarTableIndex()

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.

.google.protobuf.Int32Value var_table_index = 4;

Returns
TypeDescription
boolean

Whether the varTableIndex field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(Variable other)

public Variable.Builder mergeFrom(Variable other)
Parameter
NameDescription
otherVariable
Returns
TypeDescription
Variable.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Variable.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Variable.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public Variable.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
Variable.Builder
Overrides

mergeStatus(StatusMessage value)

public Variable.Builder mergeStatus(StatusMessage value)

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

.google.devtools.clouddebugger.v2.StatusMessage status = 5;

Parameter
NameDescription
valueStatusMessage
Returns
TypeDescription
Variable.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Variable.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Variable.Builder
Overrides

mergeVarTableIndex(Int32Value value)

public Variable.Builder mergeVarTableIndex(Int32Value value)

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.

.google.protobuf.Int32Value var_table_index = 4;

Parameter
NameDescription
valueInt32Value
Returns
TypeDescription
Variable.Builder

removeMembers(int index)

public Variable.Builder removeMembers(int index)

Members contained or pointed to by the variable.

repeated .google.devtools.clouddebugger.v2.Variable members = 3;

Parameter
NameDescription
indexint
Returns
TypeDescription
Variable.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public Variable.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Variable.Builder
Overrides

setMembers(int index, Variable value)

public Variable.Builder setMembers(int index, Variable value)

Members contained or pointed to by the variable.

repeated .google.devtools.clouddebugger.v2.Variable members = 3;

Parameters
NameDescription
indexint
valueVariable
Returns
TypeDescription
Variable.Builder

setMembers(int index, Variable.Builder builderForValue)

public Variable.Builder setMembers(int index, Variable.Builder builderForValue)

Members contained or pointed to by the variable.

repeated .google.devtools.clouddebugger.v2.Variable members = 3;

Parameters
NameDescription
indexint
builderForValueVariable.Builder
Returns
TypeDescription
Variable.Builder

setName(String value)

public Variable.Builder setName(String value)

Name of the variable, if any.

string name = 1;

Parameter
NameDescription
valueString

The name to set.

Returns
TypeDescription
Variable.Builder

This builder for chaining.

setNameBytes(ByteString value)

public Variable.Builder setNameBytes(ByteString value)

Name of the variable, if any.

string name = 1;

Parameter
NameDescription
valueByteString

The bytes for name to set.

Returns
TypeDescription
Variable.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public Variable.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
Variable.Builder
Overrides

setStatus(StatusMessage value)

public Variable.Builder setStatus(StatusMessage value)

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

.google.devtools.clouddebugger.v2.StatusMessage status = 5;

Parameter
NameDescription
valueStatusMessage
Returns
TypeDescription
Variable.Builder

setStatus(StatusMessage.Builder builderForValue)

public Variable.Builder setStatus(StatusMessage.Builder builderForValue)

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

.google.devtools.clouddebugger.v2.StatusMessage status = 5;

Parameter
NameDescription
builderForValueStatusMessage.Builder
Returns
TypeDescription
Variable.Builder

setType(String value)

public Variable.Builder setType(String value)

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.

string type = 6;

Parameter
NameDescription
valueString

The type to set.

Returns
TypeDescription
Variable.Builder

This builder for chaining.

setTypeBytes(ByteString value)

public Variable.Builder setTypeBytes(ByteString value)

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.

string type = 6;

Parameter
NameDescription
valueByteString

The bytes for type to set.

Returns
TypeDescription
Variable.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final Variable.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Variable.Builder
Overrides

setValue(String value)

public Variable.Builder setValue(String value)

Simple value of the variable.

string value = 2;

Parameter
NameDescription
valueString

The value to set.

Returns
TypeDescription
Variable.Builder

This builder for chaining.

setValueBytes(ByteString value)

public Variable.Builder setValueBytes(ByteString value)

Simple value of the variable.

string value = 2;

Parameter
NameDescription
valueByteString

The bytes for value to set.

Returns
TypeDescription
Variable.Builder

This builder for chaining.

setVarTableIndex(Int32Value value)

public Variable.Builder setVarTableIndex(Int32Value value)

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.

.google.protobuf.Int32Value var_table_index = 4;

Parameter
NameDescription
valueInt32Value
Returns
TypeDescription
Variable.Builder

setVarTableIndex(Int32Value.Builder builderForValue)

public Variable.Builder setVarTableIndex(Int32Value.Builder builderForValue)

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.

.google.protobuf.Int32Value var_table_index = 4;

Parameter
NameDescription
builderForValueBuilder
Returns
TypeDescription
Variable.Builder