目录

Starting the Debugging Process

Native code debugging depends on the LLDB. For details, see LLDB Debugger.

Before starting debugging, choose Run > Edit Configurations to open the Debug Configurations page. On the Debugger tab, set Debug type to Dual (ArkTS/JS + Native), Native, or Detect Automatically. Set the code type for debugging to C/C++.

  • If Debug type is Detect Automatically, the debugger determines the debugging type based on the code type detected.
  • During debugging, enabling compiler optimization – by adding optimization options – or using the release build mode – can lead to more efficient code execution, as the compiler modifies the assembly instructions. However, this optimization can complicate the mapping back to the original source code, potentially causing debugging issues such as unexpected deletion of local variable information or incorrect line breakpoints. To prevent such optimization-related exceptions during debugging, you are advised to disable optimization or use the debug build mode.

On the Debugger tab, you can customize the following configurations:

After the configuration is complete, you can start native code debugging in debug or attach mode. For details, see Starting Debugging in Debug Mode or Starting Debugging in Attach Mode.