Skip to content

Instantly share code, notes, and snippets.

@roop
roop / notes_on_debugging_the_swift_compiler.md
Last active January 21, 2020 06:55
Notes on debugging on the Swift compiler

Invoking lldb

  • swiftc invokes sub-commands, so you shouldn't run lldb on the swiftc command itself. You can add the -### option to swiftc to see the underlying sub-commands. Pick the correct sub-command, then run lldb -- <command>.

  • Usually, we want the first command, so run something like:

    lldb -- `swiftc file.swift | head -n 1`
    
  • Use --one-line r to run immediately after loading, without having to set breakopints - great for debugging crashes

I was looking at the console log (console_log_ISSUE-START_2025-04-14_14-04-45.txt), looking for causes why the data packet failed to send.

  • 14:01:19.390800 Laptop wakes up

    2025-04-14 14:01:19.390800+0200  localhost nesessionmanager[138]: [com.apple.networkextension:] NESMVPNSession[Primary Tunnel:eduVPN:9F329B94-B308-47A1-9446-E4E2E3B3E53E:(null)] in state NESMVPNSessionStateRunning: received wake event
    
  • 14:01:19.390927 Tunnel extension gets wake 'signal'