Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug symbols aren't linked properly #23

Open
finnvoor opened this issue Mar 25, 2024 · 4 comments
Open

Debug symbols aren't linked properly #23

finnvoor opened this issue Mar 25, 2024 · 4 comments
Labels
enhancement New feature or request pdc Related to the pdc plugin

Comments

@finnvoor
Copy link
Owner

finnvoor commented Mar 25, 2024

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

@finnvoor finnvoor added enhancement New feature or request pdc Related to the pdc plugin labels Mar 25, 2024
@rauhul
Copy link

rauhul commented Mar 26, 2024

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
Copy link
Owner Author

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
Copy link
Owner Author

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:

  • Build phase: would increase build times, or
  • Run phase pre-action: no error output

@finnvoor finnvoor changed the title Figure out how to get Xcode debugging working Debug symbols aren't linked properly Mar 28, 2024
@finnvoor
Copy link
Owner Author

finnvoor commented Jul 2, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pdc Related to the pdc plugin
Projects
None yet
Development

No branches or pull requests

2 participants