Google is committed to advancing racial equity for Black communities. See how.

Evaluating and printing expressions in zxdb

The print command can evaluate simple C/C++ expressions in the context of a stack frame. When a thread is suspended (see “Working with threads” above) just type:

[zxdb] print i

Expressions can use most simple C/C++ syntax:

[zxdb] print &foo->bar[baz]
(const MyStruct*) 0x59f4e1268f70

You can also evaluate expressions in the context of other stack frames without switching to them (see “Interaction model” above for more):

[zxdb] frame 2 print argv[0]

Often you will want to see all local variables:

[zxdb] locals
argc = 1
argv = (const char* const*) 0x59999ec02dc0

You can also set variables:

[zxdb] print done_flag = true
[zddb] print i = 56