[lldb-dev] lldb type summary provider - SBProcess is invalid

Lei Kong via lldb-dev lldb-dev at lists.llvm.org
Tue Sep 13 10:02:13 PDT 2016

I wrote a lldb type summary provider for wstring with 16bit wchar on Ubuntu 16.04.Things work fine if I manually do the following in lldb:(lldb) script import mytypes
(lldb) type summary add -F mytypes.wstring_SummaryProvider "std::__1::wstring"
I tried to make things easier with auto-loading by adding the following to .lldbinit:script import mytypes
type summary add -F mytypes.wstring_SummaryProvider "std::__1::wstring"
Then I got a failure of "SBProcess is invalid" when printing a wstring variable.My type summary function has the following, which I believe is where the error is encountered:content = lldb.process.ReadMemory(bufferAddr, byteCount, error)
Maybe this is because "process" is not assigned yet when the type summary is added during auto-loading? Or this is a bug in lldb? Does anyone know how to work around this issue? Thanks much 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20160913/eaa1e974/attachment.html>

More information about the lldb-dev mailing list