Debugging Multi-Device Applications
Go Up to Multi-Device Applications
Contents
- 1 Architecture of Multi-Device Application Debugging
- 2 The RAD Studio Integrated Debugger
- 3 Requirements for Multi-Device Debugging in RAD Studio
- 4 Debugging with C++Builder 64-bit Windows
- 5 Starting the Debugger with a 'Run' Command
- 6 Starting the Debugger with 'Attach to Process' and 'Load Process Remote'
- 7 See Also
Architecture of Multi-Device Application Debugging
Debugging macOS Applications
To debug macOS Applications, complete the following steps:
In Project Manager:
- Add or Activate Target Platform (macOS 64-bit and macOS ARM 64-bit)
- Assign Connection Profile following this path: Tools > Options > Deployment > Connection Profile Manager, and specify the following:
- Platform
- Hostname
- Port number
- Password (optional)
- Go to Tools > Options > Deployment > SDK Manager, and add the SDK version.
In the Platform Assistant Server (PAServer):
- Make sure that PAServer launches the remote debugger for macOS.
Debugging iOS Apps
To debug iOS Applications, complete the following steps:
In Project Manager:
- Add or Activate Target Platform (iOS Device 64-bit)
- Assign Connection Profile following this path: Tools > Options > Deployment > Connection Profile Manager, and specify the following:
- Platform
- Host name
- Port number
- Password (optional)
- Go to Tools > Options > Deployment > SDK Manager, and add the SDK version.
In the Platform Assistant Server (PAServer)
- Make sure that PAServer launches the remote debugger for iOS.
- Check iOS apps are provisioned and code signed during development.
On iOS Device:
- Connect the device to the Mac.
Debugging Android Applications
Before debugging Android Applications in RAD Studio consider preparing your Android Development environment.
Debugging Linux Applications
To debug Linux Applications, complete the following steps:
In Project Manager:
- Add or Activate Target Platform (Linux 64-bit)
- Assign Connection Profile following this path: Tools > Options > Deployment > Connection Profile Manager, and specify the following:
- Platform
- Host name
- Port number
- Password (optional)
- Go to Tools > Options > Deployment > SDK Manager, and add the SDK version.
In the Platform Assistant Server (PAServer)
- Make sure that PAServer launches the remote debugger for Linux.
The RAD Studio Integrated Debugger
The integrated RAD Studio debugger enables you to debug an application that targets any of the Supported Target Platforms.
RAD Studio supports the following debuggers, all of which run on the specific target platform:
- Embarcadero Windows 32-bit Debugger - for Windows 32-bit applications.
- Embarcadero Windows 64-bit Debugger for Delphi - for Windows 64-bit Delphi applications.
- Embarcadero Windows 64-bit LLDB Debugger for C++ - for Windows 64-bit C++ applications.
- Embarcadero Linux 64-bit Debugger - for Linux 64-bit applications.
- Embarcadero iOS Device 64-bit Debugger - for iOS 64-bit applications compiled for iOS devices.
- Embarcadero Android 32-bit Debugger - for Android 32-bit applications compiled for Android 32-bit target platforms.
- Embarcadero Android 64-bit Debugger - for Android 64-bit applications compiled for Android 64-bit target platforms.
- Embarcadero macOS 64-bit Debugger - for macOS 64-bit applications.
- Embarcadero macOS ARM 64-bit Debugger - for macOS and iOS Simulator ARM 64-bit applications.
The appropriate Embarcadero debuggers are installed when you prepare your development environment as described in the help. For example, when you follow the steps for macOS Application Development, Platform Assistant and the RAD Studio macOS debugger are installed on your Mac.
- __lldb_apple_objc_v2_get_dynamic_class_info
- __lldb_caller_function
- __lldb_apple_objc_v2_get_shared_cache_class_info
- __lldb_caller_function
Requirements for Multi-Device Debugging in RAD Studio
- For an application running on either a macOS 64-bit, iOS Device - 64 bit target platform, the Platform Assistant and a connection profile are required for establishing a debug session.
- The Android target platform and in-system Win64 target platform do not require either the Platform Assistant or a connection profile.
- Some target platforms require that you add an SDK in the IDE, as described in the next section Requirements for Multi-Device Debugging.
Typically, both the debugger and the process being debugged run on the target platform. This is true of the iOS Device and the Android Device. But in every case, the debugger reports status and interacts with you on the development PC in the RAD Studio IDE. This means that using one of the multi-device debuggers is very similar to using the integrated debugger for Win32 applications. For common high-level information about debugging, see Overview of Debugging.
To do multi-device debugging:
- Your application must have an activated target platform:
- 64-bit Windows (from a 32-bit Windows development PC)
- macOS
- iOS
- Android (Android device)
- Remote 32-bit or 64-bit Windows.
- Depending on the target platform:
- For the macOS and iOS platforms:
- The Platform Assistant must be running on the Mac.
- Your application must be provisioned, code signed, and have an associated connection profile.
- Note: You do not have to provision and code sign macOS applications.
- Your development system must have a live connection to the Mac (that is, Test Connection must succeed on the Connection Profile Manager window).
- This connection enables you to use both the integrated debugger and the Deployment Manager.
- In addition, for the iOS Device platform, a provisioned iOS device must be connected by USB cable to the Mac.
- Note: You cannot use the integrated debugger to debug an iOS app compiled with the Application Store platform configuration.
- For the 32-bit Windows platform:
- You do not need to use the Platform Assistant because your debug environment is in-machine, and the integrated debugger runs automatically. However, if you wish to remote debug a 32-bit Windows application, you need to set the Include remote debug symbols option in Project > Options > Delphi Compiler > Linking to
True
.
- You do not need to use the Platform Assistant because your debug environment is in-machine, and the integrated debugger runs automatically. However, if you wish to remote debug a 32-bit Windows application, you need to set the Include remote debug symbols option in Project > Options > Delphi Compiler > Linking to
- For the 64-bit Windows platform:
- If you are connecting to a remote 64-bit PC:
- You must use the Platform Assistant and a connection profile.
- Your development system must have a live connection to the remote 64-bit PC (that is, Test Connection must succeed on the Connection Profile Manager window). This connection enables you to use both the integrated debugger and the Deployment Manager.
- If your development system is a PC running a 64-bit Windows operating system:
- You do not need to use the Platform Assistant because your debug environment is in-machine, and the integrated debugger runs automatically.
- You can, however, optionally choose to use the Platform Assistant and a connection profile just as you can for a remote 64-bit Windows target system. Doing this enables you to use the Deployment Manager.
- If you are connecting to a remote 64-bit PC:
- An SDK is required (on the SDK Manager) for the following platforms and application types:
- FireMonkey Delphi multi-device applications for the iOS Device - 64 bit platform
- FireMonkey Delphi multi-device applications for the Android platform
- For the macOS and iOS platforms:
Debugging with C++Builder 64-bit Windows
For C++ 64-bit Windows debugging, a few debugger features are not available.
For more information, see Debugging C++Builder 64-Bit Windows Applications.
Starting the Debugger with a 'Run' Command
When all the Requirements for Multi-Device Debugging are met, entering the Run command does the following:
- Copies the necessary files between the host PC and the target machine specified in the connection profile.
- Runs the application in the appropriate debugger as required for the platform.
For example, if macOS is the active target platform, the executable is copied to the Mac.
You can use any of the standard Run commands to start debugging a multi-device application (for either macOS or Win64):
- Run > Run (F9) (compiles and runs the application in the integrated debugger)
- Run > Step Over (F8)
- Run > Trace Into (F7)
- Run > Run Until Return (Shift+F8)
- Run > Run To Cursor (F4)
- Note: Run to Cursor is not supported for launching the debugger on the Android platform.
Starting the Debugger with 'Attach to Process' and 'Load Process Remote'
To run and debug a compiled binary on a machine running the Platform Assistant server (either a remote PC or a Mac), you can use:
- Attach to Process to debug a running process that is either local or remote. Using the Platform Assistant and a connection profile is recommended here. Some platforms are not supported, as indicated in the Attach to Process dialog box.
- Note: Attachment to a running process is not supported for the Embarcadero Linux 64-bit Debugger, Embarcadero iOS Device 64-bit Debugger, Embarcadero Android 32-bit Debugger, Embarcadero Android 64-bit Debugger, Embarcadero macOS 64-bit Debugger, and Embarcadero macOS ARM 64-bit Debugger.
- Load Process Local to load a local debuggee process.
- Note: Load Process Local is not supported for the Embarcadero Linux 64-bit Debugger, Embarcadero iOS Device 64-bit Debugger, Embarcadero macOS 64-bit Debugger, and Embarcadero macOS ARM 64-bit Debugger.
- Load Process Remote to load a debuggee process and run it on a remote machine, with some restrictions regarding connection profiles. Some platforms are not supported, as indicated in the Load Process Remote dialog box.
- Note: Load Process Remote is not supported in Embarcadero Android 32-bit Debugger and Embarcadero Android 64-bit Debugger.
- Using the Platform Assistant and a connection profile is recommended here.
Timing Issues with Load Process
If you have problems debugging a macOS app that crashes immediately after you run it using Load Process, you should select either the Do not run option or the Run to entry point option (choices under "After load"). Either option can solve the timing issues concerning when the app runs and hits debug events, versus when the debugger is set up and ready to handle the events. These timing issues can cause the debugger to hang.
See Also
- Overview of Debugging
- LLDB Debuggers
- How to Use the Debugger
- Remote Debugging - Old-Style Procedures
- Creating and Testing a Connection Profile on the Development PC
- PAServer, the Platform Assistant Server Application
- Debugging C++Builder 64-Bit Windows Applications
- Debugging iOS Apps
- Running and Debugging Your Android Application On a Remote Android Device
- Acquiring Permission to Support Debugging on a Mac
- Debugging optimized Win64 code