A global var is defined in my framework var showersInProgress: [ProgressShower] = []
It's global so that I can stop the program and hopefully examine the state like so:
(lldb) po showersInProgress
error: <user expression 7>:1:1: use of undeclared identifier 'showersInProgress' showersInProgress
(lldb) p showersInProgress
error: <user expression 8>:1:1: use of undeclared identifier 'showersInProgress' showersInProgress
(lldb) frame variable showersInProgress
(lldb) frame showersInProgress
invalid command 'frame showersInProgress'.
(lldb) frame -g showersInProgress
invalid command 'frame -g'.
(lldb) frame -g variable showersInProgress
invalid command 'frame -g'.
(lldb) frame variable -g showersInProgress
(lldb) frame variable -g showersInProgress.count
(lldb)
The log enable -f /tmp/lldb-log.txt lldb expr types in case it's useful to anyone:
== [UserExpression::Evaluate] Parsing expression showersInProgress ==
ClangUserExpression::ScanContext()
[CUE::SC] Null function
[C++ module config] Language doesn't support C++ modules
List of imported modules in expression:
List of include directories gathered for modules:
Parsing the following code:
#line 1 "<lldb wrapper prefix>"
#ifndef offsetof
#define offsetof(t, d) __builtin_offsetof(t, d)
#endif
#ifndef NULL
#define NULL (__null)
#endif
#ifndef Nil
#define Nil (__null)
#endif
#ifndef nil
#define nil (__null)
#endif
#ifndef YES
#define YES ((BOOL)1)
#endif
#ifndef NO
#define NO ((BOOL)0)
#endif
typedef __INT8_TYPE__ int8_t;
typedef __UINT8_TYPE__ uint8_t;
typedef __INT16_TYPE__ int16_t;
typedef __UINT16_TYPE__ uint16_t;
typedef __INT32_TYPE__ int32_t;
typedef __UINT32_TYPE__ uint32_t;
typedef __INT64_TYPE__ int64_t;
typedef __UINT64_TYPE__ uint64_t;
typedef __INTPTR_TYPE__ intptr_t;
typedef __UINTPTR_TYPE__ uintptr_t;
typedef __SIZE_TYPE__ size_t;
typedef __PTRDIFF_TYPE__ ptrdiff_t;
typedef unsigned short unichar;
extern "C"
{
int printf(const char * __restrict, ...);
}
typedef bool BOOL;
void
$__lldb_expr(void *$__lldb_arg)
{
;
#line 1 "<user expression 9>"
showersInProgress
;
#line 1 "<lldb wrapper suffix>"
}
Using x86_64-apple-ios-simulator as the target triple
Using SIMD alignment: 128
Target datalayout string: 'e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128'
Target ABI: ''
Target vector alignment: 128
ClangExpressionDeclMap::FindExternalVisibleDecls[469] for '$__lldb_arg' in a 'TranslationUnit'
CEDM::FEVD[469] Searching the root namespace
ClangASTSource::FindExternalVisibleDecls[469] on (ASTContext*)0x7fb6b48f1800 for '$__lldb_arg' in a 'TranslationUnit'
CAS::FEVD[469] Searching the root namespace
ClangExpressionDeclMap::FindExternalVisibleDecls[470] for '$__lldb_expr' in a 'TranslationUnit'
CEDM::FEVD[470] Searching the root namespace
ClangASTSource::FindExternalVisibleDecls[470] on (ASTContext*)0x7fb6b48f1800 for '$__lldb_expr' in a 'TranslationUnit'
CAS::FEVD[470] Searching the root namespace
ClangExpressionDeclMap::FindExternalVisibleDecls[471] for 'showersInProgress' in a 'TranslationUnit'
CEDM::FEVD[471] Searching the root namespace
Skipped a definition because it has no Clang AST
ClangASTSource::FindExternalVisibleDecls[471] on (ASTContext*)0x7fb6b48f1800 for 'showersInProgress' in a 'TranslationUnit'
CAS::FEVD[471] Searching the root namespace
AppleObjCDeclVendor::FindDecls [434] ('showersInProgress', false, 1, )
AOCTV::FT [434] Couldn't find showersInProgress in the ASTContext
AOCTV::FT [434] Couldn't find the isa
[ClangASTImporter] Forgetting destination (ASTContext*)0x7fb6b48f1800
[ClangASTImporter] Forgetting source->dest (ASTContext*)0x7fb6b48f1800->(ASTContext*)0x7fb69758cc00
frame variableonly shows statics in the CompileUnit of the current frame. If you want to see all the globals you need to usetarget variable. Note, however,target variableonly searches the shared library of the current frame. You can add the--shlibflag to direct the search to a specific shared library. If that doesn't work, then you should probably file a bug with bugs.swift.org with a reproducer for the problem. - Jim Ingham