📄 using_eclipse.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head> <title></title> <link rel="stylesheet" media="screen" type="text/css" href="./style.css" /> <link rel="stylesheet" media="screen" type="text/css" href="./design.css" /> <link rel="stylesheet" media="print" type="text/css" href="./print.css" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body><a href=start.html>start</a></br><div class="toc"><div class="tocheader toctoggle" id="toc__header">Table of Contents</div><div id="toc__inside"><ul class="toc"><li class="clear"><ul class="toc"><li class="level2"><div class="li"><span class="li"><a href="#using_eclipse" class="toc">Using Eclipse</a></span></div><ul class="toc"><li class="level3"><div class="li"><span class="li"><a href="#introduction" class="toc">Introduction</a></span></div></li><li class="level3"><div class="li"><span class="li"><a href="#initial_setup" class="toc">Initial Setup</a></span></div></li><li class="level3"><div class="li"><span class="li"><a href="#working_with_uclinux_projects" class="toc">Working With uClinux Projects</a></span></div></li><li class="level3"><div class="li"><span class="li"><a href="#working_with_cvs" class="toc">Working With CVS</a></span></div></li><li class="level3"><div class="li"><span class="li"><a href="#working_with_subversion" class="toc">Working With Subversion</a></span></div></li><li class="level3"><div class="li"><span class="li"><a href="#debugging_using_eclipse" class="toc">Debugging using Eclipse</a></span></div></li></ul></li></ul></li></ul></div></div><h2><a name="using_eclipse" id="using_eclipse">Using Eclipse</a></h2><div class="level2"></div><!-- SECTION [1-24] --><h3><a name="introduction" id="introduction">Introduction</a></h3><div class="level3"><p>Eclipse is an Integrated Development Environment (IDE) which provides support for managing projects, editing source code, and using external build tools. Eclipse can be downloaded <a href="http://www.eclipse.org/" class="urlextern" title="http://www.eclipse.org/" rel="nofollow">here</a> and is available for a variety of platforms including Windows, Linux, and Mac OSX. This section only covers a small portion of the features available in Eclipse. For more information see the Eclipse help files.</p></div><!-- SECTION [25-475] --><h3><a name="initial_setup" id="initial_setup">Initial Setup</a></h3><div class="level3"><p>There are a variety of download options available from the <a href="http://www.eclipse.org/" class="urlextern" title="http://www.eclipse.org/" rel="nofollow">eclipse</a> website, some require you to build Eclipse from source while others contain a pre-built executable file. Installation specifics will depend on your particular operating system and download option.</p><p> Eclipse requires a Java Runtime Environment (JRE). If a JRE is not already installed on your system you will have to install one before Eclipse can be used. When starting Eclipse you may need to specify the location of your JRE by using the <em><strong>-</strong></em><em><strong>vm</strong></em> switch:</p><pre class="code">bash$ eclipse -vm <path to JRE></pre><p> (e.g. eclipse -vm /usr/java/j2re1.4.2_04/bin/java)</p><p> Once Eclipse is running introductory information on using Eclipse can be obtained from the help files. These help files are in <acronym title="HyperText Markup Language">HTML</acronym> format and accessing them requires a default web browser to be specified. To select the default browser choose <em><strong>Window>Preferences</strong></em>. This should display the preferences dialog:</p><p><a href="media/eclipse1.png" class="media" target="_blank" title="eclipse1.png"><img src="media/eclipse1.png" class="media" alt="" /></a></p><p>From the list on the left select <strong>Help</strong></p><p>If your browser is not displayed in the <strong>Current external web browser adapter</strong> list select <strong>Custom Browser</strong></p><p>In the <strong>Custom Browser command</strong> field enter the name of your browser followed by <strong>%1</strong> (e.g. firefox %1)</p></div><!-- SECTION [476-1767] --><h3><a name="working_with_uclinux_projects" id="working_with_uclinux_projects">Working With uClinux Projects</a></h3><div class="level3"><p>There are many ways that Eclipse can be used with Blackfin/uClinux projects. This section will describe how to create a uClinux project and build it with Eclipse. Before proceeding with these instructions you should have read the sections on <a href="compiling_the_kernel.html" class="wikilink1" title="compiling_the_kernel.html">Compiling the Kernel</a> and <a href="adding_user_applications.html" class="wikilink1" title="adding_user_applications.html">Adding User Applications</a>. This section essentially describes how to preform the same tasks from within Eclipse.</p><p> First, start a new project by selecting <em><strong>File>New>Project</strong></em>. The new project wizard dialog should now be displayed:</p><p><a href="media/eclipse2.png" class="media" target="_blank" title="eclipse2.png"><img src="media/eclipse2.png" class="media" alt="" /></a></p><p>Under the <strong>Simple</strong> project type choose <strong>Project</strong>.</p><p>Click on <strong>Next</strong>.</p><p> <a href="media/eclipse3.png" class="media" target="_blank" title="eclipse3.png"><img src="media/eclipse3.png" class="media" alt="" /></a></p><p>In the Project name field enter the name of your program.</p><p>Un-check <strong>Use default</strong>.</p><p>In the <strong>Directory</strong> field enter the path to the <code>user</code> directory in your uClinux distribution.</p><p> You should now have a new project visible in the Navigator view. Expanding the project’s folder icon should reveal a file called <em><strong>.project</strong></em>, this file is created automatically by Eclipse, it contains information about the project. Do NOT delete this file, without it Eclipse will not recognize the project. From here you should be able to add new files to the project by selecting <em><strong>File>New>File</strong></em>. Once you have created all the required source files, and the Makefile you may now create configurations to build the uClinux kernel image.</p><p> <a href="adding_user_applications.html" class="wikilink1" title="adding_user_applications.html">Adding User Applications</a> </p><p> Creating the uClinux memory image involves three steps: <strong>make xconfig</strong>, <strong>make dep</strong>, and <strong>make</strong>. Instead of executing these commands from a bash session they may be run from Eclipse. Instructions for adding a configuration to execute <strong>make xconfig</strong> will be given. Adding configurations for <strong>make dep</strong> and <strong>make</strong> are very similar and are left as an exercise for the reader.</p><p> First select <em><strong>Run>External Tools>External Tools</strong></em>. The External Tools dialog should now be displayed:</p><p><a href="media/eclipse4.png" class="media" target="_blank" title="eclipse4.png"><img src="media/eclipse4.png" class="media" alt="" /></a></p><p>In the pane on the left, select <strong>Program</strong> then click on the <strong>New</strong> button.</p><p>A new configuration should now be created.</p><p>In the <strong>Name</strong> field enter a name for this configuration.</p><p>In the <strong>Location</strong> field enter the location of the program <strong>make</strong> (usually <code>/usr/bin/make</code>).</p><p>In the <strong>Working Directory</strong> field enter the path of the uClinux distribution.</p><p>In the <strong>Arguments</strong> field enter <strong>xconfig</strong>.</p><p>Next, select the <strong>Common</strong> tab.</p><p><a href="media/eclipse5.png" class="media" target="_blank" title="eclipse5.png"><img src="media/eclipse5.png" class="media" alt="" /></a></p><p>De-select <strong>Launch in background</strong>.</p><p>This is necessary because we want each stage (make xconfig, make dep, and make) to complete before the next stage of the build is started.</p><p>Click the <strong>Apply</strong> button.</p><p>Finally click the <strong>Close</strong> button.</p><p> In the same way configurations for the <strong>make dep</strong> and <strong>make </strong>command should also be created. Next the <strong>make xconfig</strong>, <strong>make dep</strong>, and <strong>make</strong> configurations will be integrated into the build operation. To do this first select your project in the Navigator view then choose <em><strong>Project>Properties</strong></em>. The Properties dialog should now be displayed:</p><p><a href="media/eclipse6.png" class="media" target="_blank" title="eclipse6.png"><img src="media/eclipse6.png" class="media" alt="" /></a></p><p>From the list on the left select <strong>Builders</strong>.</p><p>Click on the <strong>Import</strong> button and select the configuration to add.</p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -