3 Star 3 Fork 1

Gitee 极速下载/OpenCombine

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/broadwaylamb/OpenCombine
克隆/下载
opencombine_lldb.py 1.08 KB
一键复制 编辑 原始数据 按行查看 历史
# 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"')
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Swift
1
https://gitee.com/mirrors/OpenCombine.git
git@gitee.com:mirrors/OpenCombine.git
mirrors
OpenCombine
OpenCombine
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385