class DataId

Defined at line 36 of file ../../src/developer/debug/zxdb/debug_adapter/data_id.h

Represents the DAP `dataId` identifier exchanged between `dataBreakpointInfo` and

`setDataBreakpoints` requests, as well as `zxdb.SetTracepoints` watch specifications.

Format:

"<process_koid>:0x<address_hex>:<byte_size>"

Example: "17601:0x7ffee1234000:4"

Fields

&

Invariants:

- `process_koid`: Base-10 Zircon KOID of the target process. Must be non-zero

(`ZX_KOID_INVALID` == 0 is rejected). Because virtual memory addresses are only meaningful

within the address space of the process in which the expression was evaluated, a valid

process KOID is always required so the watchpoint is scoped strictly to that process.

- `address`: Base-16 virtual address prefixed with "0x" or "0X". Must not overflow the 64-bit

address space when combined with `byte_size` (`address

<

= UINT64_MAX - byte_size`).

- `byte_size`: Base-10 size in bytes of the watched memory location. Must be supported by the

target architecture's hardware debug registers (`BreakpointSettings::ValidateSize`).

Public Methods

ErrOr<DataId> FromExprValue (debug::Arch arch, uint64_t process_koid, const std::string & name, const ExprValue & value)

Evaluates whether `value` can be watched and returns a validated `DataId`, or an `Err`

describing why a data breakpoint cannot be set on `value`. Only properties of the value itself

are checked here; `process_koid` must already be a valid (non-zero) KOID.

Defined at line 23 of file ../../src/developer/debug/zxdb/debug_adapter/data_id.cc

uint64_t process_koid ()

Defined at line 54 of file ../../src/developer/debug/zxdb/debug_adapter/data_id.h

uint64_t address ()

Defined at line 55 of file ../../src/developer/debug/zxdb/debug_adapter/data_id.h

ErrOr<DataId> Parse (std::string_view data_id)

Parses a `

<process

_koid>:0x

<address

_hex>:

<byte

_size>` string and checks format, non-zero

`process_koid`, and 64-bit address range overflow invariants.

Defined at line 55 of file ../../src/developer/debug/zxdb/debug_adapter/data_id.cc

uint32_t byte_size ()

Defined at line 56 of file ../../src/developer/debug/zxdb/debug_adapter/data_id.h

Err ValidateSize (debug::Arch arch, BreakpointSettings::Type type)

Validates that `byte_size()` is supported by `arch` for the given hardware watchpoint `type`.

Defined at line 98 of file ../../src/developer/debug/zxdb/debug_adapter/data_id.cc

std::string ToString ()

Formats this `DataId` into its canonical string representation.

Defined at line 102 of file ../../src/developer/debug/zxdb/debug_adapter/data_id.cc