[Esbox-commits] r1955 - in branches/work_Raul: org.maemo.esbox.cpp.project/src/org/maemo/esbox/internal/cpp/project/core org.maemo.esbox.help org.maemo.esbox.help/html org.maemo.esbox.help/html/concepts org.maemo.esbox.help/html/gettingstarted org.maemo.esbox.help/html/images org.maemo.esbox.help/html/images/profiling org.maemo.esbox.help/html/images/proj_wiz org.maemo.esbox.help/html/reference org.maemo.esbox.help/html/tasks org.maemo.esbox.launch.analysis org.maemo.esbox.launch.analysis/icons/full/obj16 org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch org.maemo.esbox.maemosdk.core/conf org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/tools org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/api/maemosdk/ui/preferences org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/actions org.maemo.esbox.product org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/api/scratchbox/core/execEnv org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/api/scratchbox/core/sdk org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/scratchbox/core/sdk org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/launcher org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/scratchbox/sb1/sdk org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/core org.maemo.esbox.scratchbox.tests/src/org/maemo/esbox/scratchbox/tests org.maemo.esbox.scratchbox.tests/src/org/maemo/esbox/scratchbox/tests/commands org.maemo.esbox.tests org.maemo.esbox.tests/META-INF org.maemo.esbox.tests/src/org/maemo/esbox/internal/tests org.maemo.esbox.tests/src/org/maemo/esbox/tests/python
raul at garage.maemo.org
raul at garage.maemo.org
Tue Aug 11 03:04:10 EEST 2009
Author: raul
Date: 2009-08-11 03:04:04 +0300 (Tue, 11 Aug 2009)
New Revision: 1955
Added:
branches/work_Raul/org.maemo.esbox.help/html/gettingstarted/UsingHoverHelp.html
branches/work_Raul/org.maemo.esbox.help/html/images/hover-c-prefs.png
branches/work_Raul/org.maemo.esbox.help/html/images/hover-maemo-prefs.png
branches/work_Raul/org.maemo.esbox.help/html/images/profiling/ltrace-menu.png
branches/work_Raul/org.maemo.esbox.help/html/images/profiling/ltrace-view.png
branches/work_Raul/org.maemo.esbox.help/html/images/proj_wiz/wiz-python-project-interpreter-conf.png
branches/work_Raul/org.maemo.esbox.launch.analysis/icons/full/obj16/ltrace.gif
branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxCppLtraceLocalLaunchConfigurationTabGroup.java
branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxCppLtraceLocalLaunchShortcut.java
branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxCppLtraceRemoteLaunchConfigurationTabGroup.java
branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxCppLtraceRemoteLaunchShortcut.java
branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxPythonLtraceLocalLaunchConfigurationTabGroup.java
branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxPythonLtraceLocalLaunchShortcut.java
branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxPythonLtraceRemoteLaunchConfigurationTabGroup.java
branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxPythonLtraceRemoteLaunchShortcut.java
Modified:
branches/work_Raul/org.maemo.esbox.cpp.project/src/org/maemo/esbox/internal/cpp/project/core/MaemoCppProjectPackageGatherer.java
branches/work_Raul/org.maemo.esbox.help/html/concepts/ProfilingApplications.html
branches/work_Raul/org.maemo.esbox.help/html/images/proj_wiz/wiz-python-project-template.png
branches/work_Raul/org.maemo.esbox.help/html/images/proj_wiz/wiz-python-project-variables.png
branches/work_Raul/org.maemo.esbox.help/html/reference/FAQ.html
branches/work_Raul/org.maemo.esbox.help/html/tasks/CreatingPythonProject.html
branches/work_Raul/org.maemo.esbox.help/html/tasks/ProfilingMaemoApplications.html
branches/work_Raul/org.maemo.esbox.help/html/tasks/UsingFlasherWizard.html
branches/work_Raul/org.maemo.esbox.help/html/tasks/UsingVirtualMachines.html
branches/work_Raul/org.maemo.esbox.help/html/tocgettingstarted.html
branches/work_Raul/org.maemo.esbox.help/tocgettingstarted.xml
branches/work_Raul/org.maemo.esbox.launch.analysis/plugin.xml
branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/IESboxAnalysisLaunchConstants.java
branches/work_Raul/org.maemo.esbox.maemosdk.core/conf/maemo_prefs.xml
branches/work_Raul/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/tools/AfSbInitMaemoLauncherAdapter.java
branches/work_Raul/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/tools/IMaemoLauncherAdapter.java
branches/work_Raul/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/tools/MaemoScriptLauncher.java
branches/work_Raul/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/tools/XLauncher.java
branches/work_Raul/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/api/maemosdk/ui/preferences/BuildMachinePreferencePage.java
branches/work_Raul/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/actions/BaseEmulatorStartStopRestartControlAction.java
branches/work_Raul/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/actions/MaemoDropdownMenuAction.java
branches/work_Raul/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/actions/XDropdownMenuAction.java
branches/work_Raul/org.maemo.esbox.product/about.mappings
branches/work_Raul/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/api/scratchbox/core/execEnv/MaemoExecutionEnvironmentHandler.java
branches/work_Raul/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/api/scratchbox/core/execEnv/X11ExecutionEnvironmentHandler.java
branches/work_Raul/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/api/scratchbox/core/sdk/AbstractScratchboxSDK.java
branches/work_Raul/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/scratchbox/core/sdk/IScratchboxSDK.java
branches/work_Raul/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/Scratchbox1SDK.java
branches/work_Raul/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/launcher/Scratchbox1PrepareTargetProcessLaunchAdapter.java
branches/work_Raul/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/launcher/Scratchbox1ProcessLauncher.java
branches/work_Raul/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/MaemoScriptInstallerMonitor.java
branches/work_Raul/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/Scratchbox1SDKInstallerDataContentLabelProvider.java
branches/work_Raul/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/Scratchbox1TargetInstallerDataContentLabelProvider.java
branches/work_Raul/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/scratchbox/sb1/sdk/IScratchbox1SDK.java
branches/work_Raul/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/core/Scratchbox2SDK.java
branches/work_Raul/org.maemo.esbox.scratchbox.tests/src/org/maemo/esbox/scratchbox/tests/TestSB1ProcessLauncher.java
branches/work_Raul/org.maemo.esbox.scratchbox.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestListCommands.java
branches/work_Raul/org.maemo.esbox.scratchbox.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestRemoveSb2Command.java
branches/work_Raul/org.maemo.esbox.scratchbox.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestScratchboxFacade.java
branches/work_Raul/org.maemo.esbox.tests/META-INF/MANIFEST.MF
branches/work_Raul/org.maemo.esbox.tests/asthelper.completions
branches/work_Raul/org.maemo.esbox.tests/src/org/maemo/esbox/internal/tests/ESboxMicaTestSuite.java
branches/work_Raul/org.maemo.esbox.tests/src/org/maemo/esbox/tests/python/ManualTestPyDevInterpreterConfigurator.java
branches/work_Raul/org.maemo.esbox.tests/src/org/maemo/esbox/tests/python/TestPythonProjectConverter.java
Log:
merged with trunnk r 1954
Modified: branches/work_Raul/org.maemo.esbox.cpp.project/src/org/maemo/esbox/internal/cpp/project/core/MaemoCppProjectPackageGatherer.java
===================================================================
--- branches/work_Raul/org.maemo.esbox.cpp.project/src/org/maemo/esbox/internal/cpp/project/core/MaemoCppProjectPackageGatherer.java 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.cpp.project/src/org/maemo/esbox/internal/cpp/project/core/MaemoCppProjectPackageGatherer.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -46,11 +46,13 @@
if (sdkTarget == null) {
// generic packages for any target
- info.getSystemPackages().add("maemo-sdk-dev");
info.getSystemPackages().add("maemo-debug-scripts");
info.getSystemPackages().add("maemo-c-debug-tools");
} else {
// target-specific packages
+ if (sdkTarget.getMachine() instanceof IBuildMachine) {
+ info.getSystemPackages().add("maemo-sdk-dev");
+ }
if (MicaCppProjectNature.isCCLanguageNatureInProject(project)) {
if (sdkTarget.getMachine() instanceof IBuildMachine)
info.getSystemPackages().add("maemo-cplusplus-env");
Modified: branches/work_Raul/org.maemo.esbox.help/html/concepts/ProfilingApplications.html
===================================================================
--- branches/work_Raul/org.maemo.esbox.help/html/concepts/ProfilingApplications.html 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.help/html/concepts/ProfilingApplications.html 2009-08-11 00:04:04 UTC (rev 1955)
@@ -16,8 +16,9 @@
By simply profiling an application, it becomes immediately apparent where the
overwhelming memory and CPU burdens exist, and allows you to quickly squash them.
ESbox provides support for <a href="http://www.valgrind.org/">Valgrind</a>
-memory profiler and <a href="http://oprofile.sourceforge.net/news/">OProfile</a>
-system-wide profiler for both C/C++ and Python Projects.</p>
+memory profiler, <a href="http://oprofile.sourceforge.net/news/">OProfile</a>
+system-wide profiler and <a href="http://www.ltrace.org">Ltrace</a> library call monitor
+ for both C/C++ and Python Projects.</p>
<h3 class="style1">Valgrind</h3>
<p>Valgrind is an Open Source suite of tools for debugging and profiling Linux programs.
@@ -42,6 +43,15 @@
of a wide variety of interesting statistics, which can also be used for basic
time-spent profiling. All code is profiled: hardware and software interrupt handlers,
kernel modules, the kernel, shared libraries, and applications.</p>
+
+
+
+<h3 class="style1">Ltrace</h3>
+<p>Ltrace is a debugging program which runs a specified command until it exits.
+While the command is executing, ltrace intercepts and records the dynamic library calls
+which are called by the executed process and the signals received by that process.</p>
+
+
<h3>Related Topic</h3>
<ul>
<li><a href="../tasks/ProfilingMaemoApplications.html">Profiling Maemo Applications</a> </li>
Copied: branches/work_Raul/org.maemo.esbox.help/html/gettingstarted/UsingHoverHelp.html (from rev 1954, trunk/org.maemo.esbox.help/html/gettingstarted/UsingHoverHelp.html)
===================================================================
--- branches/work_Raul/org.maemo.esbox.help/html/gettingstarted/UsingHoverHelp.html (rev 0)
+++ branches/work_Raul/org.maemo.esbox.help/html/gettingstarted/UsingHoverHelp.html 2009-08-11 00:04:04 UTC (rev 1955)
@@ -0,0 +1,50 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html lang="en">
+<head>
+ <meta name="copyright" content="Copyright (c) INdT 2007-2009, (c) Nokia 2008-2009. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
+ <meta http-equiv="Content-Language" content="en-us">
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>Using Hover Help for Maemo API Libraries</title>
+ <link rel="stylesheet" type="text/css" href="../help.css">
+ <style type="text/css">
+
+<!--
+.style1 {font-weight: bold}
+-->
+ </style>
+</head>
+
+<body>
+<h2 class="style1">Using Hover Help for Maemo API Libraries</h2>
+
+<p><span lang="en-us">The first step you should do to make hover help works is
+edit <strong> Window > Preferences > C/C++ > Editor > Hovers</strong> preference page. Check if <strong>Maemo SDK C/C++ Hover Help</strong>
+is enabled (it should be enabled by default).</span></p>
+
+<img src="../images/hover-c-prefs.png" alt="C/C++ Hover preferences">
+
+
+<p>Go to <strong>Maemo > Hover Help</strong> preference
+page and click <strong>Activate Hover Help </strong>. </p>
+
+<img src="../images/hover-maemo-prefs.png" alt="menu">
+
+<p> In this preference page you can also choose what kind of help content you want to
+ search while using hover help:
+ </p>
+
+<ul>
+<li><strong>Show only local:</strong> If you do not want to use remote documentation but just local documentation.</li>
+<li><strong>Show local/remote:</strong> To use both local and remote documentation available, be sure your network connection is
+working and you are able to access the internet.</li>
+</ul>
+<p> On <strong>Content Contributions</strong> tree you can see the content contributions available.</p>
+
+<h3>Related Topics</h3>
+<!--
+<ul>
+ <li><a href="#">TODO How to download help documentation</a></li>
+</ul>
+-->
+</body>
+</html>
Copied: branches/work_Raul/org.maemo.esbox.help/html/images/hover-c-prefs.png (from rev 1954, trunk/org.maemo.esbox.help/html/images/hover-c-prefs.png)
===================================================================
(Binary files differ)
Copied: branches/work_Raul/org.maemo.esbox.help/html/images/hover-maemo-prefs.png (from rev 1954, trunk/org.maemo.esbox.help/html/images/hover-maemo-prefs.png)
===================================================================
(Binary files differ)
Copied: branches/work_Raul/org.maemo.esbox.help/html/images/profiling/ltrace-menu.png (from rev 1954, trunk/org.maemo.esbox.help/html/images/profiling/ltrace-menu.png)
===================================================================
(Binary files differ)
Copied: branches/work_Raul/org.maemo.esbox.help/html/images/profiling/ltrace-view.png (from rev 1954, trunk/org.maemo.esbox.help/html/images/profiling/ltrace-view.png)
===================================================================
(Binary files differ)
Copied: branches/work_Raul/org.maemo.esbox.help/html/images/proj_wiz/wiz-python-project-interpreter-conf.png (from rev 1954, trunk/org.maemo.esbox.help/html/images/proj_wiz/wiz-python-project-interpreter-conf.png)
===================================================================
(Binary files differ)
Modified: branches/work_Raul/org.maemo.esbox.help/html/images/proj_wiz/wiz-python-project-template.png
===================================================================
(Binary files differ)
Modified: branches/work_Raul/org.maemo.esbox.help/html/images/proj_wiz/wiz-python-project-variables.png
===================================================================
(Binary files differ)
Modified: branches/work_Raul/org.maemo.esbox.help/html/reference/FAQ.html
===================================================================
--- branches/work_Raul/org.maemo.esbox.help/html/reference/FAQ.html 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.help/html/reference/FAQ.html 2009-08-11 00:04:04 UTC (rev 1955)
@@ -239,7 +239,7 @@
Samba sharing from the host to the VM.</p>
<p>See the <a href="http://maemovmware.garage.maemo.org/">Maemo SDK virtual image page</a>
for configured and supported images and the
-<a href="http://esbox.garage.maemo.org/2nd_edition/virtual_machines.html">ESbox virtual machine support documentation</a>.
+<a href="../tasks/virtual_machines.html">ESbox virtual machine documentation</a>.
</div>
<hr>
<div id="ask" dir="LTR">
Modified: branches/work_Raul/org.maemo.esbox.help/html/tasks/CreatingPythonProject.html
===================================================================
--- branches/work_Raul/org.maemo.esbox.help/html/tasks/CreatingPythonProject.html 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.help/html/tasks/CreatingPythonProject.html 2009-08-11 00:04:04 UTC (rev 1955)
@@ -46,6 +46,12 @@
<p/>
<img src="../images/proj_wiz/wiz-python-project-variables.png" alt="variables">
</li>
+
+ <li>Click <strong>Next</strong> to set python interpreter and grammar configurations.
+ <p/>
+ <img src="../images/proj_wiz/wiz-python-project-interpreter-conf.png" alt="python interpreter conf">
+ </li>
+
<li> Click <strong>Finish</strong>.
You will be asked if you want to <a href="../tasks/ValidatingPackages.html">validate the build and runtime packages
for the project</a>.
Modified: branches/work_Raul/org.maemo.esbox.help/html/tasks/ProfilingMaemoApplications.html
===================================================================
--- branches/work_Raul/org.maemo.esbox.help/html/tasks/ProfilingMaemoApplications.html 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.help/html/tasks/ProfilingMaemoApplications.html 2009-08-11 00:04:04 UTC (rev 1955)
@@ -32,9 +32,9 @@
Profiling is one of the most important techniques available for programmers to discover problems
in applications. By profiling an application, it becomes immediately apparent where the
overwhelming memory and CPU burdens exist, and allows you to quickly squash them. ESbox provides
- support for <a href="http://www.valgrind.org/">Valgrind</a> memory profiler and
- <a href="http://oprofile.sourceforge.net/news/">OProfile</a> system-wide profiler for both C/C++
- and Python Projects.
+ support for <a href="http://www.valgrind.org/">Valgrind</a> memory profiler, <a href="http://oprofile.sourceforge.net/news/">OProfile</a>
+ system-wide profiler and <a href="http://www.ltrace.org">Ltrace</a> library call monitor
+ for both C/C++ and Python Projects.
</p>
<h3>Using Valgrind</h3>
@@ -95,7 +95,33 @@
<p>
<img src="../images/profiling/oprofile-view.png">
</p>
+
+ <h3>Using Ltrace</h3>
+ <p>
+ Ltrace is a debugging program which runs a specified command until it exits.
+ While the command is executing, ltrace intercepts and records the dynamic library
+ calls which are called by the executed process and the signals received by that process.
+ </p>
+ <p>
+ To run LTrace, right-click on the application (binary for C/C++ projects or the Python script
+ for Python projects) and select <strong>Profile As > Local/Remote Ltrace Profiler</strong>.
+ </p>
+
+ <p>
+ <img src="../images/profiling/ltrace-menu.png">
+ </p>
+
+ <p>
+ After Ltrace starts, ESbox launches your application on the SDKTarget and
+ the result is shown in Ltrace view. All Library and System calls are shown
+ as a tree: parent nodes and child nodes for each new nested call.
+ </p>
+
+ <p>
+ <img src="../images/profiling/ltrace-view.png">
+ </p>
+
</body>
</html>
Modified: branches/work_Raul/org.maemo.esbox.help/html/tasks/UsingFlasherWizard.html
===================================================================
--- branches/work_Raul/org.maemo.esbox.help/html/tasks/UsingFlasherWizard.html 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.help/html/tasks/UsingFlasherWizard.html 2009-08-11 00:04:04 UTC (rev 1955)
@@ -38,6 +38,10 @@
easily repeatable UI.
</p>
<p>
+ <b>NOTE:</b> The flasher requires special drivers and software to talk
+ to the device and flash images to it. The wizard will automatically locate and install these for you.
+ </p>
+ <p>
All you need to do to prepare is to back up any personal settings and
files on your device which may be overwritten by the new image.
</p>
@@ -164,13 +168,16 @@
<li>
<p>
- Click <strong>Next</strong>. The wizard will now download the flasher binary (once).
+ Click <strong>Next</strong>. The wizard will now download the flasher binary (once)
+ and also install any driver software required for communicating with
+ the device in flashing mode. This may install additional software,
+ such as the <a href="pc-connectivity.garage.maemo.org">Host PC Connectivity software</a>.
<p/>
<img src="../images/flash/dialog-flash-get-flasher.png" />
</li>
<li>
- <p>
+ <p>
If you have not already done so, ensure the device is connected via USB,
"attached" to the virtual machine if you use one, and ready to go.
The <strong>Retry</strong> button will let you start over if you need
Modified: branches/work_Raul/org.maemo.esbox.help/html/tasks/UsingVirtualMachines.html
===================================================================
--- branches/work_Raul/org.maemo.esbox.help/html/tasks/UsingVirtualMachines.html 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.help/html/tasks/UsingVirtualMachines.html 2009-08-11 00:04:04 UTC (rev 1955)
@@ -479,6 +479,28 @@
</li>
<li>Shared folder configuration
<ul>
+ <li>If you cannot mount to shared folders published from Windows, and
+ you get the error <tt>"mount error 12 = cannot allocate memory"</tt>,
+ then this is a host issue. You can fix this in your Windows registry.
+ <p>Edit the key
+ <pre>
+ HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanServer\Parameters\IRPStackSize
+ </pre>
+ <p>
+ Define it as a DWORD value (if missing). Set it to a value in
+ the decimal range 15 to 18. (The documentation is unclear what this
+ value indicates, so it may require some experimentation.)
+ </p>
+ <p>The new setting will only be read when the sharing service
+ is restarted. You may do this via
+ <strong>Control Panel > Administrative Tools > Services >
+ Server</strong> and restart, or if you've got more time to kill,
+ reboot your system.
+ </p>
+ <p>
+ Also see <a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;177078">the Microsoft Knowledge Base article</a>
+ for more information.
+ </li>
<li>Be careful about the time synchronization configuration in the VM or the timezone
used in the VM image.
<p>
Modified: branches/work_Raul/org.maemo.esbox.help/html/tocgettingstarted.html
===================================================================
--- branches/work_Raul/org.maemo.esbox.help/html/tocgettingstarted.html 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.help/html/tocgettingstarted.html 2009-08-11 00:04:04 UTC (rev 1955)
@@ -36,6 +36,7 @@
</h3><li><h3><a href="../html/gettingstarted/RunningPythonMaemoProject.html">Running Python Maemo Project</a>
</h3><li><h3><a href="../html/gettingstarted/DebuggingCMaemoProject.html">Debugging a C/C++ Maemo Project</a>
</h3><li><h3><a href="../html/gettingstarted/DebuggingPythonMaemoProject.html">Debugging a Python Maemo Project</a>
+</h3><li><h3><a href="../html/gettingstarted/UsingHoverHelp.html">Using Hover Help for Maemo API Libraries</a>
</h3></ul>
Modified: branches/work_Raul/org.maemo.esbox.help/tocgettingstarted.xml
===================================================================
--- branches/work_Raul/org.maemo.esbox.help/tocgettingstarted.xml 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.help/tocgettingstarted.xml 2009-08-11 00:04:04 UTC (rev 1955)
@@ -25,5 +25,7 @@
<topic label="Running C/C++ Maemo Project" href="html/gettingstarted/RunningCMaemoProject.html" />
<topic label="Running Python Maemo Project" href="html/gettingstarted/RunningPythonMaemoProject.html" />
<topic label="Debugging a C/C++ Maemo Project" href="html/gettingstarted/DebuggingCMaemoProject.html" />
- <topic label="Debugging a Python Maemo Project" href="html/gettingstarted/DebuggingPythonMaemoProject.html" />
+ <topic label="Debugging a Python Maemo Project" href="html/gettingstarted/DebuggingPythonMaemoProject.html" />
+ <topic label="Using Hover Help for Maemo API Libraries" href="html/gettingstarted/UsingHoverHelp.html" />
+
</toc>
Copied: branches/work_Raul/org.maemo.esbox.launch.analysis/icons/full/obj16/ltrace.gif (from rev 1954, trunk/org.maemo.esbox.launch.analysis/icons/full/obj16/ltrace.gif)
===================================================================
(Binary files differ)
Modified: branches/work_Raul/org.maemo.esbox.launch.analysis/plugin.xml
===================================================================
--- branches/work_Raul/org.maemo.esbox.launch.analysis/plugin.xml 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.launch.analysis/plugin.xml 2009-08-11 00:04:04 UTC (rev 1955)
@@ -26,7 +26,26 @@
sourceLocatorId="org.eclipse.cdt.debug.core.sourceLocator"
sourcePathComputerId="org.eclipse.cdt.debug.core.sourcePathComputer">
</launchConfigurationType>
-
+
+ <launchConfigurationType
+ delegate="org.maemo.mica.cpp.launch.analysis.ltrace.CppLtraceLocalLaunchDelegate"
+ id="org.maemo.esbox.analysis.launch.cpp.LtraceLocalLaunchType"
+ modes="profile"
+ name="Local Ltrace Profiler"
+ public="true"
+ sourceLocatorId="org.eclipse.cdt.debug.core.sourceLocator"
+ sourcePathComputerId="org.eclipse.cdt.debug.core.sourcePathComputer">
+ </launchConfigurationType>
+
+ <launchConfigurationType
+ delegate="org.maemo.mica.cpp.launch.analysis.ltrace.CppLtraceRemoteLaunchDelegate"
+ id="org.maemo.esbox.analysis.launch.cpp.LtraceRemoteLaunchType"
+ modes="profile"
+ name="Remote Ltrace Profiler"
+ public="true"
+ sourceLocatorId="org.eclipse.cdt.debug.core.sourceLocator"
+ sourcePathComputerId="org.eclipse.cdt.debug.core.sourcePathComputer">
+ </launchConfigurationType>
</extension>
<extension
point="org.eclipse.debug.ui.launchConfigurationTabGroups">
@@ -40,6 +59,18 @@
id="valgrindLaunchTabGroup"
type="org.maemo.esbox.analysis.launch.cpp.ValgrindLocalLaunchType">
</launchConfigurationTabGroup>
+
+ <launchConfigurationTabGroup
+ class="org.maemo.esbox.internal.analysis.launch.ESboxCppLtraceLocalLaunchConfigurationTabGroup"
+ id="ltraceLocalLaunchTabGroup"
+ type="org.maemo.esbox.analysis.launch.cpp.LtraceLocalLaunchType">
+ </launchConfigurationTabGroup>
+
+ <launchConfigurationTabGroup
+ class="org.maemo.esbox.internal.analysis.launch.ESboxCppLtraceRemoteLaunchConfigurationTabGroup"
+ id="ltraceRemoteLaunchTabGroup"
+ type="org.maemo.esbox.analysis.launch.cpp.LtraceRemoteLaunchType">
+ </launchConfigurationTabGroup>
</extension>
@@ -55,7 +86,18 @@
icon="icons/full/obj16/valgrind_local.gif"
id="valgrindLaunchTypeImage">
</launchConfigurationTypeImage>
-
+
+ <launchConfigurationTypeImage
+ configTypeID="org.maemo.esbox.analysis.launch.cpp.LtraceLocalLaunchType"
+ icon="icons/full/obj16/ltrace.gif"
+ id="ltraceLocalLaunchTypeImage">
+ </launchConfigurationTypeImage>
+
+ <launchConfigurationTypeImage
+ configTypeID="org.maemo.esbox.analysis.launch.cpp.LtraceRemoteLaunchType"
+ icon="icons/full/obj16/ltrace.gif"
+ id="ltraceRemoteLaunchTypeImage">
+ </launchConfigurationTypeImage>
</extension>
<extension
@@ -139,7 +181,94 @@
id="org.maemo.esbox.analysis.launch.cpp.ValgrindLocalLaunchType">
</configurationType>
</shortcut>
+
+
+ <shortcut
+ class="org.maemo.esbox.internal.analysis.launch.ESboxCppLtraceLocalLaunchShortcut"
+ icon="icons/full/obj16/ltrace.gif"
+ id="maemoLtraceShortcut"
+ label="Local Ltrace Profiler"
+ modes="profile">
+ <contextualLaunch>
+ <enablement>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate>
+ <and>
+ <test
+ forcePluginActivation="true"
+ property="org.maemo.mica.common.hasNature"
+ value="org.maemo.esbox.cpp.project.cppNature"/>
+ <test
+ forcePluginActivation="true"
+ property="org.maemo.mica.maemosdk.isEmulatorTarget"/>
+ <test
+ forcePluginActivation="true"
+ property="org.maemo.mica.cpp.isCppLaunchable"/>
+
+ </and>
+ </iterate>
+ </with></enablement>
+ <contextLabel
+ label="Local Ltrace Profiler"
+ mode="profile">
+ </contextLabel></contextualLaunch>
+ <configurationType
+ id="org.maemo.esbox.analysis.launch.cpp.LtraceLocalLaunchType">
+ </configurationType>
+ </shortcut>
+
+ <shortcut
+ class="org.maemo.esbox.internal.analysis.launch.ESboxCppLtraceRemoteLaunchShortcut"
+ icon="icons/full/obj16/ltrace.gif"
+ id="maemoLtraceShortcut"
+ label="Remote Ltrace Profiler"
+ modes="profile">
+ <contextualLaunch>
+ <enablement>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate>
+ <and>
+ <test
+ forcePluginActivation="true"
+ property="org.maemo.mica.common.hasNature"
+ value="org.maemo.esbox.cpp.project.cppNature"/>
+
+ <test
+ forcePluginActivation="true"
+ property="org.maemo.mica.maemosdk.isRemoteTarget"/>
+
+ <test
+ forcePluginActivation="true"
+ property="org.maemo.mica.maemosdk.isARMELTarget"/>
+
+ <test
+ forcePluginActivation="true"
+ property="org.maemo.mica.maemosdk.isEmulatorTarget"/>
+ <test
+ forcePluginActivation="true"
+ property="org.maemo.mica.cpp.isCppLaunchable"/>
+
+ </and>
+ </iterate>
+ </with></enablement>
+ <contextLabel
+ label="Remote Ltrace Profiler"
+ mode="profile">
+ </contextLabel></contextualLaunch>
+ <configurationType
+ id="org.maemo.esbox.analysis.launch.cpp.LtraceRemoteLaunchType">
+ </configurationType>
+ </shortcut>
+
</extension>
<!-- Python -->
@@ -161,6 +290,23 @@
name="Local Valgrind Profiler (Python)"
public="true">
</launchConfigurationType>
+
+ <launchConfigurationType
+ delegate="org.maemo.mica.python.launch.analysis.ltrace.PythonLtraceLocalLaunchDelegate"
+ id="org.maemo.esbox.analysis.launch.python.LtraceLocalLaunchType"
+ modes="profile"
+ name="Local Ltrace Profiler (Python)"
+ public="true">
+ </launchConfigurationType>
+
+ <launchConfigurationType
+ delegate="org.maemo.mica.python.launch.analysis.ltrace.PythonLtraceRemoteLaunchDelegate"
+ id="org.maemo.esbox.analysis.launch.python.LtraceRemoteLaunchType"
+ modes="profile"
+ name="Remote Ltrace Profiler (Python)"
+ public="true">
+ </launchConfigurationType>
+
</extension>
<extension
point="org.eclipse.debug.ui.launchConfigurationTypeImages">
@@ -174,7 +320,20 @@
icon="icons/full/obj16/valgrind_local.gif"
id="esboxPythonValgrindLaunchTypeImage">
</launchConfigurationTypeImage>
+
+ <launchConfigurationTypeImage
+ configTypeID="org.maemo.esbox.analysis.launch.python.LtraceLocalLaunchType"
+ icon="icons/full/obj16/ltrace.gif"
+ id="esboxPythonLtraceLocalLaunchTypeImage">
+ </launchConfigurationTypeImage>
+
+ <launchConfigurationTypeImage
+ configTypeID="org.maemo.esbox.analysis.launch.python.LtraceRemoteLaunchType"
+ icon="icons/full/obj16/ltrace.gif"
+ id="esboxPythonLtraceRemoteLaunchTypeImage">
+ </launchConfigurationTypeImage>
</extension>
+
<extension
point="org.eclipse.debug.ui.launchConfigurationTabGroups">
<launchConfigurationTabGroup
@@ -187,6 +346,19 @@
id="org.maemo.esbox.analysis.launch.python.ValgrindLocalLaunchTabGroup"
type="org.maemo.esbox.analysis.launch.python.ValgrindLocalLaunchType">
</launchConfigurationTabGroup>
+
+ <launchConfigurationTabGroup
+ class="org.maemo.esbox.internal.analysis.launch.ESboxPythonLtraceLocalLaunchConfigurationTabGroup"
+ id="org.maemo.esbox.analysis.launch.python.LtraceLocalLaunchTabGroup"
+ type="org.maemo.esbox.analysis.launch.python.LtraceLocalLaunchType">
+ </launchConfigurationTabGroup>
+
+ <launchConfigurationTabGroup
+ class="org.maemo.esbox.internal.analysis.launch.ESboxPythonLtraceRemoteLaunchConfigurationTabGroup"
+ id="org.maemo.esbox.analysis.launch.python.LtraceRemoteLaunchTabGroup"
+ type="org.maemo.esbox.analysis.launch.python.LtraceRemoteLaunchType">
+ </launchConfigurationTabGroup>
+
</extension>
<extension
point="org.eclipse.debug.ui.launchShortcuts">
@@ -278,8 +450,102 @@
<configurationType
id="org.maemo.esbox.analysis.launch.python.OProfileRemoteLaunchType">
</configurationType>
-
</shortcut>
+
+ <shortcut
+ class="org.maemo.esbox.internal.analysis.launch.ESboxPythonLtraceLocalLaunchShortcut"
+ icon="icons/full/obj16/ltrace.gif"
+ id="org.maemo.esbox.analysis.launch.python.LocalLtraceShortcut"
+ label="Local Ltrace Profiler (Python)"
+ modes="profile">
+ <contextualLaunch>
+ <enablement>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate>
+ <and>
+ <test
+ forcePluginActivation="true"
+ property="org.maemo.mica.common.hasNature"
+ value="org.maemo.esbox.python.project.pythonNature"/>
+ <test
+ forcePluginActivation="true"
+ property="org.maemo.mica.maemosdk.isEmulatorTarget"/>
+ <test
+ forcePluginActivation="true"
+ property="org.maemo.mica.python.isPythonLaunchable"/>
+
+ </and>
+ </iterate>
+ </with>
+ </enablement>
+ <contextLabel
+ label="Local Ltrace Python Profiler"
+ mode="profile">
+ </contextLabel>
+ </contextualLaunch>
+ <!-- this maps the shortcut back to the launch configuration type,
+ allowing the Run/Debug Settings UI in the Resource properties view
+ to show associated launch configs -->
+ <configurationType
+ id="org.maemo.esbox.analysis.launch.python.LtraceLocalLaunchType">
+ </configurationType>
+ </shortcut>
+
+
+ <shortcut
+ class="org.maemo.esbox.internal.analysis.launch.ESboxPythonLtraceRemoteLaunchShortcut"
+ icon="icons/full/obj16/ltrace.gif"
+ id="org.maemo.esbox.analysis.launch.python.RemoteLtraceShortcut"
+ label="Remote Ltrace Profiler (Python)"
+ modes="profile">
+ <contextualLaunch>
+ <enablement>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate>
+ <and>
+ <test
+ forcePluginActivation="true"
+ property="org.maemo.mica.common.hasNature"
+ value="org.maemo.esbox.python.project.pythonNature"/>
+ <test
+ forcePluginActivation="true"
+ property="org.maemo.mica.maemosdk.isEmulatorTarget"/>
+ <test
+ forcePluginActivation="true"
+ property="org.maemo.mica.python.isPythonLaunchable"/>
+
+ <test
+ forcePluginActivation="true"
+ property="org.maemo.mica.maemosdk.isRemoteTarget"/>
+
+ <test
+ forcePluginActivation="true"
+ property="org.maemo.mica.maemosdk.isARMELTarget"/>
+
+ </and>
+ </iterate>
+ </with>
+ </enablement>
+ <contextLabel
+ label="Remote Ltrace Python Profiler"
+ mode="profile">
+ </contextLabel>
+ </contextualLaunch>
+ <!-- this maps the shortcut back to the launch configuration type,
+ allowing the Run/Debug Settings UI in the Resource properties view
+ to show associated launch configs -->
+ <configurationType
+ id="org.maemo.esbox.analysis.launch.python.LtraceRemoteLaunchType">
+ </configurationType>
+ </shortcut>
</extension>
</plugin>
Copied: branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxCppLtraceLocalLaunchConfigurationTabGroup.java (from rev 1954, trunk/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxCppLtraceLocalLaunchConfigurationTabGroup.java)
===================================================================
--- branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxCppLtraceLocalLaunchConfigurationTabGroup.java (rev 0)
+++ branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxCppLtraceLocalLaunchConfigurationTabGroup.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Fabrício S Epaminondas (UFCG) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.analysis.launch;
+
+import org.maemo.mica.cpp.launch.analysis.ltrace.AbstractCppLtraceLocalLaunchConfigurationTabGroup;
+import org.maemo.mica.internal.api.cpp.launch.AbstractCppLaunchShortcut;
+
+/**
+ * @author Fabr�cio S Epaminondas (UFCG)
+ *
+ */
+public class ESboxCppLtraceLocalLaunchConfigurationTabGroup extends
+ AbstractCppLtraceLocalLaunchConfigurationTabGroup {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.maemo.mica.cpp.launch.AbstractCppLaunchConfigurationTabGroup#
+ * getLaunchShortcut()
+ */
+ @Override
+ protected AbstractCppLaunchShortcut getLaunchShortcut() {
+ return new ESboxCppLtraceLocalLaunchShortcut();
+ }
+
+}
Copied: branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxCppLtraceLocalLaunchShortcut.java (from rev 1954, trunk/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxCppLtraceLocalLaunchShortcut.java)
===================================================================
--- branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxCppLtraceLocalLaunchShortcut.java (rev 0)
+++ branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxCppLtraceLocalLaunchShortcut.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Fabrício S Epaminondas (UFCG) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.analysis.launch;
+
+import org.eclipse.debug.ui.ILaunchShortcut;
+import org.maemo.mica.cpp.launch.analysis.ltrace.AbstractCppLtraceLocalLaunchShortcut;
+
+/**
+ * @author Fabrício S Epaminondas (UFCG)
+ *
+ */
+public class ESboxCppLtraceLocalLaunchShortcut extends
+ AbstractCppLtraceLocalLaunchShortcut implements ILaunchShortcut {
+
+ public String getLaunchConfigurationType() {
+ return IESboxAnalysisLaunchConstants.CPP_LTRACE_LOCAL_LAUNCH_TYPE;
+ }
+
+}
Copied: branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxCppLtraceRemoteLaunchConfigurationTabGroup.java (from rev 1954, trunk/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxCppLtraceRemoteLaunchConfigurationTabGroup.java)
===================================================================
--- branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxCppLtraceRemoteLaunchConfigurationTabGroup.java (rev 0)
+++ branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxCppLtraceRemoteLaunchConfigurationTabGroup.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Fabrício S Epaminondas (UFCG) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.analysis.launch;
+
+import org.maemo.mica.cpp.launch.analysis.ltrace.AbstractCppLtraceRemoteLaunchConfigurationTabGroup;
+import org.maemo.mica.internal.api.cpp.launch.AbstractCppLaunchShortcut;
+
+/**
+ * @author Fabrício S Epaminondas (UFCG)
+ *
+ */
+public class ESboxCppLtraceRemoteLaunchConfigurationTabGroup extends
+ AbstractCppLtraceRemoteLaunchConfigurationTabGroup{
+
+ /* (non-Javadoc)
+ * @see org.maemo.mica.internal.api.cpp.launch.AbstractCppLaunchConfigurationTabGroup#getLaunchShortcut()
+ */
+ @Override
+ protected AbstractCppLaunchShortcut getLaunchShortcut() {
+ return new ESboxCppLtraceRemoteLaunchShortcut();
+ }
+
+}
Copied: branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxCppLtraceRemoteLaunchShortcut.java (from rev 1954, trunk/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxCppLtraceRemoteLaunchShortcut.java)
===================================================================
--- branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxCppLtraceRemoteLaunchShortcut.java (rev 0)
+++ branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxCppLtraceRemoteLaunchShortcut.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Fabrício S Epaminondas (UFCG) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.analysis.launch;
+
+import org.eclipse.debug.ui.ILaunchShortcut;
+import org.maemo.mica.cpp.launch.analysis.ltrace.AbstractCppLtraceRemoteLaunchShortcut;
+
+/**
+ * @author Fabrício S Epaminondas (UFCG)
+ *
+ */
+public class ESboxCppLtraceRemoteLaunchShortcut extends
+ AbstractCppLtraceRemoteLaunchShortcut implements ILaunchShortcut {
+ public String getLaunchConfigurationType() {
+ return IESboxAnalysisLaunchConstants.CPP_LTRACE_REMOTE_LAUNCH_TYPE;
+ }
+
+}
Copied: branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxPythonLtraceLocalLaunchConfigurationTabGroup.java (from rev 1954, trunk/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxPythonLtraceLocalLaunchConfigurationTabGroup.java)
===================================================================
--- branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxPythonLtraceLocalLaunchConfigurationTabGroup.java (rev 0)
+++ branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxPythonLtraceLocalLaunchConfigurationTabGroup.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Fabrício S Epaminondas (UFCG) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.analysis.launch;
+
+import org.maemo.mica.python.launch.analysis.ltrace.AbstractPythonLtraceLocalLaunchConfigurationTabGroup;
+import org.maemo.mica.python.launch.analysis.ltrace.AbstractPythonLtraceLocalLaunchShortcut;
+
+/**
+ * @author Fabrício S Epaminondas (UFCG)
+ *
+ */
+public class ESboxPythonLtraceLocalLaunchConfigurationTabGroup extends
+ AbstractPythonLtraceLocalLaunchConfigurationTabGroup {
+
+ /* (non-Javadoc)
+ * @see org.maemo.mica.python.launch.analysis.ltrace.AbstractPythonLtraceLocalLaunchConfigurationTabGroup#getLaunchShortcut()
+ */
+ @Override
+ protected AbstractPythonLtraceLocalLaunchShortcut getLaunchShortcut() {
+ return new ESboxPythonLtraceLocalLaunchShortcut();
+ }
+}
Copied: branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxPythonLtraceLocalLaunchShortcut.java (from rev 1954, trunk/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxPythonLtraceLocalLaunchShortcut.java)
===================================================================
--- branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxPythonLtraceLocalLaunchShortcut.java (rev 0)
+++ branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxPythonLtraceLocalLaunchShortcut.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Fabrício S Epaminondas (UFCG) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.analysis.launch;
+
+import org.eclipse.debug.ui.ILaunchShortcut;
+import org.maemo.mica.python.launch.analysis.ltrace.AbstractPythonLtraceLocalLaunchShortcut;
+
+/**
+ * @author Fabrício S Epaminondas (UFCG)
+ *
+ */
+public class ESboxPythonLtraceLocalLaunchShortcut extends
+ AbstractPythonLtraceLocalLaunchShortcut implements ILaunchShortcut {
+
+ /* (non-Javadoc)
+ * @see org.maemo.mica.common.launch.IMicaLaunchShortcut#getLaunchConfigurationType()
+ */
+ public String getLaunchConfigurationType() {
+ return IESboxAnalysisLaunchConstants.PYTHON_LTRACE_LOCAL_LAUNCH_TYPE;
+ }
+
+}
Copied: branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxPythonLtraceRemoteLaunchConfigurationTabGroup.java (from rev 1954, trunk/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxPythonLtraceRemoteLaunchConfigurationTabGroup.java)
===================================================================
--- branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxPythonLtraceRemoteLaunchConfigurationTabGroup.java (rev 0)
+++ branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxPythonLtraceRemoteLaunchConfigurationTabGroup.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Fabrício S Epaminondas (UFCG) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.analysis.launch;
+
+import org.maemo.mica.python.launch.analysis.ltrace.AbstractPythonLtraceRemoteLaunchConfigurationTabGroup;
+import org.maemo.mica.python.launch.analysis.ltrace.AbstractPythonLtraceRemoteLaunchShortcut;
+
+/**
+ * @author Fabrício S Epaminondas (UFCG)
+ *
+ */
+public class ESboxPythonLtraceRemoteLaunchConfigurationTabGroup extends
+ AbstractPythonLtraceRemoteLaunchConfigurationTabGroup{
+
+ /* (non-Javadoc)
+ * @see org.maemo.mica.python.launch.analysis.ltrace.AbstractPythonLtraceRemoteLaunchConfigurationTabGroup#getLaunchShortcut()
+ */
+ @Override
+ protected AbstractPythonLtraceRemoteLaunchShortcut getLaunchShortcut() {
+ return new ESboxPythonLtraceRemoteLaunchShortcut();
+ }
+}
Copied: branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxPythonLtraceRemoteLaunchShortcut.java (from rev 1954, trunk/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxPythonLtraceRemoteLaunchShortcut.java)
===================================================================
--- branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxPythonLtraceRemoteLaunchShortcut.java (rev 0)
+++ branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/ESboxPythonLtraceRemoteLaunchShortcut.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Fabrício S Epaminondas (UFCG) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.analysis.launch;
+
+import org.eclipse.debug.ui.ILaunchShortcut;
+import org.maemo.mica.python.launch.analysis.ltrace.AbstractPythonLtraceRemoteLaunchShortcut;
+
+/**
+ * @author Fabrício S Epaminondas (UFCG)
+ *
+ */
+public class ESboxPythonLtraceRemoteLaunchShortcut extends
+ AbstractPythonLtraceRemoteLaunchShortcut implements ILaunchShortcut {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.maemo.mica.common.launch.IMicaLaunchShortcut#getLaunchConfigurationType
+ * ()
+ */
+ public String getLaunchConfigurationType() {
+ return IESboxAnalysisLaunchConstants.PYTHON_LTRACE_REMOTE_LAUNCH_TYPE;
+ }
+
+}
Modified: branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/IESboxAnalysisLaunchConstants.java
===================================================================
--- branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/IESboxAnalysisLaunchConstants.java 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.launch.analysis/src/org/maemo/esbox/internal/analysis/launch/IESboxAnalysisLaunchConstants.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -20,8 +20,11 @@
String CPP_OPROFILE_REMOTE_LAUNCH_TYPE = Activator.PLUGIN_ID + ".cpp.OProfileRemoteLaunchType";
String CPP_VALGRIND_LOCAL_LAUNCH_TYPE = Activator.PLUGIN_ID + ".cpp.ValgrindLocalLaunchType";
+ String CPP_LTRACE_LOCAL_LAUNCH_TYPE = Activator.PLUGIN_ID + ".cpp.LtraceLocalLaunchType";
+ String CPP_LTRACE_REMOTE_LAUNCH_TYPE = Activator.PLUGIN_ID + ".cpp.LtraceRemoteLaunchType";
String PYTHON_OPROFILE_REMOTE_LAUNCH_TYPE = Activator.PLUGIN_ID + ".python.OProfileRemoteLaunchType";
String PYTHON_VALGRIND_LOCAL_LAUNCH_TYPE = Activator.PLUGIN_ID + ".python.ValgrindLocalLaunchType";
-
+ String PYTHON_LTRACE_LOCAL_LAUNCH_TYPE = Activator.PLUGIN_ID + ".python.LtraceLocalLaunchType";
+ String PYTHON_LTRACE_REMOTE_LAUNCH_TYPE = Activator.PLUGIN_ID + ".python.LtraceRemoteLaunchType";
}
Modified: branches/work_Raul/org.maemo.esbox.maemosdk.core/conf/maemo_prefs.xml
===================================================================
--- branches/work_Raul/org.maemo.esbox.maemosdk.core/conf/maemo_prefs.xml 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.maemosdk.core/conf/maemo_prefs.xml 2009-08-11 00:04:04 UTC (rev 1955)
@@ -8,7 +8,7 @@
<!-- others commands -->
<entry key="DISPLAY_X_COMMAND_UNIX">Xephyr ${DISPLAY} -host-cursor -dpi 96 -ac -screen ${RESOLUTION} ${PLATFORM_PARAMETERS}</entry>
<entry key="DISPLAY_X_COMMAND_OSX">Xephyr ${DISPLAY} -host-cursor -dpi 96 -ac -screen ${RESOLUTION} ${PLATFORM_PARAMETERS}</entry>
- <entry key="DISPLAY_X_COMMAND_WIN32">c:/cygwin/usr/X11R6/bin/Xwin ${DISPLAY} -lesspointer -swcursor -dpi 96 -ac -screen 0 ${RESOLUTION} ${PLATFORM_PARAMETERS}</entry>
+ <entry key="DISPLAY_X_COMMAND_WIN32">c:/cygwin/bin/Xwin ${DISPLAY} -lesspointer -swcursor -dpi 96 -ac -screen 0 ${RESOLUTION} ${PLATFORM_PARAMETERS}</entry>
<!-- this is initialized dynamically <entry key="DISPLAY_X_COMMAND"></entry> -->
<!-- others commands -->
Modified: branches/work_Raul/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/tools/AfSbInitMaemoLauncherAdapter.java
===================================================================
--- branches/work_Raul/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/tools/AfSbInitMaemoLauncherAdapter.java 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/tools/AfSbInitMaemoLauncherAdapter.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -15,14 +15,21 @@
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.console.MessageConsole;
+import org.maemo.esbox.internal.maemosdk.core.Activator;
import org.maemo.esbox.maemosdk.core.MaemoEnvironmentUtils;
import org.maemo.esbox.maemosdk.core.MaemoPreferenceConstants;
import org.maemo.mica.common.core.MicaException;
@@ -40,15 +47,22 @@
import org.maemo.mica.common.core.process.ProcessLauncherUtils;
import org.maemo.mica.common.core.process.StreamLineMonitorAdapter;
import org.maemo.mica.common.core.sdk.ISDKTarget;
+import org.maemo.mica.maemosdk.core.IMaemoSDKTarget;
+import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils;
+
/**
* Launch the Maemo AF using the "af-sb-init.sh" script.
* @author baranov
*
*/
public class AfSbInitMaemoLauncherAdapter implements IMaemoLauncherAdapter{
+ private static final QualifiedName WARN_ARMEL_TARGET_EXECUTION = new QualifiedName(
+ Activator.PLUGIN_ID, "WARN_ARMEL_TARGET_EXECUTION");
+
+ private static final String MAEMO_LAUNCHER_APP = "maemo-launcher";
+ private static final String HILDON_DESKTOP_APP = "hildon-desktop";
- private static final String MAEMO_LAUNCHER_APP = "maemo-launcher";
private final ISDKTarget target;
private final MaemoCommand command;
@@ -60,6 +74,44 @@
this.command = new MaemoCommand(target);
}
+ private void warnIfArmelTarget(final Shell shell) {
+ final String msg = "You are launching an application under an emulated ARMEL target.\n\n"
+ + "This is a one-time warning that the QEMU emulator has some limitations "
+ + "in system call support, multithreading support, and instruction set emulation "
+ + "which may trigger unexpected bugs in otherwise correct programs.\n\n"
+ + "We recommend using an X86 target for normal development activities.";
+
+ if (target.getArchitecture().equals(
+ IMaemoSDKTarget.ARCHITECTURE_ARMEL)) {
+
+ Boolean oneTimeWarn = null;
+ IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
+ try {
+ oneTimeWarn = (Boolean) workspaceRoot
+ .getSessionProperty(WARN_ARMEL_TARGET_EXECUTION);
+ } catch (CoreException e1) {
+ Activator.getErrorLogger().logError(null, e1);
+ }
+
+ if(oneTimeWarn != null && !oneTimeWarn.booleanValue())
+ return;
+
+ try {
+ workspaceRoot.setSessionProperty(WARN_ARMEL_TARGET_EXECUTION, Boolean.FALSE);
+ } catch (CoreException e1) {
+ Activator.getErrorLogger().logError(null, e1);
+ }
+
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ MessageDialog.openWarning(shell, "Warning", msg);
+ }
+ });
+ }
+
+ }
+
+
/* (non-Javadoc)
* @see org.maemo.esbox.internal.api.maemosdk.core.tools.IMaemoLauncherAdapter#killMaemo()
*/
@@ -92,22 +144,18 @@
}
/* (non-Javadoc)
- * <p>
- * This kills maemo if X is not running, since maemo may be left hanging is
- * X is killed.
* @see org.maemo.esbox.internal.api.maemosdk.core.tools.IMaemoLauncherAdapter#restartMaemo()
*/
public void restartMaemo(IProgressMonitor monitor) throws MicaException {
if (monitor == null)
monitor = new NullProgressMonitor();
monitor.beginTask("", 10);
- if (!XLauncher.getInstance().isXServerStarted(target)) {
- killMaemo();
- XLauncher.getInstance().startXIfNeeded(target, new SubProgressMonitor(monitor, 1));
- if (monitor.isCanceled())
- return;
- }
- command.restartMaemoCommand(new SubProgressMonitor(monitor, 9));
+
+ ensureCorrectXRunning(new SubProgressMonitor(monitor, 1));
+ if (monitor.isCanceled())
+ return;
+ command.performCommand(MaemoPreferenceConstants.MAEMO_RESTART_ACTION,
+ new SubProgressMonitor(monitor, 9));
monitor.done();
}
@@ -117,21 +165,51 @@
public void startMaemo(IProgressMonitor monitor) throws MicaException {
if (monitor == null)
monitor = new NullProgressMonitor();
- monitor.beginTask("", IProgressMonitor.UNKNOWN);
- XLauncher.getInstance().startXIfNeeded(target, new SubProgressMonitor(monitor, 1));
+ monitor.beginTask("", 10);
+
+ ensureCorrectXRunning(new SubProgressMonitor(monitor, 1));
if (monitor.isCanceled())
return;
- if (XLauncher.getInstance().isXServerStarted(target)) {
- command.startMaemoCommand(new SubProgressMonitor(monitor, 9));
- }
+
+ Shell shell = WorkbenchUtils.getSafeShell();
+ warnIfArmelTarget(shell);
+
+ command.performCommand(MaemoPreferenceConstants.MAEMO_START_ACTION,
+ new SubProgressMonitor(monitor, 9));
monitor.done();
}
+ /**
+ * @param subProgressMonitor
+ * @throws MicaException
+ */
+ private void ensureCorrectXRunning(IProgressMonitor monitor) throws MicaException {
+ if (!XLauncher.getInstance().isCorrectXServerRunning(target)) {
+ // usability: if X is not running, be sure any Maemo environment in that
+ // server is also killed, or else if the user tries to restart
+ // the Maemo AF, it will still appear to be running for a while
+ // until all the processes die from the X server socket timeout.
+ killMaemo();
+ XLauncher.getInstance().startXIfNeeded(target, monitor);
+ }
+ }
+
/* (non-Javadoc)
* @see org.maemo.esbox.internal.api.maemosdk.core.tools.IMaemoLauncherAdapter#stopMaemo()
*/
public void stopMaemo(IProgressMonitor monitor) throws MicaException {
- command.stopMaemoCommand(monitor);
+ if (monitor == null)
+ monitor = new NullProgressMonitor();
+ monitor.beginTask("", 10);
+
+ command.performCommand(MaemoPreferenceConstants.MAEMO_STOP_ACTION,
+ new SubProgressMonitor(monitor, 9));
+ try {
+ XLauncher.getInstance().stopX(target, new SubProgressMonitor(monitor, 1));
+ } catch (MicaException e) {
+ // ignore
+ }
+ monitor.done();
}
/* (non-Javadoc)
@@ -152,7 +230,8 @@
List<IProcess> runningProcesses = machine.getProcessLister()
.getProcesses(
new ProcessFilterCmdLineRegexp(".*/"
- + MAEMO_LAUNCHER_APP + "\\s+.*"));
+ + "(" + MAEMO_LAUNCHER_APP +
+ "|" + HILDON_DESKTOP_APP + ")\\b"));
return runningProcesses;
}
@@ -164,6 +243,11 @@
this.sdkTarget = sdkTarget;
}
+ public void performCommand(String command, IProgressMonitor monitor) throws MicaException {
+ List<String> params = getParamList(command);
+ performCommand(params, monitor);
+ }
+
private void performCommand(List<String> params, final IProgressMonitor monitor) throws MicaException {
String maemoCommand = sdkTarget.getPreferenceValue(
MaemoPreferenceConstants.MAEMO_COMMAND);
@@ -247,23 +331,6 @@
}
- public void startMaemoCommand(IProgressMonitor monitor) throws MicaException {
- List<String> params = getParamList(MaemoPreferenceConstants.MAEMO_START_ACTION);
-
- performCommand(params, monitor);
- }
-
- public void stopMaemoCommand(IProgressMonitor monitor) throws MicaException {
- List<String> params = getParamList(MaemoPreferenceConstants.MAEMO_STOP_ACTION);
- performCommand(params, monitor);
- }
-
- public void restartMaemoCommand(IProgressMonitor monitor)
- throws MicaException {
- List<String> params = getParamList(MaemoPreferenceConstants.MAEMO_RESTART_ACTION);
- performCommand(params, monitor);
- }
-
private List<String> getParamList(String key) {
List<String> params = new ArrayList<String>();
params.add(sdkTarget.getPreferenceValue(key));
Modified: branches/work_Raul/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/tools/IMaemoLauncherAdapter.java
===================================================================
--- branches/work_Raul/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/tools/IMaemoLauncherAdapter.java 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/tools/IMaemoLauncherAdapter.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -15,7 +15,7 @@
import org.maemo.mica.common.core.MicaException;
/**
- * This adapter on ISDKTarget allows an SDK target to control how the maemo emulation
+ * This adapter on ISDKTarget allows an SDK target to control how the Maemo emulation
* environment is controlled.
* @author baranov
*
@@ -23,44 +23,51 @@
public interface IMaemoLauncherAdapter {
/**
- * Start maemo if it's not running. This runs asynchronously.
+ * Start Maemo AF, and X if needed. This runs asynchronously.
* @param monitor
* @param sdkTarget
*
* @throws MicaException
* if already running or cannot be started
*/
- public abstract void startMaemo(IProgressMonitor monitor) throws MicaException;
+ void startMaemo(IProgressMonitor monitor) throws MicaException;
/**
- * Stop maemo if it's running. This runs asynchronously.
+ * Stop Maemo AF and X. This runs asynchronously.
* @param monitor
* @param sdkTarget
*
* @throws MicaException
* if not running or cannot be stopped
*/
- public abstract void stopMaemo(IProgressMonitor monitor) throws MicaException;
+ void stopMaemo(IProgressMonitor monitor) throws MicaException;
/**
- * Restart maemo. This runs asynchronously.
+ * Restart Maemo and X. This runs asynchronously.
* @param monitor
* @param sdkTarget
*
* @throws MicaException
* if cannot be restarted
*/
- public abstract void restartMaemo(IProgressMonitor monitor)
+ void restartMaemo(IProgressMonitor monitor)
throws MicaException;
/**
- * Kill maemo by forcibly killing instances of the launcher left behind
+ * Kill maemo by forcibly killing instances of the launcher left behind.
+ * This is a lower-level operation that will not kill X.
*
* @param sdkTarget
* @throws MicaException
*/
- public abstract void killMaemo() throws MicaException;
+ void killMaemo() throws MicaException;
- public abstract boolean isMaemoRunning() throws MicaException;
+ /**
+ * Tell whether the Maemo AF is properly running:
+ * X is running and Maemo AF key processes are running.
+ * @return
+ * @throws MicaException if cannot detect
+ */
+ boolean isMaemoRunning() throws MicaException;
}
\ No newline at end of file
Modified: branches/work_Raul/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/tools/MaemoScriptLauncher.java
===================================================================
--- branches/work_Raul/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/tools/MaemoScriptLauncher.java 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/tools/MaemoScriptLauncher.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -13,31 +13,22 @@
package org.maemo.esbox.internal.api.maemosdk.core.tools;
-import java.io.IOException;
-import java.util.List;
-import java.util.regex.Pattern;
-
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.core.runtime.jobs.Job;
import org.maemo.esbox.internal.maemosdk.core.Activator;
import org.maemo.mica.common.core.MicaException;
-import org.maemo.mica.common.core.machine.IMachine;
-import org.maemo.mica.common.core.machine.IProcess;
-import org.maemo.mica.common.core.machine.ProcessFilterCmdLineRegexp;
+import org.maemo.mica.common.core.preferences.CorePreferenceManager;
import org.maemo.mica.common.core.sdk.ISDKTarget;
/**
*/
public class MaemoScriptLauncher {
- private static MaemoScriptLauncher singleton = new MaemoScriptLauncher();
+ private static final MaemoScriptLauncher singleton = new MaemoScriptLauncher();
+ protected ISDKTarget previousTarget;
- /**
- * Constructor
- */
private MaemoScriptLauncher() {
}
@@ -45,41 +36,6 @@
return singleton;
}
- public boolean isXServerStarted(ISDKTarget sdkTarget) {
- try {
- return XLauncher.getInstance().isXServerStarted(sdkTarget);
- } catch (MicaException e) {
- Activator.getErrorLogger().logError("Failed to query X status", e);
- return false;
- }
- }
-
- /**
- * Method that starts X server.
- * @param monitor
- */
- public void startX(ISDKTarget sdkTarget, IProgressMonitor monitor) throws MicaException {
- // use the synchronous version
- XLauncher.getInstance().startXIfNeeded(sdkTarget, monitor);
- }
-
- /**
- * Method that stops X server.
- * @param monitor
- */
- public void stopX(ISDKTarget sdkTarget, IProgressMonitor monitor) throws MicaException {
- if (sdkTarget != null) {
- IMaemoLauncherAdapter launcher = (IMaemoLauncherAdapter)sdkTarget.getAdapter(IMaemoLauncherAdapter.class);
-
- if (launcher != null && launcher.isMaemoRunning()) {
- // usability
- //throw new MicaException("Maemo Application Framework is still running. Stop Maemo first.");
- launcher.stopMaemo(new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN));
- }
- }
- XLauncher.getInstance().stopX(sdkTarget, monitor);
- }
-
public boolean isMaemoStarted(ISDKTarget sdkTarget) {
IMaemoLauncherAdapter launcher = (IMaemoLauncherAdapter) sdkTarget
.getAdapter(IMaemoLauncherAdapter.class);
@@ -104,6 +60,7 @@
IMaemoLauncherAdapter launcher = (IMaemoLauncherAdapter) sdkTarget
.getAdapter(IMaemoLauncherAdapter.class);
if (launcher != null) {
+ previousTarget = null;
launcher.stopMaemo(monitor);
} else {
throw new MicaException("I do not know how to stop Maemo AF for " + sdkTarget.getDisplayName());
@@ -118,6 +75,7 @@
IMaemoLauncherAdapter launcher = (IMaemoLauncherAdapter) sdkTarget
.getAdapter(IMaemoLauncherAdapter.class);
if (launcher != null) {
+ previousTarget = sdkTarget;
launcher.startMaemo(monitor);
} else {
throw new MicaException("I do not know how to start Maemo AF for " + sdkTarget.getDisplayName());
@@ -125,58 +83,19 @@
}
/**
- * Restart X and Maemo if it is running.
- * <p>
- * This kills maemo if X is not running, since maemo may be left hanging is
- * X is killed.
+ * Restart Maemo AF (starting if not yet started).
* @param monitor
*/
public void restartMaemo(ISDKTarget sdkTarget, IProgressMonitor monitor) throws MicaException {
IMaemoLauncherAdapter launcher = (IMaemoLauncherAdapter) sdkTarget
.getAdapter(IMaemoLauncherAdapter.class);
if (launcher != null) {
+ previousTarget = sdkTarget;
launcher.restartMaemo(monitor);
}
}
/**
- * Kill maemo.
- */
- public void killMaemo(ISDKTarget target) throws MicaException {
- IMaemoLauncherAdapter launcher = (IMaemoLauncherAdapter) target
- .getAdapter(IMaemoLauncherAdapter.class);
- if (launcher != null) {
- launcher.killMaemo();
- }
- }
-
- /**
- * Kill all instances of a given process
- *
- * @param processName
- * executable name
- * @param processLabel
- * the user-visible name for the process
- */
- public void killProcess(IMachine machine, String processName,
- String processLabel) throws MicaException {
- // resolve pure process name
- int slashIndex = processName.lastIndexOf("/");
- if(slashIndex != -1){
- processName = processName.substring(slashIndex+1);
- }
- List<IProcess> processes = machine.getProcessLister().getProcesses(
- new ProcessFilterCmdLineRegexp(".*" + processName + ".*",Pattern.CASE_INSENSITIVE));
- for (IProcess process : processes) {
- try {
- process.terminate();
- } catch (IOException e) {
- throw new MicaException("Error killing " + processName, e);
- }
- }
- }
-
- /**
* Create a job to start Maemo.
*/
public Job createStartMaemoJob(final ISDKTarget target) {
@@ -239,7 +158,6 @@
protected IStatus run(IProgressMonitor monitor) {
try {
MaemoScriptLauncher.getInstance().stopMaemo(target, monitor);
- MaemoScriptLauncher.getInstance().killMaemo(target);
} catch (MicaException e) {
Activator.getErrorLogger().showError(null, e);
}
@@ -272,13 +190,13 @@
/**
* Create a job to stop X.
*/
- public Job createStopXJob(final ISDKTarget target) {
+ public Job createStopXJob() {
Job job = new Job("Stopping X Server") {
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
- MaemoScriptLauncher.getInstance().stopX(target, monitor);
+ MaemoScriptLauncher.getInstance().stopX(monitor);
} catch (MicaException e) {
Activator.getErrorLogger().showError(null, e);
}
@@ -288,4 +206,28 @@
};
return job;
}
+
+ /**
+ * @return
+ */
+ public ISDKTarget getPreviousTarget() {
+ return previousTarget;
+ }
+
+ /**
+ * Stop the X server.
+ * @param monitor
+ */
+ public void stopX(IProgressMonitor monitor) throws MicaException {
+ XLauncher.getInstance().stopX(CorePreferenceManager.getInstance().getPreferenceProvider(), monitor);
+ }
+
+ /**
+ * Start the X server for the target if it is not already running.
+ * @param monitor
+ */
+ public void startX(ISDKTarget sdkTarget, IProgressMonitor monitor) throws MicaException {
+ XLauncher.getInstance().startXIfNeeded(sdkTarget, monitor);
+ previousTarget = sdkTarget;
+ }
}
Modified: branches/work_Raul/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/tools/XLauncher.java
===================================================================
--- branches/work_Raul/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/tools/XLauncher.java 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/maemosdk/core/tools/XLauncher.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -12,7 +12,17 @@
package org.maemo.esbox.internal.api.maemosdk.core.tools;
-import org.eclipse.core.runtime.*;
+import java.io.IOException;
+import java.net.Socket;
+import java.text.MessageFormat;
+import java.util.List;
+import java.util.regex.Pattern;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.core.runtime.jobs.Job;
import org.maemo.esbox.internal.maemosdk.core.Activator;
import org.maemo.esbox.maemosdk.core.MaemoPreferenceConstants;
@@ -20,18 +30,21 @@
import org.maemo.mica.common.core.Policy;
import org.maemo.mica.common.core.env.IEnvironmentModifierBlock;
import org.maemo.mica.common.core.machine.IMachine;
+import org.maemo.mica.common.core.machine.IProcess;
import org.maemo.mica.common.core.machine.MachineRegistry;
import org.maemo.mica.common.core.machine.MachineUtils;
+import org.maemo.mica.common.core.machine.ProcessFilterCmdLineRegexp;
import org.maemo.mica.common.core.preferences.CorePreferenceManager;
import org.maemo.mica.common.core.preferences.IPreferenceProvider;
-import org.maemo.mica.common.core.process.*;
+import org.maemo.mica.common.core.process.CommandLineArguments;
+import org.maemo.mica.common.core.process.IProcessLauncher;
+import org.maemo.mica.common.core.process.IProcessLauncherFactory;
+import org.maemo.mica.common.core.process.IProcessMonitor;
+import org.maemo.mica.common.core.process.ProcessLauncherParameters;
+import org.maemo.mica.common.core.process.ProcessLauncherUtils;
import org.maemo.mica.common.core.sdk.ISDKTarget;
import org.maemo.mica.maemosdk.core.IMaemoSDKPlatform;
-import java.net.Socket;
-import java.text.MessageFormat;
-import java.util.List;
-
/**
* This class maintains knowledge about whether the X server is running in the
* host, and controls access to starting, stopping, and querying status.
@@ -131,14 +144,14 @@
}
}
- private static XLauncher instance;
+ private static final XLauncher instance = new XLauncher();
private XLaunchingJob launchingXJob;
- public synchronized static XLauncher getInstance() {
- if (instance == null) {
- instance = new XLauncher();
- }
+ private List<String> previousCommandLine;
+ private String previousDisplay;
+
+ public static XLauncher getInstance() {
return instance;
}
@@ -189,11 +202,12 @@
}
/**
- * Test whether the X server is started by testing a connection to the
- * server.
+ * Test whether the X server is started and is compatible with
+ * the current settings.
*
* @param prefProvider
- * @return
+ * @return true if running
+ * @throws MicaException if X server display variable is invalid
*/
public boolean isXServerStarted(IPreferenceProvider prefProvider)
throws MicaException {
@@ -203,7 +217,77 @@
return testXConnection(getDisplayValue(prefProvider));
}
- /** Be nice and start X if needed before starting/restarting maemo
+ /**
+ * Test whether the X server is running with the same command line
+ * as before.
+ *
+ * @param prefProvider
+ * @return true if running
+ * @throws MicaException if X server display variable is invalid
+ */
+ public boolean isXServerCompatible(IPreferenceProvider prefProvider)
+ throws MicaException {
+ if (prefProvider == null)
+ prefProvider = CorePreferenceManager.getInstance().getPreferenceProvider();
+
+ // only test if we're making a server for the same display as before
+ String newDisplay = getDisplayValue(prefProvider);
+ if (previousDisplay != null && !newDisplay.equals(previousDisplay))
+ return true;
+
+ List<String> newCommandLine = getDisplayXServerCommand(prefProvider);
+ if (previousCommandLine != null) {
+ // Check if processes match, but ignore full executable path and only check process names.
+ return previousCommandLine.size() >= 1 && previousCommandLine.size() == newCommandLine.size() &&
+ newCommandLine.subList(1, newCommandLine.size()).equals(
+ previousCommandLine.subList(1, previousCommandLine.size()))
+ && getSimpleProcessName(previousCommandLine.get(0)).equals(
+ getSimpleProcessName(newCommandLine.get(0)));
+ }
+
+ // we didn't launch it....
+ if (!newCommandLine.isEmpty()) {
+ IProcess[] processes = getMatchingXProcesses(newCommandLine.get(0));
+ if (processes.length > 0) {
+ boolean realCmdLinesAvailable = false;
+ for (IProcess process : processes) {
+ List<String> processCmdLine = CommandLineArguments.createFromCommandLine(process.getCommandLine());
+ if (processCmdLine.size() > 1) {
+ realCmdLinesAvailable = true;
+ // note: the argv[0] executable may now have a path
+ if (processCmdLine.subList(1, processCmdLine.size()).equals(
+ newCommandLine.subList(1, newCommandLine.size()))) {
+ return true;
+ }
+ }
+ }
+ if (realCmdLinesAvailable) {
+ // no exact matches
+ return false;
+ }
+ // probably on Windows, so assume the X server is ours
+ return true;
+ }
+ }
+
+ // no X server configured or no match
+ return false;
+ }
+
+ /**
+ * Tell if the X server is running, and if it is, whether it's the
+ * one we want to run.
+ * @param prefProvider
+ * @return flag true if server is running and compatible
+ * @throws MicaException if bad settings
+ */
+ public boolean isCorrectXServerRunning(IPreferenceProvider prefProvider) throws MicaException {
+ return isXServerStarted(prefProvider) && isXServerCompatible(prefProvider);
+ }
+
+ /**
+ * Start X if it is not running, or if we know it was previously launched with
+ * a different command line.
* */
public void startXIfNeeded(IPreferenceProvider prefProvider, IProgressMonitor monitor)
throws MicaException {
@@ -214,8 +298,23 @@
monitor = new NullProgressMonitor();
monitor.beginTask("", 3);
+
+ // if already starting, wait...
waitForXLaunch(new SubProgressMonitor(monitor, 1));
- if (!isXServerStarted(prefProvider)) {
+
+ // start X if it's not running or if the arguments have changed
+ boolean serverStarted = isXServerStarted(prefProvider);
+ boolean serverCompatible = isXServerCompatible(prefProvider);
+
+ if (!serverStarted || !serverCompatible) {
+ if (serverStarted && !serverCompatible) {
+ // stop an incompatible server
+ try {
+ stopX(prefProvider, new SubProgressMonitor(monitor, 0));
+ } catch (MicaException e) {
+ // ignore
+ }
+ }
startX(prefProvider, new SubProgressMonitor(monitor, 1));
waitForXLaunch(new SubProgressMonitor(monitor, 1));
}
@@ -270,12 +369,12 @@
final IPreferenceProvider prefProvider = prefProvider_;
- String viewer = getDisplayXServerCommand(prefProvider);
+ List<String> cmdLine = getDisplayXServerCommand(prefProvider);
final String display = getDisplayValue(prefProvider);
+
+ previousCommandLine = cmdLine;
+ previousDisplay = display;
- List<String> cmdLine = CommandLineArguments
- .createFromCommandLine(viewer);
-
if (cmdLine.size() > 0) {
IMachine localMachine = MachineRegistry.getInstance()
@@ -298,7 +397,7 @@
IProcessLauncher processLauncher = factory.createProcessLauncher(
params);
ProcessLauncherUtils.queueConsoleMonitor(processLauncher,
- true, null, "Starting X Server");
+ true, prefProvider instanceof ISDKTarget ? (ISDKTarget) prefProvider : null, "Starting X Server");
processLauncher.createProcess(null);
IProcessMonitor procMon = processLauncher.createProcessMonitor();
@@ -310,11 +409,17 @@
}
} else {
Activator.getErrorLogger().logAndShowError(
- "No X server configured in ESbox preferences", null);
+ "No X server configured in X Server preferences", null);
}
}
+ /**
+ * Stop X synchronously.
+ * @param prefProvider
+ * @param monitor
+ * @throws MicaException if server is not running or could not be killed.
+ */
public void stopX(IPreferenceProvider prefProvider, IProgressMonitor monitor) throws MicaException {
if (prefProvider == null)
prefProvider = CorePreferenceManager.getInstance().getPreferenceProvider();
@@ -328,24 +433,45 @@
throw new MicaException(
"X Server was not started. Start X Server first");
- String server = getDisplayXServerCommand(prefProvider);
+ List<String> cmdLine = getDisplayXServerCommand(prefProvider);
- List<String> cmdLine = CommandLineArguments
- .createFromCommandLine(server);
-
+ previousCommandLine = null;
+ previousDisplay = null;
+
// find server to kill
- if (cmdLine.size() > 0) {
- IMachine localMachine = MachineRegistry.getInstance()
- .getLocalMachine();
- if (localMachine == null)
- throw new MicaException("Cannot find local machine");
+
+ if (cmdLine.isEmpty()) {
+ return;
+ }
- MaemoScriptLauncher.getInstance().killProcess(localMachine,
- cmdLine.get(0), "X Server");
+ String executable = getSimpleProcessName(cmdLine.get(0));
+ String diplay = getDisplayValue(prefProvider);
+
+ IProcess[] processes = MachineRegistry.getInstance().getLocalMachine().
+ getProcessLister().getProcesses(new ProcessFilterCmdLineRegexp(
+ ".*" + Pattern.quote(executable) + ".*\\s+" +
+ Pattern.quote(diplay) + "(?:\\s.*|$)",
+ Pattern.CASE_INSENSITIVE )).toArray(new IProcess[]{});
+
+ if (processes.length <= 0) {
+ processes = getMatchingXProcesses(executable);
}
+
+ for (IProcess process : processes) {
+ try {
+ process.terminate();
+ } catch (IOException e) {
+ throw new MicaException("Error killing " + executable, e);
+ }
+ }
}
- private String getDisplayXServerCommand(IPreferenceProvider prefProvider) {
+ /**
+ * Get the command line for launching the X server.
+ * @param prefProvider
+ * @return
+ */
+ private List<String> getDisplayXServerCommand(IPreferenceProvider prefProvider) {
String command = prefProvider
.getPreferenceValue(MaemoPreferenceConstants.DISPLAY_X_COMMAND);
@@ -359,7 +485,8 @@
//Defining specific platform RESOLUTION.
command = command.replaceAll("\\$\\{RESOLUTION\\}",
getResolutionParameter(prefProvider));
- return command;
+
+ return CommandLineArguments.createFromCommandLine(command);
}
/**
@@ -371,7 +498,7 @@
* {@link ISDKTarget} the default value is returned.
* @return the value for variable {PLATFORM_PARAMETERS}.
*/
- public String getPlatformParameters(IPreferenceProvider prefProvider) {
+ private String getPlatformParameters(IPreferenceProvider prefProvider) {
ISDKTarget sdkTarget = null;
if (prefProvider instanceof ISDKTarget)
sdkTarget = (ISDKTarget) prefProvider;
@@ -393,7 +520,7 @@
* {@link ISDKTarget} the default value is returned.
* @return the value for variable {RESOLUTION}.
*/
- public String getResolutionParameter(IPreferenceProvider prefProvider) {
+ private String getResolutionParameter(IPreferenceProvider prefProvider) {
ISDKTarget sdkTarget = null;
if (prefProvider instanceof ISDKTarget)
sdkTarget = (ISDKTarget) prefProvider;
@@ -413,4 +540,32 @@
else
return System.getenv("DISPLAY"); // get from system
}
+
+ /**
+ * Get pure process name from process name string.
+ * Example '/bin/sh' returns 'sh' and 'sh' returns 'sh'.
+ *
+ * @param processName the process name
+ * @return the pure process name
+ */
+ private static String getSimpleProcessName(String processName) {
+ // resolve pure process name
+ int slashIndex = processName.lastIndexOf("/");
+ if(slashIndex != -1){
+ processName = processName.substring(slashIndex+1);
+ }
+ return processName;
+ }
+
+ /**
+ * @param machine
+ * @return
+ */
+ private IProcess[] getMatchingXProcesses(String processName) {
+ List<IProcess> processes = MachineRegistry.getInstance().getLocalMachine().
+ getProcessLister().getProcesses(
+ new ProcessFilterCmdLineRegexp(".*" + Pattern.quote(getSimpleProcessName(processName)) + ".*",Pattern.CASE_INSENSITIVE));
+ return (IProcess[]) processes.toArray(new IProcess[processes.size()]);
+ }
+
}
\ No newline at end of file
Modified: branches/work_Raul/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/api/maemosdk/ui/preferences/BuildMachinePreferencePage.java
===================================================================
--- branches/work_Raul/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/api/maemosdk/ui/preferences/BuildMachinePreferencePage.java 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/api/maemosdk/ui/preferences/BuildMachinePreferencePage.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -23,7 +23,6 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.preference.PreferencePage;
@@ -57,6 +56,7 @@
import org.maemo.mica.common.core.machine.IMachine;
import org.maemo.mica.common.core.machine.MachineManager;
import org.maemo.mica.common.core.machine.MachineRegistry;
+import org.maemo.mica.common.ui.dialogs.DialogUtils;
import org.maemo.mica.common.ui.dialogs.StyledTextProgressDialog;
import org.maemo.mica.internal.api.common.core.sdk.SDKManagerInternal;
import org.maemo.mica.internal.api.common.ui.utils.PixelConverter;
@@ -420,14 +420,27 @@
}
if (vmRunning && selectedMachine != null) {
- boolean doit = MessageDialog.openQuestion(getShell(),
+ boolean doit;
+ String message;
+ if (selectedMachine.getName().equals(current.getName())) {
+ // the same machine, different message
+ message = MessageFormat.format(
+ "You have changed virtual machine settings for ''{0}''. The virtual machine is still running, however.\n \n"+
+ "If you changed disk images or the executable, the machine should be shut down and restarted.\n \n"+
+ "Should I do this now?",
+ selectedMachine.getName());
+ } else {
+ message = MessageFormat.format(
+ "You have changed virtual machines. The previous machine ''{0}'' is still running, however.\n \n"+
+ "That machine may share files or other resources with ''{1}'' and should probably not run at the same time.\n \n"+
+ "Should I do this now?",
+ current.getName(),
+ selectedMachine.getName());
+ }
+ doit = DialogUtils.showQuestionDialog(getShell(),
"Shut down?",
- MessageFormat.format(
- "The previous machine ''{0}'' seems to be active and may have files open that will conflict with the new virtual machine.\n \n"+
- "Should I shut it down before starting ''{1}''?\n \n"+
- "(If you only changed network settings and ran ''dhclient3'', answer ''No''.)",
- current.getName(),
- selectedMachine.getName()));
+ message,
+ "Shut down", "Leave running");
if (doit) {
ProgressMonitorDialog dialog = new ProgressMonitorDialog(getShell());
try {
Modified: branches/work_Raul/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/actions/BaseEmulatorStartStopRestartControlAction.java
===================================================================
--- branches/work_Raul/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/actions/BaseEmulatorStartStopRestartControlAction.java 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/actions/BaseEmulatorStartStopRestartControlAction.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -32,9 +32,14 @@
import org.maemo.mica.common.core.sdk.ISDKTarget;
import org.maemo.mica.common.project.core.ProjectManager;
import org.maemo.mica.common.ui.dialogs.SelectSDKTargetDialog;
+import org.maemo.mica.internal.api.common.core.sdk.ISingleCurrentTargetOnlySDK;
/**
- * Basic action for a toolbar menu action.
+ * Basic support for a toolbar menu action that supports Start/Stop
+ * (and possibly Restart) and lets the user select an ISDKTarget
+ * in which to perform the action. The previously selected
+ * target -- or the currently active target for that target's SDK
+ * -- is used as a default if possible.
* @author eswartz
*
*/
@@ -49,7 +54,6 @@
protected abstract void startClicked();
protected IProject selectedProject;
- protected ISDKTarget previousTarget;
/**
*
@@ -80,7 +84,6 @@
mi.setImage(UIActivator.getImageDescriptor("./icons/full/etool16/start_co.gif").createImage());
mi.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event event) {
- previousTarget = null;
startClicked();
}
@@ -102,6 +105,8 @@
mi.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event event) {
stopClicked();
+ // ask next time
+ //previousTarget = null;
}
});
@@ -128,7 +133,7 @@
IResource resource = WorkspaceUtils.getResourceFromSelection(selection);
- // XXX: don't ask for ISDKTarget here since it can hang
+ // don't ask for ISDKTarget here since it can hang (UI thread)
this.selectedProject = null;
if (resource != null && resource.getProject().isOpen()) {
this.selectedProject = resource.getProject();
@@ -137,15 +142,10 @@
action.setEnabled(true);
}
- protected ISDKTarget getSDKTarget(final String prompt) {
-
- // XXX FIXME: the previous target may be different
- // if the environment was launched from MaemoExecutionEnvironmentAdapter
+ protected ISDKTarget getSDKTarget(final String prompt, ISDKTarget previousTarget) {
ISDKTarget sdkTarget = previousTarget;
- if (sdkTarget != null)
- return sdkTarget;
-
+ // figure out a viable target from the context
if (selectedProject != null) {
try {
ISDKTarget theSdkTarget = ProjectManager.getInstance().getSDKTarget(selectedProject);
@@ -169,8 +169,41 @@
});
- previousTarget = selected[0];
+ if (selected[0] != null)
+ previousTarget = selected[0];
return selected[0];
}
+ /**
+ * Get the ISDKTarget that is current, for the purpose of restarting
+ * or stopping. This might be the one we used when starting, or
+ * the user may have manually switched targets and launched in
+ * the meantime. If we can't tell, ask.
+ * @return ISDKTarget or <code>null</code> if we asked and the user canceled
+ * or we cannot tell
+ */
+ protected ISDKTarget getCurrentSDKTarget(ISDKTarget previousTarget) {
+ if (previousTarget != null) {
+ if (previousTarget.getSDK() instanceof ISingleCurrentTargetOnlySDK) {
+ try {
+ // the user may have switched targets in the meantime.
+ // If this is the kind of SDK where only one target
+ // is active at a time, use that one instead (Mica #4284)
+ String currentTargetName = ((ISingleCurrentTargetOnlySDK) previousTarget.getSDK()).getCurrentTarget();
+ if (currentTargetName != null) {
+ ISDKTarget currentTarget = previousTarget.getSDK().findSDKTarget(currentTargetName);
+ if (currentTarget != null) {
+ return currentTarget;
+ }
+ }
+ } catch (MicaException e) {
+ // can't be sure... fall through
+ }
+ }
+ return previousTarget;
+ }
+
+ // ask
+ return getSDKTarget("Select the target under which to operate:", previousTarget);
+ }
}
\ No newline at end of file
Modified: branches/work_Raul/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/actions/MaemoDropdownMenuAction.java
===================================================================
--- branches/work_Raul/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/actions/MaemoDropdownMenuAction.java 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/actions/MaemoDropdownMenuAction.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -11,11 +11,14 @@
*******************************************************************************/
package org.maemo.esbox.internal.maemosdk.ui.actions;
+import java.text.MessageFormat;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.dialogs.MessageDialog;
import org.maemo.esbox.internal.api.maemosdk.core.tools.IMaemoLauncherAdapter;
import org.maemo.esbox.internal.api.maemosdk.core.tools.MaemoScriptLauncher;
+import org.maemo.mica.common.core.MicaException;
import org.maemo.mica.common.core.sdk.ISDKTarget;
+import org.maemo.mica.common.ui.dialogs.DialogUtils;
/**
* @author reijula
@@ -29,7 +32,8 @@
public class MaemoDropdownMenuAction extends BaseEmulatorStartStopRestartControlAction {
protected ISDKTarget getSDKTarget() {
- return getSDKTarget("Select an SDK under which to run the Maemo Application Framework:");
+ return getSDKTarget("Select an SDK under which to run the Maemo Application Framework:",
+ MaemoScriptLauncher.getInstance().getPreviousTarget());
}
@@ -39,10 +43,27 @@
if (target == null)
return;
if (MaemoScriptLauncher.getInstance().isMaemoStarted(target)) {
- MessageDialog.openInformation(null,
+ boolean restart = DialogUtils.showQuestionDialog(null,
"Maemo AF is running",
- "The Maemo Application Framework appears to be already running.\n\nIf you do not see it, you may need to restart it or wait for its startup to complete.");
- return;
+ MessageFormat.format(
+ "The Maemo Application Framework appears to be running.\n \n"+
+ "If you do not see it, you may need to restart it or wait for its startup to complete.\n \n"+
+ "Do you want to restart it for {0}?",
+ target.getName()),
+ "Restart", "Cancel");
+ if (!restart)
+ return;
+
+ ISDKTarget killTarget = MaemoScriptLauncher.getInstance().getPreviousTarget();
+ if (killTarget == null)
+ killTarget = target;
+
+ try {
+ MaemoScriptLauncher.getInstance().stopMaemo(killTarget,
+ new NullProgressMonitor());
+ } catch (MicaException e) {
+ // ignore
+ }
}
Job job = MaemoScriptLauncher.getInstance().createStartMaemoJob(target);
job.schedule();
@@ -50,7 +71,7 @@
@Override
protected void restartClicked() {
- ISDKTarget target = getSDKTarget();
+ ISDKTarget target = getCurrentSDKTarget(MaemoScriptLauncher.getInstance().getPreviousTarget());
if (target == null)
return;
Job job = MaemoScriptLauncher.getInstance().createRestartMaemoJob(target);
@@ -59,7 +80,7 @@
@Override
protected void stopClicked() {
- ISDKTarget target = getSDKTarget();
+ ISDKTarget target = getCurrentSDKTarget(MaemoScriptLauncher.getInstance().getPreviousTarget());
if (target == null)
return;
Job job = MaemoScriptLauncher.getInstance().createStopMaemoJob(target);
Modified: branches/work_Raul/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/actions/XDropdownMenuAction.java
===================================================================
--- branches/work_Raul/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/actions/XDropdownMenuAction.java 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/actions/XDropdownMenuAction.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -15,11 +15,15 @@
*/
package org.maemo.esbox.internal.maemosdk.ui.actions;
+import java.text.MessageFormat;
+
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
import org.maemo.esbox.internal.api.maemosdk.core.tools.MaemoScriptLauncher;
+import org.maemo.esbox.internal.api.maemosdk.core.tools.XLauncher;
+import org.maemo.mica.common.core.MicaException;
import org.maemo.mica.common.core.sdk.ISDKTarget;
+import org.maemo.mica.common.ui.dialogs.DialogUtils;
/**
* @author reijula
@@ -32,7 +36,8 @@
public class XDropdownMenuAction extends BaseEmulatorStartStopRestartControlAction {
protected ISDKTarget getSDKTarget() {
- return getSDKTarget("Select an SDK under which to run the X Server:");
+ return getSDKTarget("Select an SDK under which to run the X Server:",
+ MaemoScriptLauncher.getInstance().getPreviousTarget());
}
/* (non-Javadoc)
@@ -50,9 +55,26 @@
ISDKTarget target = getSDKTarget();
if (target == null)
return;
- if (MaemoScriptLauncher.getInstance().isXServerStarted(target)) {
- MessageDialog.openInformation(null, "X Running", "X is still running. Terminate it first if necessary.");
- return;
+ try {
+ if (XLauncher.getInstance().isCorrectXServerRunning(target)) {
+ boolean restart = DialogUtils.showQuestionDialog(null,
+ "X is Running",
+ MessageFormat.format(
+ "The X Server appears to be running.\n \n"+
+ "Do you want to restart it for {0}?",
+ target.getName()),
+ "Restart", "Cancel");
+ if (!restart)
+ return;
+
+ ISDKTarget killTarget = MaemoScriptLauncher.getInstance().getPreviousTarget();
+ if (killTarget == null)
+ killTarget = target;
+
+ XLauncher.getInstance().stopX(killTarget, null);
+ }
+ } catch (MicaException e) {
+ // failed, so definitely not running
}
Job job = MaemoScriptLauncher.getInstance().createStartXJob(target);
@@ -63,10 +85,7 @@
* Stop X
*/
protected void stopClicked() {
- ISDKTarget target = getSDKTarget();
- if (target == null)
- return;
- Job job = MaemoScriptLauncher.getInstance().createStopXJob(target);
+ Job job = MaemoScriptLauncher.getInstance().createStopXJob();
job.schedule();
}
Modified: branches/work_Raul/org.maemo.esbox.product/about.mappings
===================================================================
--- branches/work_Raul/org.maemo.esbox.product/about.mappings 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.product/about.mappings 2009-08-11 00:04:04 UTC (rev 1955)
@@ -7,4 +7,4 @@
# e.g. "0=20020612"
# This value will be added automatically via the build scripts
0=20090211-1700
-1=I20090722
\ No newline at end of file
+1=I20090806
\ No newline at end of file
Modified: branches/work_Raul/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/api/scratchbox/core/execEnv/MaemoExecutionEnvironmentHandler.java
===================================================================
--- branches/work_Raul/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/api/scratchbox/core/execEnv/MaemoExecutionEnvironmentHandler.java 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/api/scratchbox/core/execEnv/MaemoExecutionEnvironmentHandler.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -12,21 +12,20 @@
package org.maemo.esbox.internal.api.scratchbox.core.execEnv;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.maemo.esbox.internal.api.maemosdk.core.tools.MaemoScriptLauncher;
+import org.maemo.esbox.internal.api.maemosdk.core.tools.XLauncher;
import org.maemo.esbox.internal.scratchbox.core.Activator;
import org.maemo.mica.common.core.MicaException;
import org.maemo.mica.common.core.execEnv.IExecutionEnvironmentHandler;
import org.maemo.mica.common.core.sdk.ISDKTarget;
import org.maemo.mica.common.project.core.ProjectManager;
-import org.maemo.mica.maemosdk.core.IMaemoSDKTarget;
+import org.maemo.mica.internal.api.common.core.sdk.ISingleCurrentTargetOnlySDK;
/**
* Environment for Maemo applications
@@ -36,79 +35,60 @@
*/
public class MaemoExecutionEnvironmentHandler implements
IExecutionEnvironmentHandler {
- public static final QualifiedName WARN_ARMEL_TARGET_EXECUTION = new QualifiedName(
- Activator.PLUGIN_ID, "WARN_ARMEL_TARGET_EXECUTION");
-
- public void establishEnvironment(Shell shell, IProject project,
+
+ public void establishEnvironment(final Shell shell, IProject project,
IProgressMonitor monitor)
throws CoreException {
- shouldNotRunArmelTarget(shell, project);
- // see if Maemo is running
- runMaemoIfNeeded(shell, project, monitor);
- }
-
- private void shouldNotRunArmelTarget(final Shell shell, IProject project) {
- final String msg = "You are launching an application under an emulated ARMEL target.\n\n"
- + "This is a one-time warning that the QEMU emulator has some limitations "
- + "in system call support, multithreading support, and instruction set emulation "
- + "which may trigger unexpected bugs in otherwise correct programs.\n\n"
- + "We recommend using an X86 target for normal development activities.";
-
- ISDKTarget sdkTarget;
- IWorkspaceRoot workspaceRoot = project.getWorkspace().getRoot();
- Boolean oneTimeWarn = null;
+ final ISDKTarget sdkTarget;
try {
sdkTarget = ProjectManager.getInstance().getSDKTarget(project);
- if (sdkTarget.getArchitecture().equals(
- IMaemoSDKTarget.ARCHITECTURE_ARMEL)) {
-
- try {
- oneTimeWarn = (Boolean) workspaceRoot
- .getSessionProperty(WARN_ARMEL_TARGET_EXECUTION);
- } catch (CoreException e1) {
- Activator.getErrorLogger().logError(null, e1);
+
+ boolean wrongOneRunning = false;
+ ISDKTarget wrongTarget = null;
+
+ // ensure that the previous target is actually active -- we may otherwise
+ // get a false positive when using a different SB1 target, which will just
+ // kill the emulator anyway.
+ if (sdkTarget.getSDK() instanceof ISingleCurrentTargetOnlySDK) {
+ String currentTarget = ((ISingleCurrentTargetOnlySDK)sdkTarget.getSDK()).getCurrentTarget();
+ if (!sdkTarget.getName().equals(
+ currentTarget)) {
+ wrongTarget = sdkTarget.getSDK().findSDKTarget(currentTarget);
+ wrongOneRunning = true;
}
-
- if(oneTimeWarn != null && !oneTimeWarn.booleanValue())
- return;
-
- try {
- workspaceRoot.setSessionProperty(WARN_ARMEL_TARGET_EXECUTION, Boolean.FALSE);
- } catch (CoreException e1) {
- Activator.getErrorLogger().logError(null, e1);
- }
-
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- MessageDialog.openWarning(shell, "Warning", msg);
- }
- });
}
- } catch (MicaException e) {
- Activator.getErrorLogger().logAndShowError(
- "Error valdating Maemo execution environment", e);
- // don't fail the launch
- }
-
- }
-
- private void runMaemoIfNeeded(final Shell shell, IProject project, IProgressMonitor monitor) {
- final ISDKTarget sdkTarget;
- try {
- sdkTarget = ProjectManager.getInstance().getSDKTarget(project);
- if (!MaemoScriptLauncher.getInstance().isMaemoStarted(sdkTarget)
- || !MaemoScriptLauncher.getInstance().isXServerStarted(sdkTarget)) {
+
+ // See if X is running and it's the one we want. (If it's not running,
+ // any Maemo AF will die soon too.)
+ boolean wrongXRunning = !XLauncher.getInstance().isCorrectXServerRunning(sdkTarget);
+
+ if (wrongOneRunning
+ || !MaemoScriptLauncher.getInstance().isMaemoStarted(sdkTarget)
+ || wrongXRunning) {
final boolean[] doLaunch = { false };
+ final String message =
+ wrongOneRunning ?
+ "The Maemo Application Framework is running for a different target.\n\nThis may or may not be valid for the new application.\n\nSwitch to the new target (" + sdkTarget.getName() + ")?"
+ : "The Maemo Application Framework does not seem to be running.\n\nLaunch it now?";
Display.getDefault().syncExec(new Runnable() {
public void run() {
- doLaunch[0] = MessageDialog.openQuestion(shell, "Launch Maemo?",
- "The Maemo Application Framework does not seem to be running.\n\nLaunch it now?");
+ doLaunch[0] = MessageDialog.openQuestion(shell, "Launch Maemo AF?",
+ message);
}
});
if (doLaunch[0]) {
+ if (wrongOneRunning) {
+ Job stopJob = MaemoScriptLauncher.getInstance().createStopMaemoJob(wrongTarget);
+ stopJob.schedule();
+ try {
+ stopJob.join();
+ } catch (InterruptedException e) {
+ }
+ }
+
Job job = MaemoScriptLauncher.getInstance().createStartMaemoJob(sdkTarget);
job.schedule();
Modified: branches/work_Raul/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/api/scratchbox/core/execEnv/X11ExecutionEnvironmentHandler.java
===================================================================
--- branches/work_Raul/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/api/scratchbox/core/execEnv/X11ExecutionEnvironmentHandler.java 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/api/scratchbox/core/execEnv/X11ExecutionEnvironmentHandler.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -18,6 +18,7 @@
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Shell;
import org.maemo.esbox.internal.api.maemosdk.core.tools.MaemoScriptLauncher;
+import org.maemo.esbox.internal.api.maemosdk.core.tools.XLauncher;
import org.maemo.esbox.internal.scratchbox.core.Activator;
import org.maemo.mica.common.core.JobUtils;
import org.maemo.mica.common.core.MicaException;
@@ -44,13 +45,19 @@
}
boolean serverRunning;
- serverRunning = MaemoScriptLauncher.getInstance().isXServerStarted(sdkTarget);
+ try {
+ serverRunning = XLauncher.getInstance().isCorrectXServerRunning(sdkTarget);
+ } catch (MicaException e) {
+ Activator.getErrorLogger().logAndShowError(
+ "Cannot validate the X server connection", e);
+ return;
+ }
if (!serverRunning) {
if (MessageDialog
.openQuestion(shell, "Launch X Server?",
- "The X server is not running. Would you like to launch it now?")) {
+ "The X server is not running or is running with different parameters.\n\nWould you like to launch it now?")) {
Job job = MaemoScriptLauncher.getInstance().createStartXJob(sdkTarget);
job.schedule();
JobUtils.waitForJob(job, monitor, "Waiting for startup...");
Modified: branches/work_Raul/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/api/scratchbox/core/sdk/AbstractScratchboxSDK.java
===================================================================
--- branches/work_Raul/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/api/scratchbox/core/sdk/AbstractScratchboxSDK.java 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/internal/api/scratchbox/core/sdk/AbstractScratchboxSDK.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -15,7 +15,6 @@
import org.maemo.esbox.internal.api.scratchbox.core.commands.SDKCommandAbstractor;
import org.maemo.esbox.internal.api.scratchbox.core.commands.sbrsh.*;
import org.maemo.esbox.scratchbox.core.sdk.IScratchboxSDK;
-import org.maemo.esbox.scratchbox.core.sdk.IScratchboxSDKTarget;
import org.maemo.mica.common.core.MicaException;
import org.maemo.mica.common.core.env.IEnvironmentModifierBlock;
import org.maemo.mica.common.core.filesystem.IFileSystemAccess;
@@ -151,17 +150,6 @@
* (non-Javadoc)
*
* @see
- * org.maemo.esbox.scratchbox.core.sdk.IScratchboxSDK#getCurrentSDKTarget()
- */
- public IScratchboxSDKTarget getCurrentSDKTarget() throws MicaException {
- String targetName = getCurrentTarget();
- return (IScratchboxSDKTarget) this.findSDKTarget(targetName);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
* org.maemo.esbox.scratchbox.core.sdk.IScratchboxSDK#configureSbrsh(java.
* lang.String, java.lang.String, java.lang.String)
*/
Modified: branches/work_Raul/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/scratchbox/core/sdk/IScratchboxSDK.java
===================================================================
--- branches/work_Raul/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/scratchbox/core/sdk/IScratchboxSDK.java 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.scratchbox.core/src/org/maemo/esbox/scratchbox/core/sdk/IScratchboxSDK.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -61,25 +61,6 @@
public List<String> getTargets() throws MicaException;
/**
- * Return the current target name of the Scratchbox.
- *
- *
- * @return the current target of the Scratchbox.
- * @throws MicaException
- * if some problem related to Scratchbox communication occurs.
- */
- public String getCurrentTarget() throws MicaException;
-
- /**
- * Return the current target of the Scratchbox.
- *
- * @return the current target of Scratchbox.
- * @throws MicaException
- * if some problem related to Scratchbox communication occurs.
- */
- public IScratchboxSDKTarget getCurrentSDKTarget() throws MicaException;
-
- /**
* Create a new target for Scratchbox. An target must have a name, and the
* compiler, devkits and cputransp must be available in Scratchbox.
*
Modified: branches/work_Raul/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/Scratchbox1SDK.java
===================================================================
--- branches/work_Raul/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/Scratchbox1SDK.java 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/core/Scratchbox1SDK.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -22,7 +22,6 @@
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.*;
import org.maemo.esbox.internal.api.maemosdk.core.tools.IMaemoLauncherAdapter;
-import org.maemo.esbox.internal.api.maemosdk.core.tools.MaemoScriptLauncher;
import org.maemo.esbox.internal.api.scratchbox.core.commands.ICommand;
import org.maemo.esbox.internal.api.scratchbox.core.commands.ICommandAbstractor;
import org.maemo.esbox.internal.api.scratchbox.core.sdk.AbstractScratchboxSDK;
@@ -67,6 +66,8 @@
private IPath sdkRoot;
+ private long nextTargetCheck;
+
public Scratchbox1SDK(IMachine machine, IPath installLocation,
IPreferenceProvider prefProvider) {
super(machine, installLocation, IScratchbox1SDK.NAME,
@@ -316,6 +317,15 @@
* @see org.maemo.mica.maemosdk.core.sdk.IScratchboxSDK#getCurrentTarget()
*/
public String getCurrentTarget() throws MicaException {
+ // We can't rely on the cache forever, since the user may be
+ // manually switching things outside. Making the user remember to
+ // refresh the SDK is not the right way to fix this. Just let the
+ // cache entry time out after a while.
+ if (System.currentTimeMillis() >= nextTargetCheck) {
+ getCache().set(CURRENT_TARGET_KEY, (String)null);
+ nextTargetCheck = System.currentTimeMillis() + 30 * 1000;
+ }
+
String currentTarget = (String) getCache().get(CURRENT_TARGET_KEY, String.class);
if (currentTarget != null && getTargets().contains(currentTarget))
return currentTarget;
@@ -443,8 +453,11 @@
IScratchboxSDKTarget currentTarget = null;
try {
- currentTarget = getCurrentSDKTarget();
- } catch (ScratchboxException e) {
+ String currentTargetName = getCurrentTarget();
+ if (currentTargetName != null) {
+ currentTarget = (IScratchboxSDKTarget) findSDKTarget(currentTargetName);
+ }
+ } catch (MicaException e) {
// there may be no target, which is fine
}
@@ -457,18 +470,10 @@
// a target selection may succeed even if X and maemo are
// running... kill them first.
try {
- launcher.killMaemo();
+ launcher.stopMaemo(new NullProgressMonitor());
} catch (MicaException e2) {
// ignore
}
-
- // We kill X too because some processes won't be killed by
- // maemo-launcher.
- try {
- MaemoScriptLauncher.getInstance().stopX(currentTarget, new NullProgressMonitor());
- } catch (MicaException e) {
- // ignore
- }
}
}
@@ -880,9 +885,10 @@
new IStreamMonitor[] { unmountErrorSniffer },
multiStatus, monitor);
if (unmountErrorSniffer.unmountFailed()) {
- reporter.log(Activator.createErrorStatus("Unmounting appeared to fail. It's not safe to continue.",
- null));
- monitor.setCanceled(true);
+ IStatus status = Activator.createErrorStatus("Unmounting appeared to fail. It's not safe to continue.",
+ null);
+ reporter.log(status);
+ multiStatus.add(status);
}
if (monitor.isCanceled())
return Status.CANCEL_STATUS;
@@ -955,7 +961,7 @@
IProgressReporter reporter = new StringBuilderProgressReporter(true);
- IStatus status = shutdown(getMachine(), getInstallRoot(), monitor, reporter);
+ IStatus status = shutdown(getMachine(), getInstallRoot(), new SubProgressMonitor(monitor, 1), reporter);
if (!monitor.isCanceled() && status.matches(IStatus.ERROR))
throw new MicaException("Problems during shutdown of " + getDisplayName(),
@@ -1007,7 +1013,7 @@
forceShutdown(monitor);
return Status.OK_STATUS;
} catch (MicaException e) {
- return Activator.createErrorStatus("Failed to restart " + getDisplayName(), e);
+ return Activator.createErrorStatus("Failed to shutdown " + getDisplayName(), e);
}
}
Modified: branches/work_Raul/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/launcher/Scratchbox1PrepareTargetProcessLaunchAdapter.java
===================================================================
--- branches/work_Raul/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/launcher/Scratchbox1PrepareTargetProcessLaunchAdapter.java 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/launcher/Scratchbox1PrepareTargetProcessLaunchAdapter.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -15,7 +15,6 @@
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Display;
-import org.maemo.esbox.scratchbox.core.scratchbox.ScratchboxException;
import org.maemo.esbox.scratchbox.sb1.sdk.IScratchbox1SDK;
import org.maemo.mica.common.core.MicaException;
import org.maemo.mica.common.core.WorkspaceUtils;
@@ -40,7 +39,7 @@
IScratchbox1SDK sdk = ((IScratchbox1SDK) sdkTarget.getSDK());
final String currentTarget = sdk.getCurrentTarget();
final String targetName = sdkTarget.getName();
- if (currentTarget.equals(targetName)) {
+ if (targetName.equals(currentTarget)) {
return;
}
@@ -48,7 +47,7 @@
boolean failedToSwitch = false;
try {
sdk.selectTarget(targetName);
- } catch (final ScratchboxException e) {
+ } catch (final MicaException e) {
// sb-conf: You must close your other Scratchbox sessions first
// or
// Note: Couldn't reselect the target. There are other Scratchbox
@@ -60,7 +59,7 @@
}
}
- if (failedToSwitch || !sdk.getCurrentTarget().equals(targetName)) {
+ if (failedToSwitch || !targetName.equals(sdk.getCurrentTarget())) {
final boolean[] ret = { false };
if (!WorkspaceUtils.isJUnitRunning()) {
Modified: branches/work_Raul/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/launcher/Scratchbox1ProcessLauncher.java
===================================================================
--- branches/work_Raul/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/launcher/Scratchbox1ProcessLauncher.java 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/launcher/Scratchbox1ProcessLauncher.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -13,6 +13,7 @@
import org.eclipse.core.filesystem.EFS;
import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.runtime.*;
+import org.maemo.esbox.internal.scratchbox.sb1.Activator;
import org.maemo.esbox.internal.scratchbox.sb1.core.SB1PreferenceConstants;
import org.maemo.esbox.internal.scratchbox.sb1.core.Scratchbox1SDK;
import org.maemo.esbox.internal.scratchbox.sb1.core.Scratchbox1SDKTarget;
@@ -39,15 +40,19 @@
public class Scratchbox1ProcessLauncher extends AbstractSDKTargetProcessLauncher implements
IProcessLauncher {
+ private static int gRunScriptCounter;
+
/**
* The name of a file copied from the plugin to the sb environment
* which we generate to wrap the program.
*/
- private static final String RUN_SCRIPT_NAME = "run.sh";
+ private static final String RUN_SCRIPT_NAME = "run";
private Scratchbox1SDKTarget sdkTarget;
private String runScriptContents;
+
+ private String runScriptName;
public Scratchbox1ProcessLauncher(Scratchbox1SDKTarget sdkTarget,
ProcessLauncherParameters params) {
super(params, sdkTarget);
@@ -73,7 +78,12 @@
// it better not be null
substitutor.define("RUN_SCRIPT_DIRECTORY", targetRunScriptPath.toPortableString());
- substitutor.define("RUN_SCRIPT", RUN_SCRIPT_NAME);
+
+ // hack: for unit tests: we won't run #setupForLaunch() first
+ if (runScriptName == null)
+ runScriptName = "run.sh";
+
+ substitutor.define("RUN_SCRIPT", runScriptName);
// get the Scratchbox invocation pattern
String commandPattern = sdkTarget
@@ -122,8 +132,24 @@
IPath runScriptLocation = getRunScriptLocation(sdkTarget);
- IFileStore store = sdkTarget.getMachine().getFileSystemAccess().getFileStore(
- runScriptLocation.append(RUN_SCRIPT_NAME));
+ // make a unique run.sh script name, so we can run multiple programs simultaneously
+ runScriptName = RUN_SCRIPT_NAME + (gRunScriptCounter++) + ".sh";
+
+ final IFileStore store = sdkTarget.getMachine().getFileSystemAccess().getFileStore(
+ runScriptLocation.append(runScriptName));
+
+ // remove the script when we're done
+ queueStreamMonitor(new StreamMonitorAdapter() {
+ @Override
+ public void processExited(int exitCode) {
+ try {
+ store.delete(0, null);
+ } catch (CoreException e) {
+ Activator.getErrorLogger().logError("Error removing " + runScriptName, e);
+ }
+ }
+ });
+
try {
store.getParent().mkdir(0, null);
Modified: branches/work_Raul/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/MaemoScriptInstallerMonitor.java
===================================================================
--- branches/work_Raul/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/MaemoScriptInstallerMonitor.java 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/MaemoScriptInstallerMonitor.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -166,11 +166,17 @@
* @throws InterruptedException
*/
private boolean handleLicenseLine(String text) throws InterruptedException {
- if (text.trim().length() >= 80 && text.trim().replaceAll("-", "").length() == 0) {
+ boolean oldLicenseLineStart = text.trim().length() >= 80 && text.trim().replaceAll("-", "").length() == 0;
+ boolean newLicenseLineStart = text.contains("1) IMPORTANT: READ CAREFULLY BEFORE");
+ boolean newLicenseLineEnd = text.contains("Press Enter to accept");
+ if (oldLicenseLineStart || (newLicenseLineStart && !readingLicense) || newLicenseLineEnd) {
if (!readingLicense && !gotLicense) {
readingLicense = true;
licenseText = new StringBuilder();
- return true;
+ if (oldLicenseLineStart)
+ return true;
+
+ // else fall through
} else if (!gotLicense) {
readingLicense = false;
gotLicense = true;
@@ -229,7 +235,8 @@
}
return true;
}
- } else if (readingLicense) {
+ }
+ if (readingLicense) {
licenseText.append(text);
licenseText.append('\n');
return true;
Modified: branches/work_Raul/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/Scratchbox1SDKInstallerDataContentLabelProvider.java
===================================================================
--- branches/work_Raul/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/Scratchbox1SDKInstallerDataContentLabelProvider.java 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/Scratchbox1SDKInstallerDataContentLabelProvider.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -50,14 +50,37 @@
"scratchbox-toolchain-host-gcc"));
}
- //Fremantle Beta
+ //Fremantle Beta 2
urls = fetchScriptsFromUrl(
+ "http://repository.maemo.org/unstable/5.0beta2/",
+ "maemo-scratchbox-install.*\\.sh");
+
+ for (URL url : urls) {
+ contents.add(new Scratchbox1SDKInstallerData(
+ "Maemo 5 Series (Fremantle) (Beta 2 Release)",5, url,
+ ((IBuildMachine) newInput),
+ "deb http://scratchbox.org/debian/ maemo5-sdk main",
+ "scratchbox-core", "scratchbox-libs",
+ "scratchbox-devkit-qemu",
+ "scratchbox-devkit-debian",
+ "scratchbox-devkit-doctools",
+ "scratchbox-devkit-perl",
+ "scratchbox-toolchain-host-gcc",
+ "scratchbox-toolchain-cs2007q3-glibc2.5-arm7",
+ "scratchbox-toolchain-cs2007q3-glibc2.5-i486",
+ "scratchbox-devkit-svn",
+ "scratchbox-devkit-git",
+ "scratchbox-devkit-apt-https"
+ ));
+ }
+ //Fremantle Beta 1
+ urls = fetchScriptsFromUrl(
"http://repository.maemo.org/unstable/5.0beta/",
"maemo-scratchbox-install.*\\.sh");
for (URL url : urls) {
contents.add(new Scratchbox1SDKInstallerData(
- "Maemo 5 Series (Fremantle) (Beta Release)",5, url,
+ "Maemo 5 Series (Fremantle) (Beta 1 Release)",5, url,
((IBuildMachine) newInput),
"deb http://scratchbox.org/debian/ maemo5-sdk main",
"scratchbox-core", "scratchbox-libs",
Modified: branches/work_Raul/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/Scratchbox1TargetInstallerDataContentLabelProvider.java
===================================================================
--- branches/work_Raul/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/Scratchbox1TargetInstallerDataContentLabelProvider.java 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/internal/scratchbox/sb1/ui/wizard/Scratchbox1TargetInstallerDataContentLabelProvider.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -53,14 +53,31 @@
));
}
-// Fremantle Beta release support
+ // Fremantle Beta 2 release support
urls = fetchScriptsFromUrl(
+ "http://repository.maemo.org/unstable/5.0beta2/",
+ "maemo-sdk-install.*\\.sh");
+
+ for (URL url : urls) {
+ contents.add(new Scratchbox1TargetInstallerData(
+ "Maemo 5.0 Fremantle (Beta 2 Release)",
+ url,
+ sdks.size() > 0 ? sdks.get(0) : null,
+ "FREMANTLE",
+ new String[] { "qemu-arm-sb" },
+ new String[] { "cs2007q3-glibc2.5-arm7", "cs2007q3-glibc2.5-i486" },
+ new String[] { "qemu", "perl", "debian-etch", "doctools", "svn", "git", "apt-https" }
+ ));
+ }
+
+ // Fremantle Beta release support
+ urls = fetchScriptsFromUrl(
"http://repository.maemo.org/unstable/5.0beta/",
"maemo-sdk-install.*\\.sh");
for (URL url : urls) {
contents.add(new Scratchbox1TargetInstallerData(
- "Maemo 5.0 Fremantle (Beta Release)",
+ "Maemo 5.0 Fremantle (Beta 1 Release)",
url,
sdks.size() > 0 ? sdks.get(0) : null,
"FREMANTLE",
Modified: branches/work_Raul/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/scratchbox/sb1/sdk/IScratchbox1SDK.java
===================================================================
--- branches/work_Raul/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/scratchbox/sb1/sdk/IScratchbox1SDK.java 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.scratchbox.sb1/src/org/maemo/esbox/scratchbox/sb1/sdk/IScratchbox1SDK.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -14,12 +14,13 @@
import org.maemo.esbox.scratchbox.core.sdk.IScratchboxSDK;
import org.maemo.mica.common.core.MicaException;
+import org.maemo.mica.internal.api.common.core.sdk.ISingleCurrentTargetOnlySDK;
/**
* @author baranov
*
*/
-public interface IScratchbox1SDK extends IScratchboxSDK {
+public interface IScratchbox1SDK extends IScratchboxSDK, ISingleCurrentTargetOnlySDK {
public static final String NAME = "Scratchbox 1";
/**
@@ -41,17 +42,6 @@
public List<String> getSessions() throws MicaException;
/**
- * Select another available target as current Scratchbox target.
- *
- * @param targetName
- * the name of the new target.
- * @throws MicaException
- * if the target to be selected does not exists or if some
- * problem related to Scratchbox communication occurs.
- */
- public void selectTarget(String targetName) throws MicaException;
-
- /**
* Kill an Scratchbox process.
*
* @return true, if the is performed successfully.
Modified: branches/work_Raul/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/core/Scratchbox2SDK.java
===================================================================
--- branches/work_Raul/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/core/Scratchbox2SDK.java 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.scratchbox.sb2/src/org/maemo/esbox/internal/scratchbox/sb2/core/Scratchbox2SDK.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -201,15 +201,6 @@
/*
* (non-Javadoc)
*
- * @see org.maemo.mica.maemosdk.core.sdk.IScratchboxSDK#getCurrentTarget()
- */
- public String getCurrentTarget() throws MicaException {
- return getMaemoSdkCommand().getDefaultRootstrap();
- }
-
- /*
- * (non-Javadoc)
- *
* @see
* org.maemo.mica.maemosdk.core.sdk.IScratchboxSDK#removeTarget(java.lang
* .String)
Modified: branches/work_Raul/org.maemo.esbox.scratchbox.tests/src/org/maemo/esbox/scratchbox/tests/TestSB1ProcessLauncher.java
===================================================================
--- branches/work_Raul/org.maemo.esbox.scratchbox.tests/src/org/maemo/esbox/scratchbox/tests/TestSB1ProcessLauncher.java 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.scratchbox.tests/src/org/maemo/esbox/scratchbox/tests/TestSB1ProcessLauncher.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -26,7 +26,9 @@
import org.maemo.mica.common.core.process.CommandLineArguments;
import org.maemo.mica.common.core.process.IProcessLauncher;
import org.maemo.mica.common.core.process.IProcessLauncherFactory;
+import org.maemo.mica.common.core.process.IProcessMonitor;
import org.maemo.mica.common.core.process.ProcessLauncherParameters;
+import org.maemo.mica.common.core.process.StreamLineMonitorAdapter;
import org.maemo.mica.common.core.process.ProcessLauncherUtils.LaunchResults;
import org.maemo.mica.common.core.sdk.ISDK;
import org.maemo.mica.common.core.sdk.ISDKProvider;
@@ -198,5 +200,46 @@
}
});
}
+
+ @Test
+ public void testSimultaneousProcesses() throws Exception {
+ runOverTargets(new IRunner() {
+
+ public void run(ISDKTarget target) throws Exception {
+ IProcessLauncher launcher = target.getProcessLauncherFactory().createProcessLauncher(
+ ProcessLauncherParameters.create("sh", "-c", "sleep 10; echo a b c d e f g h i j k l m n o p q r s t u v w x y z"));
+
+ final String[] gotLine = { null };
+ StreamLineMonitorAdapter echoChecker = new StreamLineMonitorAdapter() {
+ public void handleLine(String line, boolean errorStream) throws InterruptedException {
+ gotLine[0] = line;
+ }
+ };
+
+ // launch in background
+ launcher.queueStreamMonitor(echoChecker);
+ launcher.createProcess(null);
+ IProcessMonitor monitor = launcher.createProcessMonitor();
+ monitor.runNonBlocking();
+
+ // now, launch something else
+ LaunchResults results = createAndLaunchStockProcessForScript(
+ target, null, "ls", null);
+ assertEquals(0, results.exitCode);
+ assertEquals("", results.stderr.toString());
+ assertTrue(results.toString().length() > 0);
+
+ // now, wait for the other one to finish
+
+ monitor.waitForCompletion(null);
+ assertEquals(0, monitor.getExitValue());
+
+ // if this doesn't match, it should be some random garbage
+ // from another process or a bash shell error
+ assertEquals("a b c d e f g h i j k l m n o p q r s t u v w x y z", gotLine[0]);
+ }
+ });
+ }
+
}
Modified: branches/work_Raul/org.maemo.esbox.scratchbox.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestListCommands.java
===================================================================
--- branches/work_Raul/org.maemo.esbox.scratchbox.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestListCommands.java 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.scratchbox.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestListCommands.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -17,14 +17,8 @@
import org.maemo.esbox.internal.scratchbox.sb1.command.ListCompilersCommand;
import org.maemo.esbox.internal.scratchbox.sb1.command.ListCputranspCommand;
import org.maemo.esbox.internal.scratchbox.sb1.command.ListDevkitsCommand;
-import org.maemo.esbox.internal.scratchbox.sb1.command.ListSessionsCommand;
import org.maemo.esbox.internal.scratchbox.sb1.command.ListTargetsCommand;
-import org.maemo.esbox.internal.scratchbox.sb1.core.Scratchbox1SDK;
-import org.maemo.esbox.scratchbox.core.sdk.ScratchboxSDKFacade;
import org.maemo.mica.common.core.MicaException;
-import org.maemo.mica.common.core.process.IProcessLauncher;
-import org.maemo.mica.common.core.process.ProcessLauncherParameters;
-import org.maemo.mica.common.core.sdk.ISDKTarget;
/**
* Please, read file TESTS.txt for more instructions about test.
@@ -226,62 +220,6 @@
}
/**
- * This is a broken test because we do not run with PTYs, ever, so no interactive programs
- * (or sessions) will launch under scratchbox and stay alive long enough to detect.
- * @throws Exception
- */
- public void __dont_testListSessionsCommand() throws Exception {
- List<String> fakeParam = new ArrayList<String>();
- fakeParam.add("param");
-
- int numberOfSessions = 0;
-
- ListSessionsCommand listSessionsCommand = new ListSessionsCommand(sb1Command);
- List<String> sessions = null;
-
- try {
- listSessionsCommand.performCommand(fakeParam);
- fail("Invalid number of param");
- } catch (MicaException e) {
- // expected
- }
-
- sessions = listSessionsCommand.performCommand(new ArrayList<String>());
-
- // make sure anything here is a pid
- for (String pid : sessions) {
- Integer.parseInt(pid);
- }
-
- numberOfSessions = sessions.size();
-
- // launch a new session (without switching targets!)
- ISDKTarget target = ScratchboxSDKFacade.getInstance().getScratchboxSDK(Scratchbox1SDK.class).get(0).getCurrentSDKTarget();
-
- Process process = null;
- try {
- IProcessLauncher launcher = target.getProcessLauncherFactory().createProcessLauncher(
- ProcessLauncherParameters.create("/usr/bin/yes"));
- process = launcher.createProcess(null);
-
- sessions = listSessionsCommand.performCommand(new ArrayList<String>());
-
- // this either launches 1 or 2 processes
- assertTrue(numberOfSessions < sessions.size());
-
- // make sure anything here is a pid
- for (String pid : sessions) {
- Integer.parseInt(pid);
- }
- } finally {
- // kill the shell (exit, then send ctrl-d)
- process.getOutputStream().write("exit\n004\004\004\004\004\004\004\004\004".getBytes());
- process.destroy();
- }
-
- }
-
- /**
* Test method for
* {@link embedded.core.scratchbox.command.ListTargetsCommand#performCommand(java.util.List)}.
*/
Modified: branches/work_Raul/org.maemo.esbox.scratchbox.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestRemoveSb2Command.java
===================================================================
--- branches/work_Raul/org.maemo.esbox.scratchbox.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestRemoveSb2Command.java 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.scratchbox.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestRemoveSb2Command.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -11,7 +11,9 @@
package org.maemo.esbox.scratchbox.tests.commands;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.maemo.esbox.internal.scratchbox.sb2.command.MaemoRootstrapCommand;
import org.maemo.mica.common.core.MicaException;
+import org.maemo.mica.internal.api.common.core.sdk.BaseSDK;
import java.util.ArrayList;
import java.util.List;
@@ -63,7 +65,8 @@
if (targets.contains(TARGET)) {
try {
maemoRootstrapCommand.remove(TARGET, new NullProgressMonitor());
-
+ // the command does not communicate with the SDK so explicitly flush the cache
+ ((BaseSDK) sb2Sdk).getCache().clear();
targets = sb2Sdk.getTargets();
assertFalse(targets.contains(TARGET));
} catch (MicaException e) {
Modified: branches/work_Raul/org.maemo.esbox.scratchbox.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestScratchboxFacade.java
===================================================================
--- branches/work_Raul/org.maemo.esbox.scratchbox.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestScratchboxFacade.java 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.scratchbox.tests/src/org/maemo/esbox/scratchbox/tests/commands/TestScratchboxFacade.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -24,9 +24,6 @@
import org.maemo.esbox.scratchbox.core.sdk.ScratchboxSDKFacade;
import org.maemo.esbox.scratchbox.sb1.sdk.IScratchbox1SDK;
import org.maemo.mica.common.core.MicaException;
-import org.maemo.mica.common.core.process.IProcessLauncher;
-import org.maemo.mica.common.core.process.ProcessLauncherParameters;
-import org.maemo.mica.common.core.sdk.ISDKTarget;
/**
* Please, read file TESTS.txt for more instructions about test.
@@ -253,62 +250,11 @@
/**
* Test method for
- * {@link org.maemo.esbox.common.core.scratchbox.ScratchboxFacade#getSessions()}.
+ * {@link org.maemo.esbox.common.core.scratchbox.ScratchboxFacade#getDefaultTarget()}.
*
- * This is broken because PTY support is no longer wired up. Thus, none of the
- * simple programs we launch via tests will run for long enough to be detected as a session.
* @throws MicaException
*/
@Test
- public void __dont__testGetSessions() throws Exception {
- if (sdk == null) return;
- int numberOfSessions = 0;
-
- List<String> sessions = sdk.getSessions();
-
- // make sure anything here is a pid
- for (String pid : sessions) {
- Integer.parseInt(pid);
- }
-
- numberOfSessions = sessions.size();
-
- // launch a new session (without switching targets!)
- ISDKTarget target = ScratchboxSDKFacade.getInstance().getScratchboxSDK(Scratchbox1SDK.class).get(0).getCurrentSDKTarget();
- Process process = null;
- try {
- IProcessLauncher launcher = target.getProcessLauncherFactory().createProcessLauncher(
- ProcessLauncherParameters.create("bin/sh"));
- process = launcher.createProcess(null);
-
- // wait for it to really start
- Thread.sleep(5000);
-
- sessions = sdk.getSessions();// ScratchboxFacade.getInstance().getSessions(sdk);
-
- // this either launches 1 or 2 processes
- assertTrue(numberOfSessions < sessions.size());
-
- // make sure anything here is a pid
- for (String pid : sessions) {
- Integer.parseInt(pid);
- }
- } catch (Exception e) {
- fail("Exception: "+e.getMessage());
- }finally {
- // kill the shell (exit, then send ctrl-d)
- process.getOutputStream().write("exit\n004\004\004\004\004\004\004\004\004".getBytes());
- process.destroy();
- }
- }
-
- /**
- * Test method for
- * {@link org.maemo.esbox.common.core.scratchbox.ScratchboxFacade#getCurrentTarget()}.
- *
- * @throws MicaException
- */
- @Test
public void testGetCurrentTarget() throws MicaException {
if (sdk == null) return;
String currentTarget = sdk.getCurrentTarget();//ScratchboxFacade.getInstance().getCurrentTarget(sdk);
Modified: branches/work_Raul/org.maemo.esbox.tests/META-INF/MANIFEST.MF
===================================================================
--- branches/work_Raul/org.maemo.esbox.tests/META-INF/MANIFEST.MF 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.tests/META-INF/MANIFEST.MF 2009-08-11 00:04:04 UTC (rev 1955)
@@ -30,8 +30,8 @@
org.eclipse.cdt.core;bundle-version="5.0.2",
org.maemo.mica.python.interpreter;bundle-version="2.0.0",
org.maemo.mica.python.project.core;bundle-version="2.0.0",
- org.python.pydev;bundle-version="1.4.4",
- org.python.pydev.core;bundle-version="1.4.4",
- org.maemo.esbox.scratchbox.tests;bundle-version="2.0.0"
+ org.maemo.esbox.scratchbox.tests;bundle-version="2.0.0",
+ org.python.pydev;bundle-version="1.4.7",
+ org.python.pydev.core;bundle-version="1.4.7"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Modified: branches/work_Raul/org.maemo.esbox.tests/asthelper.completions
===================================================================
(Binary files differ)
Modified: branches/work_Raul/org.maemo.esbox.tests/src/org/maemo/esbox/internal/tests/ESboxMicaTestSuite.java
===================================================================
--- branches/work_Raul/org.maemo.esbox.tests/src/org/maemo/esbox/internal/tests/ESboxMicaTestSuite.java 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.tests/src/org/maemo/esbox/internal/tests/ESboxMicaTestSuite.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -51,10 +51,11 @@
suite.addTest(new JUnit4TestAdapter(TestCppBuildConfigProjectConverter.class));
suite.addTest(new JUnit4TestAdapter(TestCppBuildConfigProjectCreator.class));
suite.addTest(new JUnit4TestAdapter(TestDebianStructureGenerator4CppProject.class));
- suite.addTest(new JUnit4TestAdapter(TestFremantleAptBuildPackageMapping.class));
+ suite.addTest(new JUnit4TestAdapter(TestFremantleAptBuildPackageMapping.class));
+ suite.addTest(new JUnit4TestAdapter(TestPythonProjectProperties.class));
+
suite.addTest(new JUnit4TestAdapter(TestPythonProjectConverter.class));
suite.addTest(new JUnit4TestAdapter(TestPythonProjectCreator.class));
- suite.addTest(new JUnit4TestAdapter(TestPythonProjectProperties.class));
return suite;
}
Modified: branches/work_Raul/org.maemo.esbox.tests/src/org/maemo/esbox/tests/python/ManualTestPyDevInterpreterConfigurator.java
===================================================================
--- branches/work_Raul/org.maemo.esbox.tests/src/org/maemo/esbox/tests/python/ManualTestPyDevInterpreterConfigurator.java 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.tests/src/org/maemo/esbox/tests/python/ManualTestPyDevInterpreterConfigurator.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -28,7 +28,6 @@
import org.maemo.mica.internal.api.python.interpreter.PyDevInterpreterConfigurator;
import org.maemo.mica.python.project.core.IMicaPythonProjectType;
import org.python.pydev.core.IInterpreterInfo;
-import org.python.pydev.core.Interpreter;
import org.python.pydev.plugin.nature.PythonNature;
/**
* @author Fabrício S Epaminondas (UFCG)
@@ -73,14 +72,14 @@
assertFalse(configurator.isInterpreterSubscribed(nature));
String pythonPath = "my/crazy/path";
- Interpreter defaultInterpreter = new Interpreter("Default Test Interpreter", "Default Test Interpreter", pythonPath);
+ String defaultInterpreter = "Default Test Interpreter";
assertNull(configurator.addInterpreterManager(nature, defaultInterpreter));
assertFalse(configurator.isInterpreterSubscribed(nature));
//TODO FIX: the test will fail if could not found the expected python location on local machine
assertFalse(configurator.isInterpreterSubscribed(nature));
- defaultInterpreter = configurator.getSDKTargetInterpreter(theSB1SDKTarget);
+ defaultInterpreter = configurator.getSDKTargetInterpreterName(theSB1SDKTarget);
IInterpreterInfo interpreterInfo = configurator.addInterpreterManager(nature, defaultInterpreter);
assertNotNull(interpreterInfo);
nature.getRelatedInterpreterManager().addInterpreterInfo(interpreterInfo);
Modified: branches/work_Raul/org.maemo.esbox.tests/src/org/maemo/esbox/tests/python/TestPythonProjectConverter.java
===================================================================
--- branches/work_Raul/org.maemo.esbox.tests/src/org/maemo/esbox/tests/python/TestPythonProjectConverter.java 2009-08-07 15:19:47 UTC (rev 1954)
+++ branches/work_Raul/org.maemo.esbox.tests/src/org/maemo/esbox/tests/python/TestPythonProjectConverter.java 2009-08-11 00:04:04 UTC (rev 1955)
@@ -11,7 +11,10 @@
package org.maemo.esbox.tests.python;
+import java.util.ArrayList;
+
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.junit.*;
import org.maemo.esbox.internal.tests.Activator;
import org.maemo.esbox.tests.common.SboxTestUtils;
@@ -22,8 +25,11 @@
import org.maemo.mica.common.project.core.model.IProjectType;
import org.maemo.mica.internal.api.common.project.core.creator.ProjectConfigHandler;
import org.maemo.mica.internal.api.maemosdk.core.MaemoExecutionEnvironmentIds;
+import org.maemo.mica.internal.api.python.interpreter.PyDevInterpreterConfigurator;
import org.maemo.mica.python.project.core.IMicaPythonProjectType;
import org.maemo.mica.python.tests.AbstractTestPythonProjectConverter;
+import org.python.pydev.core.IPythonNature;
+import org.python.pydev.plugin.PydevPlugin;
/**
* Test that we can convert existing projects to the new format
@@ -43,6 +49,15 @@
SboxTestUtils.reset();
theSB1SDKTarget = SboxTestUtils.theSB1SDKTarget;
+
+
+ PyDevInterpreterConfigurator conf = PyDevInterpreterConfigurator.getInstance();
+
+ String interpreterName = conf.getSDKTargetInterpreterName(theSB1SDKTarget);
+
+ if(conf.getInterpreter(interpreterName, new NullProgressMonitor()) == null){
+ conf.insertDefaultSimpleInterpreter(interpreterName, PydevPlugin.getPythonInterpreterManager(),IPythonNature.PYTHON_VERSION_2_5, new ArrayList<String>());
+ }
}
/**
More information about the Esbox-commits
mailing list