Unable to view variable values ​​in debugger after Swift 3 migration

We migrated our iOS project to Swift 3 and Xcode 8. Since then, the debugger cannot show any value for the variables. If I try to print a variable:

p someVar 

I am getting this error message. SchemaManager.h is a bridge header. (The actual name of the project is replaced by yyy below):

 warning: Swift error in module yyy. Debug info from this module will be unavailable in the debugger. error: in auto-import: failed to get module 'yyy' from AST context: /Users/xxx/Documents/yyy/yyy/Common/Model/SchemaManager.h:10:9: note: while building module 'SQLiteMacOSX' imported from /Users/xxx/Documents/yyy/yyy/Common/Model/SchemaManager.h:10: #import <sqlite3.h> ^ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.0.sdk/usr/include/sqlite3.h:35:10: note: while building module 'Darwin' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.0.sdk/usr/include/sqlite3.h:35: #include <stdarg.h> /* Needed for the definition of va_list */ ^ <module-includes>:33:9: note: in file included from <module-includes>:33: #import "util.h" ^ error: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/util.h:107:10: error: 'utmp.h' file not found with <angled> include; use "quotes" instead #include <utmp.h> ^ /Users/xxx/Documents/yyy/yyy/Common/Model/SchemaManager.h:10:9: note: while building module 'SQLiteMacOSX' imported from /Users/xxx/Documents/yyy/yyy/Common/Model/SchemaManager.h:10: #import <sqlite3.h> ^ <module-includes>:1:9: note: in file included from <module-includes>:1: #import "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sqlite3.h" ^ error: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.0.sdk/usr/include/sqlite3.h:35:10: error: could not build module 'Darwin' #include <stdarg.h> /* Needed for the definition of va_list */ ^ /Users/xxx/Documents/yyy/yyy/Common/Model/Bridging-Header.h:12:9: note: in file included from /Users/xxx/Documents/yyy/yyy/Common/Model/Bridging-Header.h:12: #import "SchemaManager.h" ^ error: /Users/xxx/Documents/yyy/yyy/Common/Model/SchemaManager.h:10:9: error: could not build module 'SQLiteMacOSX' #import <sqlite3.h> ^ error: failed to import bridging header '/Users/xxx/Documents/yyy/yyy/Common/Model/Bridging-Header.h' 

The main error is as follows:

 error: 'utmp.h' file not found 

Elsewhere, I read that problems with the bridge header can prevent the debugger from displaying variable values. But I'm not sure how I fix this problem.

+6
source share
1 answer

TL; DR; Clear the header of the bridge and make sure that you have only what you need.

I had the same problem, but without output after failed to get module 'yyy' from AST context . I removed everything from my header and added the elements back one by one to make sure I needed everything.

I found that adding #import <UIKit/UIKit.h> at the top was necessary (but initially absent) and found a few that I did not need when I changed the project structure and forgot to remove some of the inclusions. After all this, he began to work. Hope this helps.

+1
source

Source: https://habr.com/ru/post/1011896/


All Articles