Attaching the Debugger to a Running Application

Frozen Content

Debugging an embedded application currently requires pausing the processor as you enter a dedicated debug session. The application stops running and you are effectively having to 'start from the beginning' of the code again. Wouldn't it be cool to enter a debug session, but leave the application running? To be able to effectively enter the debugging state at the current point of code execution – within the processor in the target FPGA design? Altium Designer allows you to do just that, by giving you the ability to 'attach' a debugger to the running application.

Debugger attachment is possible once your FPGA design is processed and downloaded to the target FPGA device, and your embedded code is downloaded and running on the target processor therein. Simply right-click on the icon for the processor in the Devices view (View»Devices View) and choose the Attach command. The embedded source code document containing the code which is currently being executed will be opened as the active document, with the specific line being executed at time of attachment highlighted – the execution point. Take a look back at the Devices view and you'll see that the processor is not in the paused state – it's still running and happily executing your embedded code!

Attach a debugger to a running application to see what is currently being executed - peaking 'under the bonnet' without interrupting the processor in any way\!

You can even take this a step further, by defining breakpoints in the source code prior to attaching the debugger. The code will execute in the processor until a breakpoint is reached, at which time the processor will pause and the line of code with the breakpoint will be made active in the main design window.

Set a breakpoint in the source - with an attached debugger, the running processor will pause upon reaching the breakpoint.

Right-click on the processor and set it running again – until it encounters the next breakpoint you have defined. No longer are you constrained to debugging solely within an 'offline' debug session, detached from the deployed environment. Now, you can effectively synchronize the deployed embedded application running in the target device with the source code opened in Altium Designer – synchronized on breakpoint, courtesy of a debugger that is very much attached!

You are reporting an issue with the following selected text and/or image within the active document: