4.4 Attaching to a Target

Use the Attach to Target option in the Debug menu or the attach
icon in the debug toolbar to attach a target causing Microchip Studio to launch a debug session on the selected target without uploading a new application or causing a reset. Once the debug session is established, the core of the target halts, and the current execution position of the target is mapped to the code in the project, meaning that the state of the target is kept and is possible to inspect with standard debugging techniques. The program halts in the current position. Complete run control and symbolic debugging should be available after a successful attach.
Note:
  • The code in the project, mapped to the content of the running target, can't verify the correctness of this mapping. This means that if the project contains code not on the target, then the state and run control might not reflect the truth, as variables and functions might have different code locations on the target than in the project.
  • The ability to activate a debug session without resetting a target is architecture-dependent. Not all architectures support this feature.
Attention: Physically connecting a debug probe to a target might cause the target to reset, as most debug probes need an electrical connection to the reset line of the device. Take ordinary electrical precautions to avoid this.