johnno1962 / InjectionNext

Fourth evolution of Code Injection for Xcode
MIT License
71 stars 2 forks source link

`Debugging will be degraded due to missing types` messages after injecting a line. #31

Open oryonatan opened 2 days ago

oryonatan commented 2 days ago

When running on XCode 16.1 (and probably on 16 also), after injecting a line and setting a breakpoint after the injected line, I get the console spammed with messages of this format,

warning: (arm64) /private/tmp/injectionNext_1.o 0x0000000000000d28: unable to locate module needed for external types: /Users/username/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/TJZDPFCRP0EQ/ReactiveObjC-16199V7YXXMIS.pcm
error: '/Users/username/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/TJZDPFCRP0EQ/ReactiveObjC-16199V7YXXMIS.pcm' does not exist
Debugging will be degraded due to missing types. Rebuilding the project will regenerate the needed module files.warning: (arm64) /private/tmp/injectionNext_1.o 0x0000000000000d52: unable to locate module needed for external types: /Users/username/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/TJZDPFCRP0EQ/Foundation-213A4VPDZWIP8.pcm
error: '/Users/username/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/TJZDPFCRP0EQ/Foundation-213A4VPDZWIP8.pcm' does not exist
Debugging will be degraded due to missing types. Rebuilding the project will regenerate the needed module files.warning: (arm64) /private/tmp/injectionNext_1.o 0x0000000000000d7c: unable to locate module needed for external types: /Users/username/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/TJZDPFCRP0EQ/UIKit-3U0YAUCGA4RO2.pcm
error: '/Users/username/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/TJZDPFCRP0EQ/UIKit-3U0YAUCGA4RO2.pcm' does not exist
Debugging will be degraded due to missing types. Rebuilding the project will regenerate the needed module files.warning: (arm64) /private/tmp/injectionNext_1.o 0x0000000000000da6: unable to locate module needed for external types: /Users/username/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/TJZDPFCRP0EQ/_SwiftConcurrencyShims-VUGHILSV67V7.pcm
error: '/Users/username/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/TJZDPFCRP0EQ/_SwiftConcurrencyShims-VUGHILSV67V7.pcm' does not exist
Debugging will be degraded due to missing types. Rebuilding the project will regenerate the needed module files.warning: (arm64) /private/tmp/injectionNext_1.o 0x0000000000000dd0: unable to locate module needed for external types: /Users/username/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/TJZDPFCRP0EQ/RxCocoa-24S3KVXWBXIKZ.pcm
error: '/Users/username/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/TJZDPFCRP0EQ/RxCocoa-24S3KVXWBXIKZ.pcm' does not exist
Debugging will be degraded due to missing types. Rebuilding the project will regenerate the needed module files.warning: (arm64) /private/tmp/injectionNext_1.o 0x0000000000000dfa: unable to locate module needed for external types: /Users/username/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/TJZDPFCRP0EQ/FirebaseAnalytics-2KH6RNZYQEA8C.pcm
error: '/Users/username/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/TJZDPFCRP0EQ/FirebaseAnalytics-2KH6RNZYQEA8C.pcm' does not exist
Debugging will be degraded due to missing types. Rebuilding the project will regenerate the needed module files.warning: (arm64) /private/tmp/injectionNext_1.o 0x0000000000000e24: unable to locate module needed for external types: /Users/username/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/TJZDPFCRP0EQ/FirebaseCore-29SM1U01AYSDO.pcm
error: '/Users/username/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/TJZDPFCRP0EQ/FirebaseCore-29SM1U01AYSDO.pcm' does not exist
Debugging will be degraded due to missing types. Rebuilding the project will regenerate the needed module files.warning: (arm64) /private/tmp/injectionNext_1.o 0x0000000000000e4e: unable to locate module needed for external types: /Users/username/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/TJZDPFCRP0EQ/FirebaseCrashlytics-2DPGF7JHVYMEA.pcm
error: '/Users/username/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/TJZDPFCRP0EQ/FirebaseCrashlytics-2DPGF7JHVYMEA.pcm' does not exist
Debugging will be degraded due to missing types. Rebuilding the project will regenerate the needed module files.warning: (arm64) /private/tmp/injectionNext_1.o 0x0000000000000e78: unable to locate module needed for external types: /Users/username/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/TJZDPFCRP0EQ/FirebasePerformance-2EUAMLT26RRBO.pcm
error: '/Users/username/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/TJZDPFCRP0EQ/FirebasePerformance-2EUAMLT26RRBO.pcm' does not exist
Debugging will be degraded due to missing types. Rebuilding the project will regenerate the needed module files.warning: (arm64) /private/tmp/injectionNext_1.o 0x0000000000000ea2: unable to locate module needed for external types: /Users/username/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/TJZDPFCRP0EQ/CoreImage-1TV35U2JJD421.pcm
error: '/Users/username/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/TJZDPFCRP0EQ/CoreImage-1TV35U2JJD421.pcm' does not exist
Debugging will be degraded due to missing types. Rebuilding the project will regenerate the needed module files.warning: (arm64) /private/tmp/injectionNext_1.o 0x0000000000000ecc: unable to locate module needed for external types: /Users/username/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/TJZDPFCRP0EQ/SwiftUI-1GV3AI137O72A.pcm
error: '/Users/username/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/TJZDPFCRP0EQ/SwiftUI-1GV3AI137O72A.pcm' does not exist
Debugging will be degraded due to missing types. Rebuilding the project will regenerate the needed module files.warning: (arm64) /private/tmp/injectionNext_1.o 0x0000000000000ef6: unable to locate module needed for external types: /Users/username/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/TJZDPFCRP0EQ/DeveloperToolsSupport-2B7MX0M29SLXV.pcm
error: '/Users/username/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/TJZDPFCRP0EQ/DeveloperToolsSupport-2B7MX0M29SLXV.pcm' does not exist
Debugging will be degraded due to missing types. Rebuilding the project will regenerate the needed module files.

It is not clear if there is really an issue with the debugger, or these messages can be ignored.

Tested on XCode Version 16.1 (16B40) Mac OS 15.1 (24B83) My Mac (Designed for iPad) run destination.

johnno1962 commented 2 days ago

Hi @oryonatan, I've not been able to replicate this and I've moved to Xcode 16.1 but I imagine this is related to a long known problem that LLDB is not really written with dynamic loading individual source files in mind as opposed to modules. For example, if you have a view controller, inject and break in it and try to p self or view instance variables of self. This has never worked when it tries to look up the type. I think this is just a new warning they've added that notices this problem. If it's not causing you problems try to ignore it as there is very little that can be done about it. I looked at the source a long time ago and raised an issue but it is very, very difficult working on LLDB. TBH it's a minor miracle breakpoints in injected code have always been so reliable apart from this!

(lldb) p self
(TestInjection.ViewController) 0x0000000133037c00 <No Swift runtime type info for $s13TestInjection14ViewControllerCD>
johnno1962 commented 10 hours ago

P.S. I've seen this message today looking at another issue. Perhaps it is more related to debugging code that wasn't built on your machine. Do you get this problem if you build your own InjectionNext.app binary? B.T.W. I have a branch cursor-mode open with changes to support "Cursor" better. Can you build off that please ensure I hadn't broken anything in the process?