Types lldb类型摘要提供程序-SBProcess无效

Types lldb类型摘要提供程序-SBProcess无效,types,lldb,provider,summary,Types,Lldb,Provider,Summary,我在Ubuntu 16.04上用16位wchar为wstring编写了一个lldb类型的摘要提供程序 如果我在lldb中手动执行以下操作,一切正常: (lldb) script import mytypes (lldb) type summary add -F mytypes.wstring_SummaryProvider "std::__1::wstring" 我试图通过在.lldbinit中添加以下内容来简化自动加载: script import mytypes type summary

我在Ubuntu 16.04上用16位wchar为wstring编写了一个lldb类型的摘要提供程序

如果我在lldb中手动执行以下操作,一切正常:

(lldb) script import mytypes
(lldb) type summary add -F mytypes.wstring_SummaryProvider "std::__1::wstring"
我试图通过在.lldbinit中添加以下内容来简化自动加载:

script import mytypes
type summary add -F mytypes.wstring_SummaryProvider "std::__1::wstring"
然后,在打印wstring变量时,出现了“SBProcess is invalid”故障

My type summary函数具有以下内容,我认为这是遇到错误的地方:

content = lldb.process.ReadMemory(bufferAddr, byteCount, error)
这可能是因为在自动加载期间添加类型摘要时,尚未分配“进程”

有人知道如何让我的脚本自动加载吗


非常感谢

Enrico已经在lldb dev上回答了这个问题:

但对于以下这些人:

lldb.process
lldb.thread
等变量仅用于在交互式python解释器中方便使用,而不用于为断点、数据格式化程序、命令等运行的python代码


在多线程调试器中,试图将“当前线程”的全局概念呈现给任何可能运行的脚本代码位是没有意义的。相反,运行脚本的每个上下文都知道与其相关的进程/线程/帧。对于数据格式化程序,它们总是会通过
SBValue.GetProcess()
API获得正在处理的值,并且知道相关流程。

Enrico已经在lldb dev上回答了这个问题:

但对于以下这些人:

lldb.process
lldb.thread
等变量仅用于在交互式python解释器中方便使用,而不用于为断点、数据格式化程序、命令等运行的python代码

在多线程调试器中,试图将“当前线程”的全局概念呈现给任何可能运行的脚本代码位是没有意义的。相反,运行脚本的每个上下文都知道与其相关的进程/线程/帧。对于数据格式化程序,它们总是通过
SBValue.GetProcess()
API传递正在处理的值,该值知道相关流程