如何在 LLDB 调试器中打印 C 变量?

问题描述 投票:0回答:1

我正在 Xcode 4 中工作,我想在调试器中打印变量,如

int
s、
char
s、数组、自定义
struct
s 等。这可能吗?

使用 Objective-C 我可以做类似的事情:

int three = 3;
> po [NSString stringWithFormat:@"%i", three];

谢谢。

c xcode lldb
1个回答
20
投票

po
代表打印对象,它本质上是调用对象上的
description
方法。

使用

p
打印整数。例如:

p three
© www.soinside.com 2019 - 2024. All rights reserved.