Collection: debugger.debuggees.breakpoints

Resource: GetBreakpointResponse

Response for getting breakpoint information.

JSON representation
{
  "breakpoint": {
    object(Breakpoint)
  },
}
Field name Type Description
breakpoint object(Breakpoint) Complete breakpoint state. The fields id and location are guaranteed to be set.

Breakpoint

Represents the breakpoint specification, status and results.

JSON representation
{
  "id": string,
  "action": enum(Action),
  "location": {
    object(SourceLocation)
  },
  "condition": string,
  "expressions": [
    string
  ],
  "logMessageFormat": string,
  "logLevel": enum(LogLevel),
  "isFinalState": boolean,
  "createTime": string,
  "finalTime": string,
  "userEmail": string,
  "status": {
    object(StatusMessage)
  },
  "stackFrames": [
    {
      object(StackFrame)
    }
  ],
  "evaluatedExpressions": [
    {
      object(Variable)
    }
  ],
  "variableTable": [
    {
      object(Variable)
    }
  ],
  "labels": {
    string: string,
    ...
  },
}
Field name Type Description
id string Breakpoint identifier, unique in the scope of the debuggee.
action enum(Action) Action that the agent should perform when the code at the breakpoint location is hit.
location object(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.
logMessageFormat 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 logMessageFormat are not logged.

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

logLevel enum(LogLevel) Indicates the severity of the log. Only relevant when action is LOG.
isFinalState boolean When true, indicates that this is a final result and the breakpoint state will not change from here on.
createTime string
(Timestamp format)

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

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

finalTime string
(Timestamp format)

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

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

userEmail string E-mail address of the user that created this breakpoint
status object(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
stackFrames[] object(StackFrame) The stack at breakpoint time.
evaluatedExpressions[] object(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.
variableTable[] object(Variable)

The variableTable 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 variableTable 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 varTableIndex 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 (key: string, value: string)

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

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

Action

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

Enum value Description
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.

SourceLocation

Represents a location in the source code.

JSON representation
{
  "path": string,
  "line": number,
}
Field name Type Description
path string Path to the source file within the source context of the target binary.
line number Line inside the file. The first line in the file has the value 1.

LogLevel

Log severity levels.

Enum value Description
INFO Information log message.
WARNING Warning log message.
ERROR Error log message.

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.

JSON representation
{
  "isError": boolean,
  "refersTo": enum(Reference),
  "description": {
    object(FormatMessage)
  },
}
Field name Type Description
isError boolean Distinguishes errors from informational messages.
refersTo enum(Reference) Reference to which the message applies.
description object(FormatMessage) Status message text.

Reference

Enumerates references to which the message applies.

Enum value Description
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.
VARIABLE_NAME Status applies to the entire variable.
VARIABLE_VALUE Status applies to variable value (variable name is valid).

FormatMessage

Represents a message with parameters.

JSON representation
{
  "format": string,
  "parameters": [
    string
  ],
}
Field name Type Description
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.

StackFrame

Represents a stack frame context.

JSON representation
{
  "function": string,
  "location": {
    object(SourceLocation)
  },
  "arguments": [
    {
      object(Variable)
    }
  ],
  "locals": [
    {
      object(Variable)
    }
  ],
}
Field name Type Description
function string Demangled function name at the call site.
location object(SourceLocation) Source location of the call site.
arguments[] object(Variable) Set of arguments passed to this function. Note that this might not be populated for all stack frames.
locals[] object(Variable) Set of local variables at the stack frame location. Note that this might not be populated for all stack frames.

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 { isError: 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 {
            isError: 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 varTableIndex 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", varTableIndex: 3, type: "T" }  // Captured variables
{ name: "p", value "0x00500500", type="T*", varTableIndex: 3 }
{ name: "r", type="T&", varTableIndex: 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.

JSON representation
{
  "name": string,
  "value": string,
  "type": string,
  "members": [
    {
      object(Variable)
    }
  ],
  "varTableIndex": number,
  "status": {
    object(StatusMessage)
  },
}
Field name Type Description
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 varTableIndex, 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[] object(Variable) Members contained or pointed to by the variable.
varTableIndex number Reference to a variable in the shared variable table. More than one variable can reference the same variable in the table. The varTableIndex field is an index into variableTable in Breakpoint.
status object(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 refersTo set to VARIABLE_NAME. Alternatively refersTo 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

Methods

Method Description
delete Deletes the breakpoint from the debuggee.
get Gets breakpoint information.
list Lists all breakpoints for the debuggee.
set Sets the breakpoint to the debuggee.

Send feedback about...

Stackdriver Debugger Documentation