Index: source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp =================================================================== --- source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp +++ source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp @@ -648,6 +648,8 @@ // The ClangASTSource is not responsible for finding $-names. if (name_unique_cstr[0] == '$') return; + if (name_unique_cstr[0] == '_' && name_unique_cstr[1] == '$') + return; if (module_sp && namespace_decl) { CompilerDeclContext found_namespace_decl; Index: source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp =================================================================== --- source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp +++ source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp @@ -809,6 +809,9 @@ } while (0); } + if (name_unique_cstr[0] == '_' && name_unique_cstr[1] == '$') + return; + if (name_unique_cstr[0] == '$' && !namespace_decl) { static ConstString g_lldb_class_name("$__lldb_class"); Index: source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp =================================================================== --- source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp +++ source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp @@ -812,84 +812,44 @@ int len = 0; if (m_has_object_getClass) { len = ::snprintf(check_function_code, sizeof(check_function_code), - "extern \"C\" void *gdb_object_getClass(void *); " - " \n" - "extern \"C\" int printf(const char *format, ...); " - " \n" - "extern \"C\" void " - " \n" - "%s(void *$__lldb_arg_obj, void *$__lldb_arg_selector) " - " \n" - "{ " - " \n" - " if ($__lldb_arg_obj == (void *)0) " - " \n" - " return; // nil is ok " - " \n" - " if (!gdb_object_getClass($__lldb_arg_obj)) " - " \n" - " *((volatile int *)0) = 'ocgc'; " - " \n" - " else if ($__lldb_arg_selector != (void *)0) " - " \n" - " { " - " \n" - " signed char responds = (signed char) [(id) " - "$__lldb_arg_obj \n" - " " - "respondsToSelector: \n" - " (struct " - "objc_selector *) $__lldb_arg_selector]; \n" - " if (responds == (signed char) 0) " - " \n" - " *((volatile int *)0) = 'ocgc'; " - " \n" - " } " - " \n" - "} " - " \n", - name); + "extern \"C\" void *gdb_object_getClass(void *); \n" + "extern \"C\" int printf(const char *format, ...); \n" + "extern \"C\" void \n" + "%s(void *$__lldb_arg_obj, void *$__lldb_arg_selector) {\n" + " if ($__lldb_arg_obj == (void *)0) \n" + " return; // nil is ok \n" + " if (!gdb_object_getClass($__lldb_arg_obj)) { \n" + " *((volatile int *)0) = 'ocgc'; \n" + " } else if ($__lldb_arg_selector != (void *)0) { \n" + " signed char $responds = (signed char) \n" + " [(id)$__lldb_arg_obj respondsToSelector: \n" + " (void *) $__lldb_arg_selector]; \n" + " if ($responds == (signed char) 0) \n" + " *((volatile int *)0) = 'ocgc'; \n" + " } \n" + "} \n" + , name); } else { len = ::snprintf(check_function_code, sizeof(check_function_code), - "extern \"C\" void *gdb_class_getClass(void *); " - " \n" - "extern \"C\" int printf(const char *format, ...); " - " \n" - "extern \"C\" void " - " \n" - "%s(void *$__lldb_arg_obj, void *$__lldb_arg_selector) " - " \n" - "{ " - " \n" - " if ($__lldb_arg_obj == (void *)0) " - " \n" - " return; // nil is ok " - " \n" - " void **$isa_ptr = (void **)$__lldb_arg_obj; " - " \n" - " if (*$isa_ptr == (void *)0 || " - "!gdb_class_getClass(*$isa_ptr)) \n" - " *((volatile int *)0) = 'ocgc'; " - " \n" - " else if ($__lldb_arg_selector != (void *)0) " - " \n" - " { " - " \n" - " signed char responds = (signed char) [(id) " - "$__lldb_arg_obj \n" - " " - "respondsToSelector: \n" - " (struct " - "objc_selector *) $__lldb_arg_selector]; \n" - " if (responds == (signed char) 0) " - " \n" - " *((volatile int *)0) = 'ocgc'; " - " \n" - " } " - " \n" - "} " - " \n", - name); + "extern \"C\" void *gdb_class_getClass(void *); \n" + "extern \"C\" int printf(const char *format, ...); \n" + "extern \"C\" void \n" + "%s(void *$__lldb_arg_obj, void *$__lldb_arg_selector) {\n" + " if ($__lldb_arg_obj == (void *)0) \n" + " return; // nil is ok \n" + " void **$isa_ptr = (void **)$__lldb_arg_obj; \n" + " if (*$isa_ptr == (void *)0 || \n" + " !gdb_class_getClass(*$isa_ptr)) \n" + " *((volatile int *)0) = 'ocgc'; \n" + " else if ($__lldb_arg_selector != (void *)0) { \n" + " signed char $responds = (signed char) \n" + " [(id)$__lldb_arg_obj respondsToSelector: \n" + " (void *) $__lldb_arg_selector]; \n" + " if ($responds == (signed char) 0) \n" + " *((volatile int *)0) = 'ocgc'; \n" + " } \n" + "} \n" + , name); } assert(len < (int)sizeof(check_function_code));