finnvoor / PlaydateKit

Create games for Playdate using Swift.
https://finnvoor.github.io/PlaydateKit/documentation/playdatekit
Creative Commons Zero v1.0 Universal
198 stars 21 forks source link

Debug symbols aren't linked properly #23

Open finnvoor opened 8 months ago

finnvoor commented 8 months ago

Missing Swift module or Clang module found for "playdatekit_simulator", "imported" via SwiftDWARFImporterDelegate. Hint: Register Swift modules with the linker using -add_ast_path.

rauhul commented 8 months ago

This should be as simple as building with debug info -g on your swiftc command and attaching to the process by name e.g. Playdate Simulator

finnvoor commented 8 months ago

This should be as simple as building with debug info -g on your swiftc command and attaching to the process by name e.g. Playdate Simulator

That's what I thought, but my breakpoints don't seem to be working in Xcode (they do in the Playdate examples Xcode projects)

finnvoor commented 8 months ago

Ah actually you're right, I was only adding -g to clang not swiftc. Now it works great 👌

Would be nice to set the simulator as the scheme executable to auto-attach, but then the build needs to either happen in:

finnvoor commented 4 months ago

Made some progress adding -g to clang + swiftc and removing -O, but now running into:

warning: pdex.dylib was compiled with a different Swift compiler (version '0') than the Swift compiler integrated into LLDB (version '6.0.0.4'). Swift expression evaluation requires a matching compiler and debugger from the same toolchain.

(lldb) p System.elapsedTime
error: type for self is invalid
error: Couldn't realize Swift AST type of self. Hint: using `v` to directly inspect variables and fields may still work.`
(lldb) v System.elapsedTime
warning: Cannot load Swift type information for /Users/finnvoorhees/Developer/Playdate/PlaydateKitTemplate/.build/plugins/PDCPlugin/outputs/PlaydateKitTemplate.pdx/pdex.dyliberror: module 'Swift' cannot be imported in embedded Swift modeerror: no variable or instance variable named 'System' found in this frame