代码拉取完成,页面将自动刷新
# To use `opencombine_lldb.py`, figure out its full path.
# Let's say the full path is `~/projects/OpenCombine/opencombine_lldb.py`.
# Then add the following statement to your `~/.lldbinit` file:
#
# command script import ~/projects/OpenCombine/opencombine_lldb.py
import lldb
# Show a Demand as either `max(N)` or `unlimited`.
def summary_Demand(sb_value, internal_dict):
child = sb_value.GetChildAtIndex(0)
if not child.IsValid():
return 'failed to get child of Demand'
number = child.GetValueAsUnsigned()
# .unlimited is represented by a rawValue of UInt(Int.max) + 1.
# Int.max is either 2**31 - 1 or 2**63 - 1 depending on the
# target platform. So .unlimited is either 2**31 or 2**63.
# 31 = 4 * 8 - 1
# 63 = 8 * 8 - 1
unlimited = 2**(child.GetByteSize() * 8 - 1)
if number == unlimited:
return 'unlimited'
else:
return 'max(%d)' % number
def __lldb_init_module(debugger, internal_dict):
debugger.HandleCommand('type summary add -w swift OpenCombine.Subscribers.Demand -F "' + __name__ + '.summary_Demand"')
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。