Debugging iOS Apps

From RAD Studio
Jump to: navigation, search

Go Up to Debugging Multi-Device Applications

RAD Studio offers debugging in the IDE for iOS apps that are running on 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.

The following sections describe the availability of debugger features for the the iOS Device - 64 bit.

iOS Device: Debugging Apps Running on the iOS Device

Consider that the functionality for iOS Device's debuggers are different from the Windows ones.

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 sub minor 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

Please consider the following information while 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.
Note: Extra shared libraries are loaded in the iOS64 debugger, these shared libraries are controlled by the debugger and can be ignored. Some such libraries are:
  • __lldb_apple_objc_v2_get_dynamic_class_info
  • __lldb_caller_function
  • __lldb_apple_objc_v2_get_shared_cache_class_info
  • __lldb_caller_function
Note: In the iOS64 debugger, you may notice extra threads running. These extra threads are controlled by the debugger and can be ignored.

See Also