Difference between revisions of "DESK-MX-L-AN-0006: Debugging with Eclipse"

From DAVE Developer's Wiki
Jump to: navigation, search
(9 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 +
{{InfoBoxTop}}
 +
{{AppliesToSBCLynx}}
 +
{{Applies To Diva}}
 +
{{InfoBoxBottom}}
 
==Introduction==
 
==Introduction==
Generally speaking, [[Managed_Virtual_Machine_(MVM)|Managed Virtual Machines]] including Yocto build system provide all the required stuff to remotely debug applications running on the target, via Eclipse/ADT. It is beyond the scope of this article to describe in detail how to use Eclipse{{efn|Please note that Eclipse is not just a debugger, it is a full-featured IDE that allows to manage and build complex projects with a powerful user-friendly graphical interface.}}. Instead some MVM-related information are provided, in order to properly configure it to work with DAVE Embedded Systems products. For more details about Eclipse, please refer to these links:
+
Generally speaking, [[Managed_Virtual_Machine_(MVM)|Managed Virtual Machines]] including Yocto build system provide all the required stuff to remotely debug applications running on the target, via Eclipse/ADT. It is beyond the scope of this article to describe in detail how to use Eclipse{{efn|Please note that Eclipse is not just a debugger, it is a full-featured IDE that allows to manage and build complex projects with a powerful user-friendly graphical interface.}}. Instead, some MVM-related information are provided, in order to properly configure the host to work with DAVE Embedded Systems products. Also, classical "Hello, world!" example is detailed.
 +
 
 +
For more details about Eclipse, please refer to these links:
 
*http://www.yoctoproject.org/docs/1.8/adt-manual/adt-manual.html
 
*http://www.yoctoproject.org/docs/1.8/adt-manual/adt-manual.html
 
*https://www.youtube.com/watch?v=O22IWe4kUE8.
 
*https://www.youtube.com/watch?v=O22IWe4kUE8.
  
 
==Eclipse integration in MVM==
 
==Eclipse integration in MVM==
By default, cross-tool chain is intalled in <code>TBD</code>.
+
No specific operations are required to run Eclipse, as shown in the following example.
  
target-specific source code paths:
+
By default, cross-tool chain is installed in <code>/home/dvdk/<targetname>/sdk/latest</code>. <code><targetname></code> is the name of the actual hardware platform (i.e. <code>lynx</code>, <code>axelulite</code> etc.).
  
 
=== Configuring the Cross-Toolchains ===
 
=== Configuring the Cross-Toolchains ===
Line 36: Line 42:
  
 
===Example===
 
===Example===
The following example shows how to build and debug classical "Hello, world!" example when working with [[SBC_Lynx_Embedded_Linux_Kit_(XUELK)|SBC Lynx Embedded Linux Kit (XUELK)]].
+
The following example shows how to build and debug classical "Hello, world!" example when working with [[AXEL ULite and SBC Lynx Embedded Linux Kit (XUELK)]]. As stated before, this example is valid for all of the Yocto-based MVMs.
  
  
This section first shows how to create an Eclipse-based project. The second part illustrates how to start a debugging session for a simple "Hello world" application.
+
This section first shows how to create an Eclipse-based project. The second part illustrates how to start a debugging session for a simple "Hello, world!" application.
  
 
For more details about Eclipse Kepler please refer to [[http://help.eclipse.org/kepler/index.jsp?topic=/]]
 
For more details about Eclipse Kepler please refer to [[http://help.eclipse.org/kepler/index.jsp?topic=/]]
Line 61: Line 67:
  
 
* Expand "Yocto Project ADT Project" and select "Hello World ANSI C Autotools Project". Add "Project name". Click "Next" and "Finish".
 
* Expand "Yocto Project ADT Project" and select "Hello World ANSI C Autotools Project". Add "Project name". Click "Next" and "Finish".
 +
  
 
[[File:Generic-vm-1280-eclipse6.png|800px]]
 
[[File:Generic-vm-1280-eclipse6.png|800px]]
Line 106: Line 113:
 
* Insert IP a ddress of the target board in the "Host name field". Click "Next" then "Finish".
 
* Insert IP a ddress of the target board in the "Host name field". Click "Next" then "Finish".
  
* Add binary tree under test in "C/C++ Application" field and remote tree in "Remote Absolute File Path for C/C++ Application" field.
+
* Insert the binary path for the remote device in "C/C++ Application" field and remote tree in "Remote Absolute File Path for C/C++ Application" field.
  
 
* Click "Select other" link near "Using Legacy Remote Create Process Launcher" and select "GDB (DSF) Automatic Remote Debugging Launcher".  
 
* Click "Select other" link near "Using Legacy Remote Create Process Launcher" and select "GDB (DSF) Automatic Remote Debugging Launcher".  
Line 131: Line 138:
  
 
* If the "open perspective" prompt appears, click "Yes" so that you in the Debug perspective.
 
* If the "open perspective" prompt appears, click "Yes" so that you in the Debug perspective.
 +
 +
 +
[[File:Generic-vm-1280-eclipse-debug8.png|800px]]
  
  
 
----
 
----
 
{{notelist}}
 
{{notelist}}

Revision as of 14:40, 30 April 2018

Info Box
SBC Lynx-top.png Applies to SBC Lynx
Diva-am335x-overview.png Applies to Diva

Introduction[edit | edit source]

Generally speaking, Managed Virtual Machines including Yocto build system provide all the required stuff to remotely debug applications running on the target, via Eclipse/ADT. It is beyond the scope of this article to describe in detail how to use Eclipse[a]. Instead, some MVM-related information are provided, in order to properly configure the host to work with DAVE Embedded Systems products. Also, classical "Hello, world!" example is detailed.

For more details about Eclipse, please refer to these links:

Eclipse integration in MVM[edit | edit source]

No specific operations are required to run Eclipse, as shown in the following example.

By default, cross-tool chain is installed in /home/dvdk/<targetname>/sdk/latest. <targetname> is the name of the actual hardware platform (i.e. lynx, axelulite etc.).

Configuring the Cross-Toolchains[edit | edit source]

  • Run Eclipse program:


Generic-vm-1280-eclipse1.png

Generic-vm-1280-eclipse2.png

Generic-vm-1280-eclipse3.png


To configure the Cross Compiler Options, you must select the type of toolchain, point to the toolchain, specify the sysroot location, and select the target architecture.

  • Select "Preferences" from the "Windows" menu.


Generic-vm-1280-eclipse-toolchain1.png


  • Select "Yocto Project ADT", add the cross-toolchain configuration and save the profile as your project name ("targetname" in this case). Click "Apply" and "OK".


Generic-vm-1280-eclipse-toolchain2.png


Example[edit | edit source]

The following example shows how to build and debug classical "Hello, world!" example when working with AXEL ULite and SBC Lynx Embedded Linux Kit (XUELK). As stated before, this example is valid for all of the Yocto-based MVMs.


This section first shows how to create an Eclipse-based project. The second part illustrates how to start a debugging session for a simple "Hello, world!" application.

For more details about Eclipse Kepler please refer to [[1]]

Creating the project[edit | edit source]

You can create two types of projects: Autotools-based or Makefile-based. This section describes the first method with Eclipse IDE. To create a project based on Yocto template, follow these steps:


  • Select "Project" from the "File -> New" menu.


Generic-vm-1280-eclipse4.png


  • Expand "C/C++" and select "C Project". Click "Next"


Generic-vm-1280-eclipse5.png


  • Expand "Yocto Project ADT Project" and select "Hello World ANSI C Autotools Project". Add "Project name". Click "Next" and "Finish".


Generic-vm-1280-eclipse6.png


  • If the "open perspective" prompt appears, click "Yes" so that you in the C/C++ perspective.
  • Click on "C/C++" button on up left bar to view source files.


Generic-vm-1280-eclipse7.png

Generic-vm-1280-eclipse8.png


  • To build the project select "Build Project" from the "Project" menu.


Generic-vm-1280-eclipse9.png

Generic-vm-1280-eclipse10.png


Debugging the project[edit | edit source]

This section lists the steps required to start a debugging session for the applications. Before debugging remember to compile and install yours updated binaries/libraries.

  • Select "Debug Configurations" from the "Run" menu.


Generic-vm-1280-eclipse-debug1.png


  • Expand "C/C++ Remote Application" and select "helloworld_gdb_arm-poky-linux-gnueabii".


Generic-vm-1280-eclipse-debug2.png


  • Click "New" in "Connection" and select "SSH Only". Click "Next".


Generic-vm-1280-eclipse-debug3.png


  • Insert IP a ddress of the target board in the "Host name field". Click "Next" then "Finish".
  • Insert the binary path for the remote device in "C/C++ Application" field and remote tree in "Remote Absolute File Path for C/C++ Application" field.
  • Click "Select other" link near "Using Legacy Remote Create Process Launcher" and select "GDB (DSF) Automatic Remote Debugging Launcher".


Generic-vm-1280-eclipse-debug4.png

Generic-vm-1280-eclipse-debug5.png


  • Select "Debugger" tab and change debugger settings. Click "Debug".


Generic-vm-1280-eclipse-debug6.png


  • Add root name and password in "Enter Password" dialog box.


Generic-vm-1280-eclipse-debug7.png


  • If the "Warning" prompt appears, click "Yes" so that you can confirm ssh authenticity.
  • If the "open perspective" prompt appears, click "Yes" so that you in the Debug perspective.


Generic-vm-1280-eclipse-debug8.png



  1. Please note that Eclipse is not just a debugger, it is a full-featured IDE that allows to manage and build complex projects with a powerful user-friendly graphical interface.