Debugging iOS Apps
Go Up to Debugging Multi-Device Applications
Contents
RAD Studio offers debugging in the IDE for iOS apps that are running on either the iOS Simulator (only available in Delphi) or the iOS Device. For iOS apps, the debugging experience in the IDE is much like debugging Windows or macOS applications in RAD Studio. However, the debugger functionality that is available to you varies according to the target platform and operating system. That is, the debugger for the iOS Simulator target platform (macOS operating system) has more available features in the IDE than the debugger for the iOS Device - 32 bit and iOS Device - 64 bit target platforms (iOS operating system).
The following sections describe the availability of debugger features for the iOS Simulator, iOS Device - 32 bit, and the iOS Device - 64 bit.
iOS Simulator: Debugging Apps Running on the iOS Simulator
In general, this debugger gives you more complete functionality than the debugger for the iOS Device.
Evaluation and modification of properties are fully supported in iOS Simulator.
iOS Device: Debugging Apps Running on the iOS Device
Functionality for the debuggers for the 32-bit iOS Device and 64-bit iOS Device are different from the Windows ones.
- Inspection of methods is not supported.
In the Modules Window
- Function entry is not supported.
- The Entry point and Address columns are not populated (The Entry Point context menu is empty)
In the Debug Inspector
- Only the Data column is populated.
- Methods and Properties are not shown.
Resolving bfd_mach_o_scan_read Errors
After updating to a new SDK or OS version, you might see warnings such as the following:
bfd_mach_o_scan_read_symtab_symbol: symbol "_strcmp" is unsupported 'indirect' reference: setting to undefined bfd_mach_o_scan_read_symtab_symbol: symbol "_bzero" is unsupported 'indirect' reference: setting to undefined bfd_mach_o_scan_read_symtab_symbol: symbol "_strchr" is unsupported 'indirect' reference: setting to undefined bfd_mach_o_scan_read_symtab_symbol: symbol "_memset_pattern16" is unsupported 'indirect' reference: setting to undefined bfd_mach_o_scan_read_symtab_symbol: symbol "_memcpy" is unsupported 'indirect' reference: setting to undefined bfd_mach_o_scan_read_symtab_symbol: symbol "_memcmp" is unsupported 'indirect' reference: setting to undefined bfd_mach_o_scan_read_symtab_symbol: symbol "_memchr" is unsupported 'indirect' reference: setting to undefined bfd_mach_o_scan_read_symtab_symbol: symbol "_memccpy" is unsupported 'indirect' reference: setting to undefined bfd_mach_o_scan_read_symtab_symbol: symbol "_memset_pattern8" is unsupported 'indirect' reference: setting to undefined
These warnings occur because the debugger uses SDK libraries instead of actual device libraries. To resync the files, run your iOS project from Xcode iOS projects templates (Empty iOS app, for example). The warnings should go away. If not, the warnings will go away after the device is upgraded to the next subminor iOS version. These warnings do not impact the debugging experience.
When Run Without Debugging, an iOS App Might Not Stop
Running an app on the iOS device without debugging might leave the app running, because the iOS installer is still attached to the program. Your iOS app might not stop when you close it, because the debugger is not running and therefore cannot stop the app.
- In this case, you should close the connected PAServer instance on the Mac. (Enter the
q
command at the PAServer command prompt,>
).
Debugging Apps Running on the 64-bit iOS Device
Some features that are available while you debug your applications for iOS Device - 32 bit may differ for debugging iOS Device - 64 bit applications:
- The debugger does not support the evaluation of many Delphi types, such as dynamic arrays or objects with virtual methods that inherit from TObject.
- Tooltips are disabled.
- Delphi syntax is not fully supported to evaluate Delphi expressions; use C++ syntax as a workaround.
- Delphi identifiers are case-sensitive; you need to use the same case as in source when evaluating.
- Protection against evaluations that can raise exceptions is not supported; be careful not to evaluate functions that can access uninitialized data or raise exceptions.
If you need to debug using the options listed above, we recommend you to set iOS Device 32-bit as the target platform, if possible, to complete your debugging.
- __lldb_apple_objc_v2_get_dynamic_class_info
- __lldb_caller_function
- __lldb_apple_objc_v2_get_shared_cache_class_info
- __lldb_caller_function