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

From DAVE Developer's Wiki
Jump to: navigation, search
(Introduction)
(Introduction)
 
(23 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 +
{{InfoBoxTop}}
 +
{{AppliesToAXEL Lite AN}}
 +
{{AppliesToAXEL ULite AN}}
 +
{{InfoBoxBottom}}
 +
 +
==History==
 +
 +
{| class="wikitable" border="1"
 +
!Page version
 +
!Date
 +
!BSP version
 +
!Notes
 +
|-
 +
|{{oldid|7818|1.0.0}}
 +
|April 2018
 +
|[[AXEL_ULite_and_SBC_Lynx_Embedded_Linux_Kit_(XUELK)#XUELK_software_components | XUELK 2.0.1]]
 +
|XUELK setup
 +
|-
 +
|2.0.0
 +
|August 2022
 +
|{{pageoldid|DESK-MX6-L|15794|DESK-MX6-L 1.0.0}}
 +
|DESK-MX6-L version
 +
|}
 +
 
==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. Also, classical "Hello, world!" example is detailed.
+
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 Luna please refer to [https://projects.eclipse.org/releases/luna this page]
  
For more details about Eclipse, please refer to these links:
+
{{WarningMessage|text=Eclipse support has been [https://docs.yoctoproject.org/migration-guides/migration-2.7.html?highlight=eclipse removed from Yocto since Warrior release]. Releases greater than {{pageoldid|DESK-MX6-L|15794|DESK-MX6-L 1.0.0 MVM}} have not been validated nor supported.}}
*http://www.yoctoproject.org/docs/1.8/adt-manual/adt-manual.html
+
 
*https://www.youtube.com/watch?v=O22IWe4kUE8.
+
{{ImportantMessage|text=The following instructions and screenshots have been taken from DESK-MX6-L MVM. Selecting the proper cross-tool chain, the same instructions are valid also for {{pageoldid|DESK-MX6UL-L|14293|DESK-MX6UL-L 1.0.1 MVM}} }}
  
 
==Eclipse integration in MVM==
 
==Eclipse integration in MVM==
By default, cross-tool chain is intalled in /home/dvdk/targetname/sdk/latest.
+
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 development environment (i.e. <code>desk-mx-l</code>, etc.).
  
 
=== Configuring the Cross-Toolchains ===
 
=== Configuring the Cross-Toolchains ===
Line 16: Line 42:
  
  
[[File:Generic-vm-1280-eclipse1.png|800px]]
+
[[File:DESK-MX6-L_MVM-Eclipse.png|1280px]]
  
[[File:Generic-vm-1280-eclipse2.png|800px]]
+
[[File:DESK-MX6-L_MVM-Eclipse-launcher.png|1280px]]
  
[[File:Generic-vm-1280-eclipse3.png|800px]]
+
[[File:DESK-MX6-L_MVM-Eclipse-IDE.png|1280px]]
  
  
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.
+
To configure the Cross Compiler Options, you must select the type of toolchain, point to the toolchain, specify the <code>sysroot</code> location, and select the target architecture.
  
 
* Select "Preferences" from the "Windows" menu.
 
* Select "Preferences" from the "Windows" menu.
  
  
[[File:Generic-vm-1280-eclipse-toolchain1.png|800px]]
+
[[File:DESK-MX6-L_MVM-Eclipse-Preferences.png|1280px]]
  
  
* 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".
+
* Select "Yocto Project ADT", add the cross-toolchain configuration and save the profile as your project name (<code>desk-mx</code> in this case). Click "Apply" and "OK".
  
  
[[File:Generic-vm-1280-eclipse-toolchain2.png|800px]]
+
[[File:DESK-MX6-L_MVM-Eclipse-Yocto-ADT.png|1280px]]
  
  
 
===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_Lite_SOM/AXEL_Lite_Evaluation_Kit | AXEL Lite Evaluation Kit]]. 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 [[http://help.eclipse.org/kepler/index.jsp?topic=/]]
+
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.
  
 
==== Creating the project ====
 
==== Creating the project ====
Line 53: Line 76:
  
  
[[File:Generic-vm-1280-eclipse4.png|800px]]
+
[[File:DESK-MX6-L_MVM-Eclipse-C-project.png|1280px]]
 
 
 
 
* Expand "C/C++" and select "C Project". Click "Next"
 
 
 
  
[[File:Generic-vm-1280-eclipse5.png|800px]]
 
  
 +
* Expand "Yocto Project ADT Autotools 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:DESK-MX6-L_MVM-Eclipse-C-Yocto-autotools.png|1280px]]
  
[[File:Generic-vm-1280-eclipse6.png|800px]]
 
  
 
+
* If the "open perspective" prompt appears, click "Yes" so that you are in the C/C++ perspective.
* 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.
 
* Click on "C/C++" button on up left bar to view source files.
  
  
[[File:Generic-vm-1280-eclipse7.png|800px]]
+
[[File:DESK-MX6-L_MVM-Eclipse-C-C++-IDE.png|1280px]]
  
[[File:Generic-vm-1280-eclipse8.png|800px]]
+
[[File:DESK-MX6-L_MVM-Eclipse-helloworld-sources.png|1280px]]
  
  
Line 80: Line 97:
  
  
[[File:Generic-vm-1280-eclipse9.png|800px]]
+
[[File:DESK-MX6-L_MVM-Eclipse-C-project-build.png|1280px]]
  
[[File:Generic-vm-1280-eclipse10.png|800px]]
+
[[File:DESK-MX6-L_MVM-Eclipse-C-project-build-console.png|1280px]]
  
  
 
==== Debugging the project ====
 
==== Debugging the project ====
  
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.
+
This section lists the steps required to start a debugging session for the applications. Before debugging remember to compile and install your updated binaries/libraries.
  
 
* Select "Debug Configurations" from the "Run" menu.  
 
* Select "Debug Configurations" from the "Run" menu.  
  
  
[[File:Generic-vm-1280-eclipse-debug1.png|800px]]
+
[[File:DESK-MX6-L_MVM-Eclipse-C-project-debug-configurations.png|1280px]]
  
  
Line 98: Line 115:
  
  
[[File:Generic-vm-1280-eclipse-debug2.png|800px]]
+
[[File:DESK-MX6-L_MVM-Eclipse-C-project-debug-remote.png|1280px]]
  
  
Line 104: Line 121:
  
  
[[File:Generic-vm-1280-eclipse-debug3.png|800px]]
+
[[File:DESK-MX6-L_MVM-Eclipse-C-project-debug-remote-ssh.png|1280px]]
  
  
 
* 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".  
  
  
[[File:Generic-vm-1280-eclipse-debug4.png|800px]]
+
[[File:DESK-MX6-L_MVM-Eclipse-C-project-debug-remote-gdb.png|1280px]]
  
[[File:Generic-vm-1280-eclipse-debug5.png|800px]]
+
[[File:DESK-MX6-L_MVM-Eclipse-C-project-debug-remote-gdb-2.png|1280px]]
  
  
Line 122: Line 139:
  
  
[[File:Generic-vm-1280-eclipse-debug6.png|800px]]
+
[[File:DESK-MX6-L_MVM-Eclipse-C-project-debug-remote-gdb-debugger.png|1280px]]
  
  
Line 128: Line 145:
  
  
[[File:Generic-vm-1280-eclipse-debug7.png|800px]]
+
[[File:DESK-MX6-L_MVM-Eclipse-C-project-debug-remote-gdb-debug.png|1280px]]
  
  
 
* If the "Warning" prompt appears, click "Yes" so that you can confirm ssh authenticity.
 
* If the "Warning" prompt appears, click "Yes" so that you can confirm ssh authenticity.
 +
 +
[[File:DESK-MX6-L_MVM-Eclipse-C-project-debug-remote-gdb-ssh.png|1280px]]
  
 
* 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]]
+
[[File:DESK-MX6-L_MVM-Eclipse-C-project-debug-remote-gdb-session.png|1280px]]
  
  
 
----
 
----
 
{{notelist}}
 
{{notelist}}

Latest revision as of 10:29, 6 September 2022

Info Box

History[edit | edit source]

Page version Date BSP version Notes

1.0.0

April 2018 XUELK 2.0.1 XUELK setup
2.0.0 August 2022 DESK-MX6-L 1.0.0 DESK-MX6-L version

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 Luna please refer to this page


Warning-icon.png Eclipse support has been removed from Yocto since Warrior release. Releases greater than DESK-MX6-L 1.0.0 MVM have not been validated nor supported. Warning-icon.png


200px-Emblem-important.svg.png

The following instructions and screenshots have been taken from DESK-MX6-L MVM. Selecting the proper cross-tool chain, the same instructions are valid also for DESK-MX6UL-L 1.0.1 MVM

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 development environment (i.e. desk-mx-l, etc.).

Configuring the Cross-Toolchains[edit | edit source]

  • Run Eclipse program:


DESK-MX6-L MVM-Eclipse.png

DESK-MX6-L MVM-Eclipse-launcher.png

DESK-MX6-L MVM-Eclipse-IDE.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.


DESK-MX6-L MVM-Eclipse-Preferences.png


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


DESK-MX6-L MVM-Eclipse-Yocto-ADT.png


Example[edit | edit source]

The following example shows how to build and debug classical "Hello, world!" example when working with AXEL Lite Evaluation Kit. 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.

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.


DESK-MX6-L MVM-Eclipse-C-project.png


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


DESK-MX6-L MVM-Eclipse-C-Yocto-autotools.png


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


DESK-MX6-L MVM-Eclipse-C-C++-IDE.png

DESK-MX6-L MVM-Eclipse-helloworld-sources.png


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


DESK-MX6-L MVM-Eclipse-C-project-build.png

DESK-MX6-L MVM-Eclipse-C-project-build-console.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 your updated binaries/libraries.

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


DESK-MX6-L MVM-Eclipse-C-project-debug-configurations.png


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


DESK-MX6-L MVM-Eclipse-C-project-debug-remote.png


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


DESK-MX6-L MVM-Eclipse-C-project-debug-remote-ssh.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".


DESK-MX6-L MVM-Eclipse-C-project-debug-remote-gdb.png

DESK-MX6-L MVM-Eclipse-C-project-debug-remote-gdb-2.png


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


DESK-MX6-L MVM-Eclipse-C-project-debug-remote-gdb-debugger.png


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


DESK-MX6-L MVM-Eclipse-C-project-debug-remote-gdb-debug.png


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

DESK-MX6-L MVM-Eclipse-C-project-debug-remote-gdb-ssh.png

  • If the "open perspective" prompt appears, click "Yes" so that you in the Debug perspective.


DESK-MX6-L MVM-Eclipse-C-project-debug-remote-gdb-session.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.