Debugging with Eclipse TCF

From dmon2
Jump to navigationJump to search

Eclipse TCF Introduction

TCF is a vendor-neutral, lightweight, extensible network protocol mainly for communicating with embedded systems (targets). TCF uses JSON (JavaScript Object Notation) as its preferred data marshalling language and supports auto-discovery of targets and services. TCF is intended to become a replacement for protocols like the GDB Serial, WDB, and GDB/MI protocols used for embedded software development. More information can be found at https://www.eclipse.org/tcf/

Eclipse TCF plug-in can be downloaded from https://www.eclipse.org/tcf/downloads.php. The user needs to select TCF plug-in compatible with installed version of Eclipse.

TCF is supported by DMON from 2.1.0.0 version.

Installing Eclipse TCF

To install TCF plug-in in older versions of Eclipse :

  • Eclipse Menu => Help => Install New Software...
  • From https://www.eclipse.org/tcf/downloads.php copy "p2 software repository", compatible with version of Eclipse installed on your system
  • Replace "type or select a site" with copied link and press "Add.."
Install New Software Dialog
  • Check "Target Commubication Framework" and click "Next>"
  • Follow instruction to set up plug-in.

To install TCF plug-in in Eclipse from 2018 :

  • Eclipse Menu => Help => Install New Software...
  • Select "type or select a site" with --All Available Sites-- from drop down menu
  • Set tcf on next line to filter out only tcf entries
Install New Software Dialog
  • Check "C/C++ Remote Launcher" and "TCF C/C++ Debugger" and click "Next>"
  • Follow instruction to set up plug-in.

Starting DMON

DMON acts as agent between Eclipse TCF plug-in and target. To activate TCF functionality DMON should be started with "-tcf" switch. TCF icon should appear at the bottom of DMON window.

DMON switches used
DMON Console

Now DMON is ready for connection. While Eclipse is connected to DMON, DMON commands can be used in parallel. For example, when breakpoint is hit, user can examine memory, registers or cache using DMON commands.

Creating TCF Debug Configurations

  • Open Debug Configurations in Eclipse
  • Select 'Target Communication Framework' and press 'New' button to create a configuration of the selected type
Eclipse Debug Configurations
  • Change Name of Configuration if have to. In the 'Available targets' DMON Agent should be listed. If not, make sure that DMON is started and '-tcf' switch was used
TCF Configurations
  • Select 'Application' tab in 'Debug Configurations' dialog. Set 'Project Name', 'Local File Path' and check or clear available check boxes like 'Stop at main' or 'Stop at program entry'
TCF Application Configurations
  • Press 'Debug' to start debugging process

Debugging the source code

Debugging source code using Eclipse TCF plug-in and DMON tutorial:

Debugging multi-core program

The sample code used in this tutorial can be copied from here FFTCPU0.c and fft.h

The script to set up all 4 CPUs can be found here mp_script.txt

Use sparc-elf-gcc-4.4.2 to build FFT project with linker flags: -Ttext=0x60000000 -lm

  • Build Project
  • Add script to initialize all 4 CPUs before start using DMON 'prerun mp_script.txt' command
  • Modify TCF Debug Configurations
  • Set Break points
  • Start application

Multiprocessors Debugging using Eclipse TCF plug-in and DMON tutorial: