LLDB是否具有便利变量($ var)? [英] Does LLDB have convenience variables ($var)?

查看:61
本文介绍了LLDB是否具有便利变量($ var)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

LLDB是否具有便捷变量?如果是这样,我该如何使用它们?如果没有,我可以使用类似的东西吗?

Does LLDB have convenience variables? If so, how do I use them? If not, is there anything similar that I can use?

参考: http://软件.intel.com/sites/products/documentation/hpc/atom/application/debugger/commands143.html

推荐答案

我终于自己弄清楚了.在LLDB中运行help expr,您将看到:

I finally figured it out myself. Run help expr in LLDB and you will see:

用户定义的变量: 您可以定义自己的变量以方便使用或在后续表达式中使用. 定义它们的方式与在C中定义变量的方式相同.如果第一个字符为 您的用户定义变量为$,则该变量的值将来会可用 表达式,否则它将仅在当前表达式中可用.

User defined variables: You can define your own variables for convenience or to be used in subsequent expressions. You define them the same way you would define variables in C. If the first character of your user defined variable is a $, then the variable's value will be available in future expressions, otherwise it will just be available in the current expression.

所以expr int $foo = 5是我想要的.

这篇关于LLDB是否具有便利变量($ var)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆