Difference between revisions of "Executing Remote Applications with Eclipse"

From wiki.emacinc.com
Jump to: navigation, search
m
 
(15 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{todo|Polish this and mark it as OE 4|Michael Gloff|project=oe 4,mg}}
+
{{todo|SEOKWREV; (10.29.13-20:00->MD+)(11.06.13-12:55->JG+)(03.04.14-17:00->BS-)(03.26.14-16:35->BS+)|Klint Youngmeyer|project=oe 4,ky,SEOKWREV, md,bs}}
  
{| class="wikitable conventions"
+
{{#seo:
 +
|title=Executing Remote Applications with Eclipse
 +
|titlemode=append
 +
|keywords=Executing Remote Applications,Eclipse,Run Configuration
 +
|description=Executing remote applications with Eclipse.
 +
}}
 +
Remote development using Eclipse is enhanced with tools such as the Eclipse Run/Debug Configurations and SSH which enable the remote execution of the application on the remote board. The Eclipse Run/Debug Configurations provide a way to transparently run an application on the remote board by automatically uploading the binary, changing execute permissions, executing, and interacting with the application using an SSH Shell.
 +
<br clear=all>
 +
 
 +
{| class="wikitable"
 
!colspan="2"|Table 1: Conventions
 
!colspan="2"|Table 1: Conventions
 
|-
 
|-
Line 11: Line 20:
 
|}
 
|}
  
 
Remote development using Eclipse is enhanced with tools such as the Eclipse Run/Debug Configurations and SSH which enable the remote execution of the application on the remote board. The Eclipse Run/Debug Configurations provide a way to transparently run an application on the remote board by automatically uploading the binary, changing execute permissions, executing, and interacting with the application using an SSH Shell.
 
 
<br clear=all>
 
<br clear=all>
  
Line 18: Line 25:
  
 
Before continuing, ensure that Eclipse is open to the C/C++ or Qt C++ perspective.
 
Before continuing, ensure that Eclipse is open to the C/C++ or Qt C++ perspective.
# Open EMAC Eclipse
+
# Open Eclipse
# Click ''Window -> Open Perspective -> Other...''
+
# Click ''Window Open Perspective Other...''
 
# Select ''C/C++'' or ''Qt C++'' (if developing a Qt application)
 
# Select ''C/C++'' or ''Qt C++'' (if developing a Qt application)
 
# Click ''OK''
 
# Click ''OK''
  
=== Create a Run Configuration ===
+
== Create a Run Configuration ==
 
Launching an application from within Eclipse requires that a Run Configuration be created. This configuration provides Eclipse all the information it needs to be able to run a specific application. The application can be located either on the development machine or on the target machine provided a suitable connection is available. The following procedure assumes that the application being run is located on a remote target machine. This will be the case for all application development for EMAC products.
 
Launching an application from within Eclipse requires that a Run Configuration be created. This configuration provides Eclipse all the information it needs to be able to run a specific application. The application can be located either on the development machine or on the target machine provided a suitable connection is available. The following procedure assumes that the application being run is located on a remote target machine. This will be the case for all application development for EMAC products.
  
# Create a new launch configuration
+
<cl>
## In the Project Explorer View, right-click the project to be run
+
1. Create a new launch configuration
## Select ''Run As -> Run Configurations...'' to bring up the Run Configuration Dialog.
+
i. In the Project Explorer View, right-click the project to be run
## In the ''Type List'', right-click ''C/C++ Remote Application'' and select ''New...'' from the context menu. A new configuration will appear with the ''Name:'' equal to the name of the currently open project. This name can be changed by editing the ''Name:'' field.
+
* Select ''Run As Run Configurations...'' to bring up the Run Configuration Dialog.
# For instructions relating to fields in the main tab, refer to Figure 1 below. [[File:EMAC_Eclipse_Remote_Run_Configuration.png|center|frame|Figure 1: Run / Debug Configuration Main Tab]]
+
* In the ''Type List'', right-click ''C/C++ Remote Application'' and select ''New...'' from the context menu. A new configuration will appear with the ''Name:'' equal to the name of the currently open project. This name can be changed by editing the ''Name:'' field.
## Choose a connection from the ''Connection:'' drop-down menu or click ''New...'' to [[Remote System Explorer Setup for EMAC Eclipse#Create a Remote Connection|create a new one]].
+
* For instructions relating to fields in the main tab, refer to Figure 1 below. <br />
## The default for the ''Project:'' field will be the currently-active project. If this is not set to the project that you wish to run, click ''Browse...'' to choose the correct one.
+
 
## Choose a ''C/C++ Application:'' value by manually typing the ''app_name'' with path hierarchy into the field, using the ''Search Project...'' dialog to search the current project, or manually browsing for the application using the ''Browse...'' button.
+
[[File:EMAC_Eclipse_Remote_Run_Configuration.png|x600px|left|thumb|Figure 1: Run / Debug Configuration Main Tab]]
## Choose a ''Remote Absolute File Path for C/C++ Application:'' value. Note that this location must be writable on the target board. EMAC recommends using the <code>/tmp</code> directory for initial application testing, as this location is linked to a ramdisk and avoids unnecessary writes to the flash. Type the desired location in the provided text field, or select ''Browse...'' to search the remote filesystem for the target binary. Note that this step requires that the ''Connection:'' field is set to a valid connection and the development machine is connected to the target board.
+
<br clear=all>
# For instructions relating to the Arguments tab, refer to Figure 2 below. [[File:EMAC_Eclipse_Remote_Run_Arguments.png|center|frame|Figure 2: Run / Debug Configuration Arguments Tab]] If ''app_name'' takes any command-line arguments, they must be entered on the arguments tab. To avoid having to come back to this screen each time the arguments change, it is possible to use special Eclipse variables to specify the arguments, as described below:
+
 
## Click ''Variables...'' to open the ''Select Variable'' dialog.
+
* Choose a connection from the ''Connection:'' drop-down menu or click ''New...'' to [[Remote System Explorer Setup for Eclipse#Create a Remote Connection|create a new one]].
## Choose a variable either by searching for it using the search input field at the top of the dialog or scrolling manually through the available variables.
+
* The default for the ''Project:'' field will be the currently-active project. If this is not set to the project that you wish to run, click ''Browse...'' to choose the correct one.
## Click ''Edit Variables...'' to create a new variable or edit a user-modifiable variable.
+
* Choose a ''C/C++ Application:'' value by manually typing the ''app_name'' with path hierarchy into the field, using the ''Search Project...'' dialog to search the current project, or manually browsing for the application using the ''Browse...'' button.
## Many of the default variables have values that change depending on the arguments given in the ''Select Variable'' dialog. Some, such as those whose values are expected to be locations in the filesystem, can be configured with an additional dialog. To do so, click ''Configure...''.
+
* Choose a ''Remote Absolute File Path for C/C++ Application:'' value. Note that this location must be writeable on the target board. EMAC recommends using the <code>/tmp</code> directory for initial application testing, as this location is linked to a ramdisk and avoids unnecessary writes to the flash. Type the desired location in the provided text field, or select ''Browse...'' to search the remote filesystem for the target binary. Note that this step requires that the ''Connection:'' field is set to a valid connection and the development machine is connected to the target board.
 +
 
 +
* For instructions relating to the Arguments tab, refer to Figure 2 below. <br />
 +
 
 +
[[File:EMAC_Eclipse_Remote_Run_Arguments.png|x600px|left|thumb|Figure 2: Run / Debug Configuration Arguments Tab]]
 +
<br clear=all>
 +
 
 +
If ''app_name'' takes any command-line arguments, they must be entered on the arguments tab. To avoid having to come back to this screen each time the arguments change, it is possible to use special Eclipse variables to specify the arguments, as described below:
 +
* Click ''Variables...'' to open the ''Select Variable'' dialog.
 +
* Choose a variable either by searching for it using the search input field at the top of the dialog or scrolling manually through the available variables.
 +
* Click ''Edit Variables...'' to create a new variable or edit a user-modifiable variable.
 +
* Many of the default variables have values that change depending on the arguments given in the ''Select Variable'' dialog. Some, such as those whose values are expected to be locations in the filesystem, can be configured with an additional dialog. To do so, click ''Configure...''.
 +
</cl>
  
 
== Running the Remote Application ==
 
== Running the Remote Application ==
 
Using the Eclipse Run Menu to run a remote application can be done from the RSE, C/C++, Qt C++, or Debug perspectives. To run the application using the configuration created in the [[#Create a Run Configuration|instructions above]], follow the steps below:
 
Using the Eclipse Run Menu to run a remote application can be done from the RSE, C/C++, Qt C++, or Debug perspectives. To run the application using the configuration created in the [[#Create a Run Configuration|instructions above]], follow the steps below:
 
# Open Eclipse to the RSE, C/C++, Qt C++, or Debug perspective.
 
# Open Eclipse to the RSE, C/C++, Qt C++, or Debug perspective.
# Click ''Run -> Run Configuration...''.
+
# Click ''Run Run Configuration...''.
 
# Double-click the launcher configuration created in the [[#Create a Run Configuration|instructions above]].
 
# Double-click the launcher configuration created in the [[#Create a Run Configuration|instructions above]].
  
Line 50: Line 69:
  
 
== Next Steps ==
 
== Next Steps ==
The remote application debugging process is very similar to the remote Run configuration. Continue with the [[Debugging Remote Applications with EMAC Eclipse|Eclipse Remote Debugging guide]].
+
The remote application debugging process is very similar to the remote Run configuration. Continue with the [[Debugging Remote Applications with Eclipse|Eclipse Remote Debugging guide]].
  
[[Category:EMAC Eclipse]]
+
<!--[[Category:Eclipse]]-->

Latest revision as of 16:33, 26 March 2014

TODO: {{#todo:SEOKWREV; (10.29.13-20:00->MD+)(11.06.13-12:55->JG+)(03.04.14-17:00->BS-)(03.26.14-16:35->BS+)|Klint Youngmeyer|oe 4,ky,SEOKWREV, md,bs}}

Remote development using Eclipse is enhanced with tools such as the Eclipse Run/Debug Configurations and SSH which enable the remote execution of the application on the remote board. The Eclipse Run/Debug Configurations provide a way to transparently run an application on the remote board by automatically uploading the binary, changing execute permissions, executing, and interacting with the application using an SSH Shell.

Table 1: Conventions
connection_name Refers to the name of the connection used to connect to the target board.
app_name Refers to the target name of the application being developed.
target_board Refers to the name of the device for which the application is being developed.


Setup

Before continuing, ensure that Eclipse is open to the C/C++ or Qt C++ perspective.

  1. Open Eclipse
  2. Click Window → Open Perspective → Other...
  3. Select C/C++ or Qt C++ (if developing a Qt application)
  4. Click OK

Create a Run Configuration

Launching an application from within Eclipse requires that a Run Configuration be created. This configuration provides Eclipse all the information it needs to be able to run a specific application. The application can be located either on the development machine or on the target machine provided a suitable connection is available. The following procedure assumes that the application being run is located on a remote target machine. This will be the case for all application development for EMAC products.


  1. Create a new launch configuration

    1. In the Project Explorer View, right-click the project to be run

    2. Select Run As → Run Configurations... to bring up the Run Configuration Dialog.

    3. In the Type List, right-click C/C++ Remote Application and select New... from the context menu. A new configuration will appear with the Name: equal to the name of the currently open project. This name can be changed by editing the Name: field.

  2. For instructions relating to fields in the main tab, refer to Figure 1 below.

    Figure 1: Run / Debug Configuration Main Tab


    • Choose a connection from the Connection: drop-down menu or click New... to create a new one.

    • The default for the Project: field will be the currently-active project. If this is not set to the project that you wish to run, click Browse... to choose the correct one.

    • Choose a C/C++ Application: value by manually typing the app_name with path hierarchy into the field, using the Search Project... dialog to search the current project, or manually browsing for the application using the Browse... button.

    • Choose a Remote Absolute File Path for C/C++ Application: value. Note that this location must be writeable on the target board. EMAC recommends using the /tmp directory for initial application testing, as this location is linked to a ramdisk and avoids unnecessary writes to the flash. Type the desired location in the provided text field, or select Browse... to search the remote filesystem for the target binary. Note that this step requires that the Connection: field is set to a valid connection and the development machine is connected to the target board.

  3. For instructions relating to the Arguments tab, refer to Figure 2 below.

    Figure 2: Run / Debug Configuration Arguments Tab


    If app_name takes any command-line arguments, they must be entered on the arguments tab. To avoid having to come back to this screen each time the arguments change, it is possible to use special Eclipse variables to specify the arguments, as described below:

    • Click Variables... to open the Select Variable dialog.

    • Choose a variable either by searching for it using the search input field at the top of the dialog or scrolling manually through the available variables.

    • Click Edit Variables... to create a new variable or edit a user-modifiable variable.

    • Many of the default variables have values that change depending on the arguments given in the Select Variable dialog. Some, such as those whose values are expected to be locations in the filesystem, can be configured with an additional dialog. To do so, click Configure....

Running the Remote Application

Using the Eclipse Run Menu to run a remote application can be done from the RSE, C/C++, Qt C++, or Debug perspectives. To run the application using the configuration created in the instructions above, follow the steps below:

  1. Open Eclipse to the RSE, C/C++, Qt C++, or Debug perspective.
  2. Click Run → Run Configuration....
  3. Double-click the launcher configuration created in the instructions above.

The application will be uploaded to the target board and executed. All program output will be displayed in the Console view in Eclipse.

Next Steps

The remote application debugging process is very similar to the remote Run configuration. Continue with the Eclipse Remote Debugging guide.