2021. 12. 31. 14:17

LLDB

2021. 5. 14. 13:11

Remote Debugging

Remote Debugging

  • Remote Side(e.g. 192.168.129.2)
    • Install Command Line Tools for Xcode
    • Run debugserver(/Library/Developer/CommandLineTools/Library/PrivateFrameworks/LLDB.framework/Versions/A/Resources ver 12.5)
    • Usage:
      debugserver host:port [program-name program-arg1 program-arg2 ...]
      debugserver /path/file [program-name program-arg1 program-arg2 ...]
      debugserver host:port --attach=<pid>
      debugserver /path/file --attach=<pid>
      debugserver host:port --attach=<process_name>
      debugserver /path/file --attach=<process_name>
      host: Local Side
      e.g.:
      debugserver 192.168.129.1:1600 --attach=1234

      Attaching to process 2051...
      Listening to port 1600 for a connection from 192.168.129.1...


  • Local Side(e.g. 192.168.129.1)
    • Run lldb
    • Then enter this command: process connect connect://192.168.129.2:1600
  • Set the entitlement
    • The debugee should have 'com.apple.security.get-task-allow' entitlement in order to be attached by debuggers.
    • In debug mode it is set, but in release mode it is stripped.
    • Build Settings > Signing > Code Signing inject Base Entitlements > 'Yes'