Difference between revisions of "Executing Remote Applications with Eclipse"

From wiki.emacinc.com
Jump to: navigation, search
 
(8 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{todo|Complete; (10.29.13-20:00->MD+)(11.06.13-12:55->JG+)|Klint Youngmeyer|project=oe 4,ky,Complete, md}}
+
{{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)
Line 24: Line 31:
  
 
== 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 that 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.
 +
 
 +
<cl>
 +
1. Create a new launch configuration
 +
i. In the Project Explorer View, right-click the project to be run
 +
* Select ''Run As → Run Configurations...'' to bring up the Run Configuration Dialog.
 +
* 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.
 +
* For instructions relating to fields in the main tab, refer to Figure 1 below. <br />
 +
 
 +
[[File:EMAC_Eclipse_Remote_Run_Configuration.png|x600px|left|thumb|Figure 1: Run / Debug Configuration Main Tab]]
 +
<br clear=all>
 +
 
 +
* 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]].
 +
* 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 <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>
  
# Create a new launch configuration
+
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:
## In the Project Explorer View, right-click the project to be run
+
* Click ''Variables...'' to open the ''Select Variable'' dialog.
## Select ''Run As → Run Configurations...'' to bring up the Run Configuration 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.
## 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.
+
* Click ''Edit Variables...'' to create a new variable or edit a user-modifiable variable.
# For instructions relating to fields in the main tab, refer to Figure 1 below. <br /><br />[[File:EMAC_Eclipse_Remote_Run_Configuration.png|center|frame|Figure 1: Run / Debug Configuration Main Tab]]<br />
+
* 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 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]].
+
</cl>
## 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 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.
 
# For instructions relating to the Arguments tab, refer to Figure 2 below. <br /><br />[[File:EMAC_Eclipse_Remote_Run_Arguments.png|center|frame|Figure 2: Run / Debug Configuration Arguments Tab]]<br />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 ==
 
== Running the Remote Application ==
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 15: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.