Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Overholt2011-02-28 03:41:08 +0000
committerAndrew Overholt2011-02-28 03:41:08 +0000
commitffdc16ae51cdd40427a25bb5962ea36832523874 (patch)
tree1683eb2e3b8a326e569152f2cebf10cc5289df1b
parent08d4864cca7888f8a0b5f76ab24c50b312162691 (diff)
parent45c14ac43b75ce2164accaea3c1b2740bfe74cfd (diff)
downloadorg.eclipse.linuxtools-ffdc16ae51cdd40427a25bb5962ea36832523874.tar.gz
org.eclipse.linuxtools-ffdc16ae51cdd40427a25bb5962ea36832523874.tar.xz
org.eclipse.linuxtools-ffdc16ae51cdd40427a25bb5962ea36832523874.zip
Merge valgrind 0.6.0
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind-feature/ChangeLog103
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind-feature/build.properties4
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind-feature/feature.properties138
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind-feature/feature.xml114
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind-feature/license.html107
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.cachegrind.tests/ChangeLog120
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.cachegrind.tests/META-INF/MANIFEST.MF32
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.cachegrind.tests/plugin.properties3
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.cachegrind/META-INF/MANIFEST.MF30
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.cachegrind/about.html26
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.cachegrind/build.properties8
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.cachegrind/plugin.properties3
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.core/ChangeLog106
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.core/META-INF/MANIFEST.MF19
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.core/build.properties7
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.core/plugin.properties4
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindCommand.java108
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindPlugin.java71
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindPreferencePage.java150
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/messages.properties5
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.doc/ChangeLog72
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.doc/META-INF/MANIFEST.MF11
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.doc/plugin.properties3
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.doc/userguide/General-Usage.html215
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.doc/userguide/Valgrind Reference-toc.xml34
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.doc/userguide/Valgrind Reference.xml739
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.launch/ChangeLog244
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.launch/META-INF/MANIFEST.MF38
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.launch/about.html28
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.launch/plugin.properties13
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.launch/src/org/eclipse/linuxtools/internal/valgrind/launch/ValgrindLaunchConfigurationDelegate.java354
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.launch/src/org/eclipse/linuxtools/internal/valgrind/launch/ValgrindLaunchPlugin.java322
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.launch/src/org/eclipse/linuxtools/internal/valgrind/launch/messages.properties55
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.massif.tests/ChangeLog160
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.massif.tests/META-INF/MANIFEST.MF38
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.massif.tests/plugin.properties3
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.massif.tests/src/org/eclipse/linuxtools/internal/valgrind/massif/tests/DoubleClickTest.java90
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.massif.tests/src/org/eclipse/linuxtools/internal/valgrind/massif/tests/ExpandCollapseTest.java88
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.massif.tests/src/org/eclipse/linuxtools/internal/valgrind/massif/tests/LaunchConfigTabTest.java364
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.massif.tests/src/org/eclipse/linuxtools/internal/valgrind/massif/tests/TreeTest.java70
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.massif/ChangeLog210
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.massif/META-INF/MANIFEST.MF55
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.massif/about.html28
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.massif/plugin.properties4
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifLaunchConstants.java48
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifLaunchDelegate.java109
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifToolPage.java414
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifTreeViewer.java110
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifViewPart.java491
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/birt/ChartEditorInput.java64
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/ChangeLog208
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/META-INF/MANIFEST.MF44
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/plugin.properties3
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/resources/basicTest/test.c19
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/resources/linkedTest/src/test.c19
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/resources/multiProcTest/parent.c16
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/AllTests.java40
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/DoubleClickTest.java151
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/ExpandCollapseTest.java88
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/LaunchConfigTabTest.java545
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/LinkedResourceDoubleClickTest.java112
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/LinkedResourceMarkerTest.java83
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/LocationPreferenceTest.java34
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/MarkerTest.java94
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.memcheck/ChangeLog118
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.memcheck/META-INF/MANIFEST.MF29
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.memcheck/about.html28
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.memcheck/plugin.properties3
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.memcheck/src/org/eclipse/linuxtools/internal/valgrind/memcheck/MemcheckLaunchConstants.java44
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.memcheck/src/org/eclipse/linuxtools/internal/valgrind/memcheck/MemcheckLaunchDelegate.java55
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.memcheck/src/org/eclipse/linuxtools/internal/valgrind/memcheck/MemcheckToolPage.java332
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.test-feature/ChangeLog70
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.test-feature/build.properties5
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.test-feature/feature.properties138
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.test-feature/feature.xml75
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.test-feature/license.html107
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.tests/ChangeLog173
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.tests/META-INF/MANIFEST.MF26
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.tests/plugin.properties12
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.ui.editor/META-INF/MANIFEST.MF25
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.ui.editor/about.html26
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.ui.editor/build.properties8
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.ui/ChangeLog66
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.ui/META-INF/MANIFEST.MF24
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.ui/about.html28
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.ui/plugin.properties5
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.ui/src/org/eclipse/linuxtools/internal/valgrind/ui/CoreMessagesViewer.java200
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.ui/src/org/eclipse/linuxtools/internal/valgrind/ui/ValgrindViewPart.java191
88 files changed, 8876 insertions, 0 deletions
diff --git a/valgrind/org.eclipse.linuxtools.valgrind-feature/ChangeLog b/valgrind/org.eclipse.linuxtools.valgrind-feature/ChangeLog
new file mode 100644
index 0000000000..b53efba19a
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind-feature/ChangeLog
@@ -0,0 +1,103 @@
+2010-05-18 Andrew Overholt <overholt@redhat.com>
+
+ * feature.properties: Fix provider name.
+
+2010-04-26 Andrew Overholt <overholt@redhat.com>
+
+ * feature.properties: Match consistent license text (bug #306627). Update
+ copyright year.
+ * license.html: New file. HTML version of SUA (bug #306627).
+ * build.properties: Include license.html.
+
+2010-04-13 Andrew Overholt <overholt@redhat.com>
+
+ * feature.xml: Restrict to os=linux.
+
+2010-04-12 Andrew Overholt <overholt@redhat.com>
+
+ * feature.properties: Match consistent license text (bug #306627).
+
+2009-08-11 Elliott Baron <ebaron@redhat.com>
+
+ * feature.xml: Bump version to 0.3.0.
+
+2009-07-21 Elliott Baron <ebaron@redhat.com>
+
+ * feature.xml: Added ui.editor plugin. Recomputed dependencies.
+
+2009-06-26 Elliott Baron <ebaron@redhat.com>
+
+ * feature.xml: Added doc plugin. Recomputed dependencies.
+
+2009-06-04 Elliott Baron <ebaron@redhat.com>
+
+ * feature.xml: Removing birt.chart from deps.
+
+2009-05-28 Elliott Baron <ebaron@redhat.com>
+
+ * feature.properties: Fix featureProvider key.
+
+2009-05-27 Elliott Baron <ebaron@redhat.com>
+
+ * feature.xml: Removing ".qualifier" from profiling feature dep.
+
+2009-05-26 Elliott Baron <ebaron@redhat.com>
+
+ * feature.xml: Make profiling feature dependency; version >= 0.2.0.
+
+2009-05-25 Elliott Baron <ebaron@redhat.com>
+
+ #275685
+ * feature.xml: Maintenance update for version string issues on Debian.
+
+2009-05-20 Elliott Baron <ebaron@redhat.com>
+
+ * feature.xml: Remove '.feature' from feature ID.
+
+2009-05-19 Andrew Overholt <overholt@redhat.com>
+
+ * feature.properties: Change provider from Eclipse.org to Eclipse.
+
+2009-04-03 Elliott Baron <ebaron@redhat.com>
+
+ * feature.xml: 0.2.0 version.
+
+2009-03-13 Andrew Overholt <overholt@redhat.com>
+
+ * feature.xml: Add cachegrind plugin.
+
+2009-01-28 Elliott Baron <ebaron@redhat.com>
+
+ * feature.xml: Removed feature dependency, added console deps for launch.
+
+2009-01-14 Andrew Overholt <overholt@redhat.com>
+
+ * feature.xml: Re-add update site information (sorry).
+
+2009-01-14 Elliott Baron <ebaron@redhat.com>
+
+ * feature.xml: Removed update site information.
+
+2009-01-09 Elliott Baron <ebaron@redhat.com>
+
+ * feature.xml: Added all used BIRT plugins as dependencies.
+
+2009-01-08 Elliott Baron <ebaron@redhat.com>
+
+ * feature.xml: Added org.eclipse.linuxtools.profiling-feature to dependencies.
+
+2009-01-06 Andrew Overholt <overholt@redhat.com>
+
+ * feature.xml: Remove Linux requirement to see if it then gets included in all
+ feature. Added update site information.
+
+2008-12-16 Elliott Baron <ebaron@redhat.com>
+
+ * feature.xml: Added dependencies and Linux requirement.
+
+2008-12-10 Andrew Overholt <overholt@redhat.com>
+
+ * build.properties: Inital checkin.
+ * feature.xml: Likewise.
+ * feature.properties: Likewise.
+ * epl-v10.html: Likewise. \ No newline at end of file
diff --git a/valgrind/org.eclipse.linuxtools.valgrind-feature/build.properties b/valgrind/org.eclipse.linuxtools.valgrind-feature/build.properties
new file mode 100644
index 0000000000..b74af86fe4
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind-feature/build.properties
@@ -0,0 +1,4 @@
+bin.includes = feature.xml,\
+ feature.properties,\
+ epl-v10.html,\
+ license.html
diff --git a/valgrind/org.eclipse.linuxtools.valgrind-feature/feature.properties b/valgrind/org.eclipse.linuxtools.valgrind-feature/feature.properties
new file mode 100644
index 0000000000..bf8fff23e8
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind-feature/feature.properties
@@ -0,0 +1,138 @@
+#*******************************************************************************
+# Copyright (c) 2008 Red Hat, Inc.
+# 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:
+# Red Hat, Inc. - initial API and implementation
+#********************************************************************************
+featureName=Valgrind Tools Integration (Incubation)
+description=Plugins to integrate Valgrind tools into the workbench.
+featureProvider=Eclipse Linux Tools
+copyright=Copyright 2008, 2010 Red Hat, Inc.
+licenseURL=license.html
+license=\
+Eclipse Foundation Software User Agreement\n\
+April 14, 2010\n\
+\n\
+Usage Of Content\n\
+\n\
+THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
+OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
+USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
+AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
+NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
+AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
+AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
+OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
+TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
+OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
+BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
+\n\
+Applicable Licenses\n\
+\n\
+Unless otherwise indicated, all Content made available by the\n\
+Eclipse Foundation is provided to you under the terms and conditions of\n\
+the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\
+provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
+For purposes of the EPL, "Program" will mean the Content.\n\
+\n\
+Content includes, but is not limited to, source code, object code,\n\
+documentation and other files maintained in the Eclipse Foundation source code\n\
+repository ("Repository") in software modules ("Modules") and made available\n\
+as downloadable archives ("Downloads").\n\
+\n\
+ - Content may be structured and packaged into modules to facilitate delivering,\n\
+ extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
+ plug-in fragments ("Fragments"), and features ("Features").\n\
+ - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\
+ in a directory named "plugins".\n\
+ - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
+ Each Feature may be packaged as a sub-directory in a directory named "features".\n\
+ Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
+ numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
+ - Features may also include other Features ("Included Features"). Within a Feature, files\n\
+ named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
+\n\
+The terms and conditions governing Plug-ins and Fragments should be\n\
+contained in files named "about.html" ("Abouts"). The terms and\n\
+conditions governing Features and Included Features should be contained\n\
+in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
+Licenses may be located in any directory of a Download or Module\n\
+including, but not limited to the following locations:\n\
+\n\
+ - The top-level (root) directory\n\
+ - Plug-in and Fragment directories\n\
+ - Inside Plug-ins and Fragments packaged as JARs\n\
+ - Sub-directories of the directory named "src" of certain Plug-ins\n\
+ - Feature directories\n\
+\n\
+Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
+Provisioning Technology (as defined below), you must agree to a license ("Feature \n\
+Update License") during the installation process. If the Feature contains\n\
+Included Features, the Feature Update License should either provide you\n\
+with the terms and conditions governing the Included Features or inform\n\
+you where you can locate them. Feature Update Licenses may be found in\n\
+the "license" property of files named "feature.properties" found within a Feature.\n\
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\
+terms and conditions (or references to such terms and conditions) that\n\
+govern your use of the associated Content in that directory.\n\
+\n\
+THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\
+TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
+SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
+\n\
+ - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
+ - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
+ - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
+ - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
+ - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
+\n\
+IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
+TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\
+is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
+govern that particular Content.\n\
+\n\
+\n\Use of Provisioning Technology\n\
+\n\
+The Eclipse Foundation makes available provisioning software, examples of which include,\n\
+but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\
+the purpose of allowing users to install software, documentation, information and/or\n\
+other materials (collectively "Installable Software"). This capability is provided with\n\
+the intent of allowing such users to install, extend and update Eclipse-based products.\n\
+Information about packaging Installable Software is available at\n\
+http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\
+\n\
+You may use Provisioning Technology to allow other parties to install Installable Software.\n\
+You shall be responsible for enabling the applicable license agreements relating to the\n\
+Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\
+in accordance with the Specification. By using Provisioning Technology in such a manner and\n\
+making it available in accordance with the Specification, you further acknowledge your\n\
+agreement to, and the acquisition of all necessary rights to permit the following:\n\
+\n\
+ 1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\
+ the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\
+ extending or updating the functionality of an Eclipse-based product.\n\
+ 2. During the Provisioning Process, the Provisioning Technology may cause third party\n\
+ Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\
+ 3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\
+ govern the use of the Installable Software ("Installable Software Agreement") and such\n\
+ Installable Software Agreement shall be accessed from the Target Machine in accordance\n\
+ with the Specification. Such Installable Software Agreement must inform the user of the\n\
+ terms and conditions that govern the Installable Software and must solicit acceptance by\n\
+ the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\
+ indication of agreement by the user, the provisioning Technology will complete installation\n\
+ of the Installable Software.\n\
+\n\
+Cryptography\n\
+\n\
+Content may contain encryption software. The country in which you are\n\
+currently may have restrictions on the import, possession, and use,\n\
+and/or re-export to another country, of encryption software. BEFORE\n\
+using any encryption software, please check the country's laws,\n\
+regulations and policies concerning the import, possession, or use, and\n\
+re-export of encryption software, to see if this is permitted.\n\
+\n\
+Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n
diff --git a/valgrind/org.eclipse.linuxtools.valgrind-feature/feature.xml b/valgrind/org.eclipse.linuxtools.valgrind-feature/feature.xml
new file mode 100644
index 0000000000..29b6d1eca2
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind-feature/feature.xml
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.eclipse.linuxtools.valgrind"
+ label="%featureName"
+ version="0.4.0.qualifier"
+ provider-name="%featureProvider"
+ os="linux">
+
+ <description>
+ %description
+ </description>
+
+ <copyright>
+ %copyright
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <url>
+ <update label="Linux Tools Update Site" url="http://download.eclipse.org/technology/linuxtools/update"/>
+ </url>
+
+ <requires>
+ <import plugin="org.eclipse.ui"/>
+ <import plugin="org.eclipse.core.runtime"/>
+ <import plugin="org.eclipse.cdt.core"/>
+ <import plugin="org.eclipse.core.resources"/>
+ <import plugin="org.eclipse.debug.core"/>
+ <import plugin="org.eclipse.cdt.debug.core"/>
+ <import plugin="org.eclipse.cdt.launch"/>
+ <import plugin="org.eclipse.core.expressions"/>
+ <import plugin="org.eclipse.core.variables"/>
+ <import plugin="org.eclipse.debug.ui"/>
+ <import plugin="org.eclipse.linuxtools.profiling.launch"/>
+ <import plugin="org.eclipse.ui.console"/>
+ <import plugin="org.eclipse.ui.ide"/>
+ <import plugin="org.eclipse.birt.chart.device.swt" version="2.3.1" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.birt.chart.device.extension" version="2.3.1" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.birt.chart.engine" version="2.3.1" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.birt.chart.engine.extension" version="2.3.1" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.birt.chart.device.svg" version="2.3.1" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.birt.core" version="2.3.1" match="greaterOrEqual"/>
+ <import plugin="org.eclipse.cdt.debug.ui"/>
+ <import plugin="org.eclipse.emf.common"/>
+ <import plugin="org.eclipse.emf.ecore"/>
+ <import plugin="org.eclipse.jface.text"/>
+ <import plugin="org.eclipse.linuxtools.profiling.ui"/>
+ <import plugin="org.mozilla.rhino"/>
+ <import plugin="org.eclipse.core.filesystem"/>
+ <import plugin="org.eclipse.ui.editors"/>
+ <import plugin="org.eclipse.cdt.ui"/>
+ <import plugin="org.eclipse.help"/>
+ <import feature="org.eclipse.linuxtools.profiling" version="0.2.0" match="greaterOrEqual"/>
+ </requires>
+
+ <plugin
+ id="org.eclipse.linuxtools.valgrind.core"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.linuxtools.valgrind.launch"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.linuxtools.valgrind.massif"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.linuxtools.valgrind.memcheck"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.linuxtools.valgrind.ui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.linuxtools.valgrind.cachegrind"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.linuxtools.valgrind.doc"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.linuxtools.valgrind.ui.editor"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
diff --git a/valgrind/org.eclipse.linuxtools.valgrind-feature/license.html b/valgrind/org.eclipse.linuxtools.valgrind-feature/license.html
new file mode 100644
index 0000000000..c184ca36a9
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind-feature/license.html
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Eclipse Foundation Software User Agreement</title>
+</head>
+
+<body lang="EN-US">
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>April 14, 2010</p>
+
+<h3>Usage Of Content</h3>
+
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+ (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+ CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+ OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+ NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+ CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
+ (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+ For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
+ repository (&quot;Repository&quot;) in software modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
+
+<ul>
+ <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
+ <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
+ <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
+ and/or Fragments associated with that Feature.</li>
+ <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
+Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+ <li>The top-level (root) directory</li>
+ <li>Plug-in and Fragment directories</li>
+ <li>Inside Plug-ins and Fragments packaged as JARs</li>
+ <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
+ <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license (&quot;Feature Update License&quot;) during the
+installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
+inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+ <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+ <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+ <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+ <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
+ <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
+
+
+<h3>Use of Provisioning Technology</h3>
+
+<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
+ Update Manager (&quot;Provisioning Technology&quot;) for the purpose of allowing users to install software, documentation, information and/or
+ other materials (collectively &quot;Installable Software&quot;). This capability is provided with the intent of allowing such users to
+ install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
+ href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
+ (&quot;Specification&quot;).</p>
+
+<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
+ applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
+ in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
+ Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
+
+<ol>
+ <li>A series of actions may occur (&quot;Provisioning Process&quot;) in which a user may execute the Provisioning Technology
+ on a machine (&quot;Target Machine&quot;) with the intent of installing, extending or updating the functionality of an Eclipse-based
+ product.</li>
+ <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
+ accessed and copied to the Target Machine.</li>
+ <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
+ Software (&quot;Installable Software Agreement&quot;) and such Installable Software Agreement shall be accessed from the Target
+ Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
+ the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
+ indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
+</ol>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
+ another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
+ possession, or use, and re-export of encryption software, to see if this is permitted.</p>
+
+<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
+</body>
+</html>
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.cachegrind.tests/ChangeLog b/valgrind/org.eclipse.linuxtools.valgrind.cachegrind.tests/ChangeLog
new file mode 100644
index 0000000000..b061461b9d
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.cachegrind.tests/ChangeLog
@@ -0,0 +1,120 @@
+2009-12-22 Roland Grunberg <rgrunber@redhat.com>
+
+ * META-INF/MANIFEST.MF: Make necessary changes for switch from JUnit 3 to JUnit 4.
+
+2009-09-28 Elliott Baron <ebaron@fedoraproject.org>
+
+ * valgrindFiles: Regenerated.
+
+2009-08-11 Elliott Baron <ebaron@redhat.com>
+
+ * src/org/eclipse/linuxtools/valgrind/cachegrind: Removed.
+ * META-INF/MANIFEST.MF: Bump version to 0.3.0.
+
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ Bug #285861
+
+ * plugin.properties: Change Provider to Eclipse.
+
+2009-07-30 Elliott Baron <ebaron@redhat.com>
+
+ * src/org/eclipse/linuxtools/valgrind/cachegrind/tests: Removed.
+ * src/org/eclipse/linuxtools/internal/valgrind/cachegrind/tests: New package.
+ * .project: Enabled API analysis.
+ * META-INF/MANIFEST.MF: Export internal package.
+ * test.xml: Update class references.
+
+2009-06-23 Elliott Baron <ebaron@redhat.com>
+
+ * CachegrindTestToolPage.java: Removed.
+ * AbstractCachegrindTest.java: Remove reference to TestToolPage.
+ * LaunchConfigTabTest.java (setUp): Use actual ToolPage.
+ (testD1Cache): Fire selection event.
+ (testI1Cache): Likewise.
+ (testL2Cache): Likewise.
+ (initConfig): Use actual ToolPage.
+
+2009-04-30 Elliott Baron <ebaron@redhat.com>
+
+ * MultiProcessTest.java: Delete referenced project.
+
+2009-04-21 Elliott Baron <ebaron@redhat.com>
+
+ * plugin.properties: Added "(Incubation)" to plugin name.
+ * BasicCachegrindTest.java (tearDown): Call super last.
+ * CModelLabelsTest.java (tearDown): Likewise.
+ * DoubleClickTest.java (tearDown): Likewise.
+ * ExpandCollapseTest.java (tearDown): Likewise.
+ * LaunchConfigTabTest.java (tearDown): Likewise.
+ * MultiProcessTest.java (tearDown): Likewise.
+
+2009-04-03 Elliott Baron <ebaron@redhat.com>
+
+ * META-INF/MANIFEST.MF: 0.2.0 version.
+
+2009-03-31 Elliott Baron <ebaron@redhat.com>
+
+ * ExpandCollapseTest.java: New file.
+ * AllTests.java (suite): Added ExpandCollapseTest.
+
+2009-03-26 Elliott Baron <ebaron@redhat.com>
+
+ * resources/multiProcTest: New test project.
+ * MultiProcessTest.java: New file.
+ * AllTests.java (suite): Added MultiProcessTest.
+
+2009-03-18 Elliott Baron <ebaron@redhat.com>
+
+ * BasicCachegrindTest.java (setUp): Refactoring from profiling.tests.
+ * CModelLabelsTest.java (setUp): Likewise.
+ * DoubleClickTest.java (setUp): Likewise.
+ * LaunchConfigTabTest.java (setUp): Likewise.
+
+2009-03-17 Elliott Baron <ebaron@redhat.com>
+
+ * LaunchConfigTabTest.java: New file.
+ * CachegrindTestToolPage.java (checkL2Enablement): Subclassed as public.
+ (checkD1Enablement): Likewise.
+ (checkI1Enablement): Likewise.
+ * test.xml: In cleanup change classname to cachegrind_classname.
+ * DoubleClickTest.java: New file.
+ * META-INF/MANIFEST.MF: New deps.
+ * AllTests.java (suite): Added DoubleClickTest and LaunchConfigTabTest.
+
+2009-03-16 Elliott Baron <ebaron@redhat.com>
+
+ * CModelLabelsTest.java: New file.
+ * AllTests.java (suite): New test case.
+ * META-INF/MANIFEST.MF: Added cdt.ui to deps.
+ * AbstractCachegrindTest.java (getFileByName): Extracted method.
+ (getFunctionByName): Likewise.
+ * BasicCachegrindTest.java: Likewise.
+
+2009-03-13 Andrew Overholt <overholt@redhat.com>
+
+ * about.html: Initial checkin.
+ * build.properties: Add test.xml, etc. to build.
+
+2009-03-13 Andrew Overholt <overholt@redhat.com>
+
+ * test.xml: Initial checkin.
+
+2009-03-12 Elliott Baron <ebaron@redhat.com>
+
+ * .classpath: New file.
+ * .project: New file.
+ * .settings/org.eclipse.jdt.core.prefs: New file.
+ * build.properties: New file.
+ * META-INF/MANIFEST.MF: New file.
+ * plugin.properties: New file.
+ * resources/cpptest/.cproject: New file.
+ * resources/cpptest/.project: New file.
+ * resources/cpptest/cpptest.cpp: New file.
+ * resources/cpptest/cpptest.h: New file.
+ * resources/cpptest/Debug: New file.
+ * AbstractCachegrindTest.java: New file.
+ * BasicCachegrindTest.java: New file.
+ * CachegrindTestsPlugin.java: New file.
+ * CachegrindTestToolPage.java: New file.
+ * valgrindFiles: New directory. \ No newline at end of file
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.cachegrind.tests/META-INF/MANIFEST.MF b/valgrind/org.eclipse.linuxtools.valgrind.cachegrind.tests/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..15f3fd1f28
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.cachegrind.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,32 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.eclipse.linuxtools.valgrind.cachegrind.tests
+Bundle-Version: 0.4.0.qualifier
+Bundle-Activator: org.eclipse.linuxtools.internal.valgrind.cachegrind.tests.CachegrindTestsPlugin
+Bundle-Vendor: %Bundle-Vendor.0
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.junit;bundle-version="4.7.0"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Bundle-Localization: plugin
+Import-Package: org.eclipse.cdt.core.model,
+ org.eclipse.cdt.ui,
+ org.eclipse.core.resources,
+ org.eclipse.debug.core,
+ org.eclipse.debug.core.model,
+ org.eclipse.debug.ui,
+ org.eclipse.jface.text,
+ org.eclipse.linuxtools.internal.valgrind.cachegrind,
+ org.eclipse.linuxtools.internal.valgrind.cachegrind.model,
+ org.eclipse.linuxtools.internal.valgrind.core,
+ org.eclipse.linuxtools.internal.valgrind.launch,
+ org.eclipse.linuxtools.internal.valgrind.tests,
+ org.eclipse.linuxtools.internal.valgrind.ui,
+ org.eclipse.linuxtools.profiling.tests,
+ org.eclipse.linuxtools.valgrind.launch,
+ org.eclipse.linuxtools.valgrind.ui,
+ org.eclipse.ui,
+ org.eclipse.ui.texteditor
+Export-Package: org.eclipse.linuxtools.internal.valgrind.cachegrind.tests
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.cachegrind.tests/plugin.properties b/valgrind/org.eclipse.linuxtools.valgrind.cachegrind.tests/plugin.properties
new file mode 100644
index 0000000000..d852c5097e
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.cachegrind.tests/plugin.properties
@@ -0,0 +1,3 @@
+#Properties file for org.eclipse.linuxtools.valgrind.cachegrind.tests
+Bundle-Vendor.0 = Eclipse Linux Tools
+Bundle-Name.0 = Cachegrind Tests Plug-in (Incubation) \ No newline at end of file
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.cachegrind/META-INF/MANIFEST.MF b/valgrind/org.eclipse.linuxtools.valgrind.cachegrind/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..0b48c3440d
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.cachegrind/META-INF/MANIFEST.MF
@@ -0,0 +1,30 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.eclipse.linuxtools.valgrind.cachegrind;singleton:=true
+Bundle-Version: 0.4.0.qualifier
+Bundle-Activator: org.eclipse.linuxtools.internal.valgrind.cachegrind.CachegrindPlugin
+Bundle-Vendor: %Bundle-Vendor.0
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Bundle-Localization: plugin
+Import-Package: org.eclipse.cdt.core.dom.ast,
+ org.eclipse.cdt.core.model,
+ org.eclipse.cdt.core.model.util,
+ org.eclipse.cdt.debug.core,
+ org.eclipse.cdt.launch,
+ org.eclipse.cdt.ui,
+ org.eclipse.core.resources,
+ org.eclipse.debug.core,
+ org.eclipse.debug.ui,
+ org.eclipse.jface.text,
+ org.eclipse.linuxtools.internal.valgrind.core,
+ org.eclipse.linuxtools.internal.valgrind.launch,
+ org.eclipse.linuxtools.internal.valgrind.ui,
+ org.eclipse.linuxtools.profiling.ui,
+ org.eclipse.linuxtools.valgrind.launch,
+ org.eclipse.linuxtools.valgrind.ui
+Export-Package: org.eclipse.linuxtools.internal.valgrind.cachegrind,
+ org.eclipse.linuxtools.internal.valgrind.cachegrind.model
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.cachegrind/about.html b/valgrind/org.eclipse.linuxtools.valgrind.cachegrind/about.html
new file mode 100644
index 0000000000..23506a4bae
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.cachegrind/about.html
@@ -0,0 +1,26 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+
+
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>About</title>
+</head><body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2006</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body></html> \ No newline at end of file
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.cachegrind/build.properties b/valgrind/org.eclipse.linuxtools.valgrind.cachegrind/build.properties
new file mode 100644
index 0000000000..c9b4de5252
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.cachegrind/build.properties
@@ -0,0 +1,8 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.properties,\
+ plugin.xml,\
+ about.html,\
+ icons/
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.cachegrind/plugin.properties b/valgrind/org.eclipse.linuxtools.valgrind.cachegrind/plugin.properties
new file mode 100644
index 0000000000..ded39d70c7
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.cachegrind/plugin.properties
@@ -0,0 +1,3 @@
+#Properties file for org.eclipse.linuxtools.valgrind.cachegrind
+Bundle-Vendor.0 = Eclipse Linux Tools
+Bundle-Name.0 = Cachegrind Plug-in (Incubation) \ No newline at end of file
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.core/ChangeLog b/valgrind/org.eclipse.linuxtools.valgrind.core/ChangeLog
new file mode 100644
index 0000000000..cd9f33000b
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.core/ChangeLog
@@ -0,0 +1,106 @@
+2010-06-06 Elliott Baron <ebaron@fedoraproject.org>
+
+ Bug #315890
+ * src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindCommand.java (whichValgrind): Handle preference
+ for Valgrind location here.
+ * src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindPreferencePage.java: Reformatted.
+
+2009-11-03 Elliott Baron <ebaron@fedoraproject.org>
+
+ * plugin.properties: Externalized preference page name.
+ * plugin.xml: Likewise.
+ * src/org/eclipse/linuxtools/internal/valgrind/core/messages.properties: Externalized/edited strings.
+ * src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindPreferencePage.java: Likewise.
+
+2009-08-11 Elliott Baron <ebaron@redhat.com>
+
+ * META-INF/MANIFEST.MF: Bump version to 0.3.0.
+
+2009-08-10 Elliott Baron <ebaron@redhat.com>
+
+ * src/org/eclipse/linuxtools/internal/valgrind/core/LaunchConfigurationConstants.java: Changed
+ launch config constant for suppression files, since it is now a list.
+
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ Bug #285861
+
+ * plugin.properties: Change Provider to Eclipse.
+
+2009-07-30 Elliott Baron <ebaron@redhat.com>
+
+ * src/org/eclipse/linuxtools/valgrind/core: Moved all but IValgrindMessage.
+ * src/org/eclipse/linuxtools/internal/valgrind/core: New package.
+ * META-INF/MANIFEST.MF: Export internal package.
+
+2009-05-26 Elliott Baron <ebaron@redhat.com>
+
+ * AbstractValgrindTextParser.java: Add constant.
+ * CommandLineConstants.java (OPT_MAINSTACK): Support for --main-stacksize.
+ * LaunchConfigurationConstants.java: Likewise.
+
+2009-04-30 Elliott Baron <ebaron@redhat.com>
+
+ * AbstractValgrindMessage.java: New file.
+ * IValgrindMessage.java: New file.
+ * ValgrindCoreParser.java: New file.
+ * ValgrindError.java: New file.
+ * ValgrindStackFrame.java: New file.
+ * AbstractValgrindTextParser.java: Actually made abstract, pull up parseFilename.
+ * CommandLineConstants.java: LOG_PREFIX moved here.
+
+2009-04-03 Elliott Baron <ebaron@redhat.com>
+
+ * META-INF/MANIFEST.MF: 0.2.0 version.
+
+2009-03-25 Elliott Baron <ebaron@redhat.com>
+
+ * LaunchConfigurationConstants.java: ATTR_OUTPUT_DIR -> ATTR_INTERNAL_OUTPUT_DIR.
+ * PluginConstants.java (EXPORT_CMD_ID): ID for export command.
+
+2009-03-11 Elliott Baron <ebaron@redhat.com>
+
+ * CommandLineConstants.java: Added --version argument.
+ * ValgrindCommand.java (whichVersion): New method.
+ (whichValgrind): Extracted readIntoBuffer.
+ (readIntoBuffer): New method.
+
+2009-02-25 Elliott Baron <ebaron@redhat.com>
+
+ * ValgrindCommand.java (whichValgrind): No longer static.
+
+2009-02-20 Elliott Baron <ebaron@redhat.com>
+
+ * AbstractValgrindTextParser.java (parseStrValue): Added limit argument to String.split().
+ (parseLongValue): Likewise.
+
+2009-02-12 Elliott Baron <ebaron@redhat.com>
+
+ * ConsoleWriterThread.java: Removed.
+ * StreamReaderThread.java: Removed.
+ * LaunchConfigurationConstants.java: Removed.
+ * CommandLineConstants.java: New file.
+ * LaunchConfigurationConstants.java: New file.
+ * PluginConstants.java: New file.
+ * META-INF/MANIFEST.MF: Removed .util package.
+ * messages.properties: Removed unused keys.
+ * ValgrindCommand.java Extracted command line options to CommandLineConstants;
+ moved output directory handling to Launch plugin.
+ * ValgrindPlugin.java: Extracted PLUGIN_ID to PluginConstants.
+
+2009-01-21 Elliott Baron <ebaron@redhat.com>
+
+ * AbstractValgrindTextParser: Moved parsePID from MassifParser.
+
+2009-01-13 Elliott Baron <ebaron@redhat.com>
+
+ * AbstractValgrindTextParser: New. Helpful starting point for text parsers.
+
+2009-01-09 Elliott Baron <ebaron@redhat.com>
+
+ * ValgrindCommand: Added static method findValgrind() to call `which valgrind`.
+
+2009-01-05 Elliott Baron <ebaron@redhat.com>
+
+ * META-INF/MANIFEST.MF: Changed version to 0.1.0.
+ * build.properties: Include about.html. \ No newline at end of file
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.core/META-INF/MANIFEST.MF b/valgrind/org.eclipse.linuxtools.valgrind.core/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..847851b7d7
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.core/META-INF/MANIFEST.MF
@@ -0,0 +1,19 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.eclipse.linuxtools.valgrind.core;singleton:=true
+Bundle-Version: 0.4.0.qualifier
+Bundle-Activator: org.eclipse.linuxtools.internal.valgrind.core.ValgrindPlugin
+Bundle-Vendor: %Bundle-Vendor.0
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Export-Package: org.eclipse.linuxtools.internal.valgrind.core,
+ org.eclipse.linuxtools.valgrind.core
+Import-Package: org.eclipse.cdt.utils,
+ org.eclipse.cdt.utils.pty,
+ org.eclipse.cdt.utils.spawner,
+ org.eclipse.core.resources,
+ org.eclipse.debug.core
+Bundle-Localization: plugin
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.core/build.properties b/valgrind/org.eclipse.linuxtools.valgrind.core/build.properties
new file mode 100644
index 0000000000..1500166975
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.core/build.properties
@@ -0,0 +1,7 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.properties,\
+ about.html,\
+ plugin.xml
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.core/plugin.properties b/valgrind/org.eclipse.linuxtools.valgrind.core/plugin.properties
new file mode 100644
index 0000000000..4b50ef51be
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.core/plugin.properties
@@ -0,0 +1,4 @@
+#Properties file for org.eclipse.linuxtools.valgrind.core
+Bundle-Vendor.0 = Eclipse Linux Tools
+Bundle-Name.0 = Valgrind Core Plug-in (Incubation)
+page.name = Valgrind \ No newline at end of file
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindCommand.java b/valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindCommand.java
new file mode 100644
index 0000000000..c7557306e8
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindCommand.java
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * 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:
+ * Elliott Baron <ebaron@redhat.com> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.valgrind.core;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.eclipse.cdt.utils.pty.PTY;
+import org.eclipse.cdt.utils.spawner.ProcessFactory;
+
+public class ValgrindCommand {
+ protected static final String WHICH_CMD = "which"; //$NON-NLS-1$
+ protected static final String VALGRIND_CMD = "valgrind"; //$NON-NLS-1$
+
+ protected Process process;
+ protected String[] args;
+
+ public String whichValgrind() throws IOException {
+ String ret;
+ // Valgrind binary location in preferences overrides default location
+ String valgrindPreferedPath = ValgrindPlugin.getDefault().getPreferenceStore().getString(ValgrindPreferencePage.VALGRIND_PATH);
+ if (valgrindPreferedPath.equals("")) {
+ // No preference, check Valgrind exists in the user's PATH
+ StringBuffer out = new StringBuffer();
+ Process p = Runtime.getRuntime().exec(WHICH_CMD + " " + VALGRIND_CMD); //$NON-NLS-1$
+ // Throws IOException if which command is unsuccessful
+ readIntoBuffer(out, p);
+ ret = out.toString().trim();
+ }
+ else {
+ ret = valgrindPreferedPath;
+ }
+ return ret;
+ }
+
+ public String whichVersion(String whichValgrind) throws IOException {
+ StringBuffer out = new StringBuffer();
+ Process p = Runtime.getRuntime().exec(new String[] { whichValgrind, CommandLineConstants.OPT_VERSION });
+ readIntoBuffer(out, p);
+ return out.toString().trim();
+ }
+
+ public void execute(String[] commandArray, String[] env, File wd, boolean usePty) throws IOException {
+ args = commandArray;
+ try {
+ if (wd == null) {
+ process = ProcessFactory.getFactory().exec(commandArray, env);
+ }
+ else {
+ if (PTY.isSupported() && usePty) {
+ process = ProcessFactory.getFactory().exec(commandArray, env, wd, new PTY());
+ }
+ else {
+ process = ProcessFactory.getFactory().exec(commandArray, env, wd);
+ }
+ }
+ }
+ catch (IOException e) {
+ if (process != null) {
+ process.destroy();
+ }
+ throw e;
+ }
+ }
+
+ public Process getProcess() {
+ return process;
+ }
+
+ public String getCommandLine() {
+ StringBuffer ret = new StringBuffer();
+ for (String arg : args) {
+ ret.append(arg + " "); //$NON-NLS-1$
+ }
+ return ret.toString().trim();
+ }
+
+ protected void readIntoBuffer(StringBuffer out, Process p) throws IOException {
+ boolean success;
+ InputStream in;
+ try {
+ if (success = (p.waitFor() == 0)) {
+ in = p.getInputStream();
+ }
+ else {
+ in = p.getErrorStream();
+ }
+ int ch;
+ while ((ch = in.read()) != -1) {
+ out.append((char) ch);
+ }
+ if (!success) {
+ throw new IOException(out.toString());
+ }
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindPlugin.java b/valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindPlugin.java
new file mode 100644
index 0000000000..52085040f9
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindPlugin.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * 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:
+ * Elliott Baron <ebaron@redhat.com> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.valgrind.core;
+
+import java.io.IOException;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+public class ValgrindPlugin extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = PluginConstants.CORE_PLUGIN_ID;
+
+ // The shared instance
+ private static ValgrindPlugin plugin;
+
+ /**
+ * The constructor
+ */
+ public ValgrindPlugin() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static ValgrindPlugin getDefault() {
+ return plugin;
+ }
+
+
+ @Override
+ protected void initializeDefaultPreferences(IPreferenceStore store) {
+ ValgrindCommand valCommand = new ValgrindCommand();
+ try {
+ store.setDefault(ValgrindPreferencePage.VALGRIND_PATH, valCommand.whichValgrind());
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+}
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindPreferencePage.java b/valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindPreferencePage.java
new file mode 100644
index 0000000000..2ddfe6c4dc
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindPreferencePage.java
@@ -0,0 +1,150 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * 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:
+ * Red Hat - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.valgrind.core;
+
+import java.io.File;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+/**
+ * The Valgrind Preference Page can be found by going to Windows -> Preferences
+ * from the Eclipse top menu bar. This can hold all non-launch specific
+ * configuration settings or user preferences.
+ */
+public class ValgrindPreferencePage extends PreferencePage implements
+ IWorkbenchPreferencePage {
+
+ public static final String VALGRIND_PATH = "VALGRIND_PATH"; //$NON-NLS-1$
+ private Text binText;
+ private Button button;
+ private IPreferenceStore store;
+
+ @Override
+ protected Control createContents(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NULL);
+
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 3;
+ composite.setLayout(layout);
+
+ GridData data = new GridData();
+ data.verticalAlignment = SWT.FILL;
+ data.horizontalAlignment = SWT.FILL;
+ data.grabExcessHorizontalSpace = true;
+ data.grabExcessVerticalSpace = true;
+ composite.setLayoutData(data);
+
+ // Path Label
+ Label pathLabel = new Label(composite, SWT.NONE);
+ pathLabel.setText(Messages
+ .getString("ValgrindPreferencePage.Binary_path")); //$NON-NLS-1$
+
+ // Path Text Field
+ binText = new Text(composite, SWT.SINGLE | SWT.BORDER);
+ GridData binTextData = new GridData();
+ binTextData.horizontalAlignment = SWT.FILL;
+ binTextData.grabExcessHorizontalSpace = true;
+ binText.setLayoutData(binTextData);
+
+ // Button
+ button = new Button(composite, SWT.PUSH);
+ button.setText(Messages
+ .getString("ValgrindPreferencePage.Browse_button")); //$NON-NLS-1$
+ button.addSelectionListener(new SelectionListener() {
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // TODO Auto-generated method stub
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ Shell shell = new Shell();
+ FileDialog dialog = new FileDialog(shell);
+ String path = dialog.open();
+ if (path != null) {
+ binText.setText(path);
+ }
+ }
+ });
+
+ loadPreferences();
+ return parent;
+ }
+
+ // Loading preferences into controls
+ private void loadPreferences() {
+ binText.setText(store.getString(VALGRIND_PATH));
+ }
+
+ // Get the PreferenceStore for this Plugin
+ @Override
+ protected IPreferenceStore doGetPreferenceStore() {
+ return ValgrindPlugin.getDefault().getPreferenceStore();
+ }
+
+ // Initialization (Before Creating Widgets)
+ public void init(IWorkbench workbench) {
+ store = getPreferenceStore();
+ }
+
+ @Override
+ protected void performDefaults() {
+ super.performDefaults();
+ store.setValue(VALGRIND_PATH, store.getDefaultString(VALGRIND_PATH));
+ binText.setText(store.getDefaultString(VALGRIND_PATH));
+ }
+
+ @Override
+ public boolean performOk() {
+ if (passesValidityChecks()) {
+ ValgrindPlugin.getDefault().savePluginPreferences();
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ private boolean passesValidityChecks() {
+ // Check the Binary Path is valid
+ File file = new File(binText.getText());
+ // Can be more strict if necessary
+ if (file.exists() && !file.isDirectory()) {
+ store.setValue(VALGRIND_PATH, binText.getText());
+ } else {
+ performDefaults();
+ Shell shell = new Shell();
+ MessageDialog
+ .openError(
+ shell,
+ Messages.getString("ValgrindPreferencePage.Error_invalid_title"), //$NON-NLS-1$
+ Messages.getString("ValgrindPreferencePage.Error_invalid_message")); //$NON-NLS-1$
+ return false;
+ }
+
+ return true;
+ }
+
+} \ No newline at end of file
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/messages.properties b/valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/messages.properties
new file mode 100644
index 0000000000..5495d351ad
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/messages.properties
@@ -0,0 +1,5 @@
+AbstractValgrindTextParser.Parsing_output_failed=Parsing output failed on line: {0}
+ValgrindPreferencePage.Binary_path=Location of Valgrind binary:
+ValgrindPreferencePage.Browse_button=&Browse...
+ValgrindPreferencePage.Error_invalid_message=The binary path specified is not valid. Please choose a valid binary.
+ValgrindPreferencePage.Error_invalid_title=Invalid Binary Path
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.doc/ChangeLog b/valgrind/org.eclipse.linuxtools.valgrind.doc/ChangeLog
new file mode 100644
index 0000000000..8a138dda1d
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.doc/ChangeLog
@@ -0,0 +1,72 @@
+2010-04-19 Elliott Baron <ebaron@fedoraproject.org>
+
+ * userguide/General-Usage.html: Regenerated to include Mac OSX info.
+ * userguide/Valgrind\ Reference-toc.xml: Likewise.
+ * userguide/Valgrind\ Reference.xml: Likewise.
+
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ Bug #285861
+
+ * plugin.properties: Change Provider to Eclipse.
+
+2009-06-26 Elliott Baron <ebaron@redhat.com>
+
+ * userguide/General-Usage.html: New file.
+ * userguide/images/Exportbuttonvalgrindview.gif: New file.
+ * userguide/Installing.html: New file.
+ * userguide/Special-Cases.html: New file.
+ * userguide/Using-Cachegrind.html: New file.
+ * userguide/Using-Massif.html: New file.
+ * userguide/Using-Memcheck.html: New file.
+ * userguide/Updating-This-Document.html: Regenerated documentation.
+ * userguide/Valgrind\ Reference-toc.xml: Likewise.
+ * userguide/Valgrind\ Reference.html: Likewise.
+ * userguide/Valgrind\ Reference.xml: Likewise.
+
+2009-06-18 Elliott Baron <ebaron@redhat.com>
+
+ * build-helper.xml: Added call to wikitext-to-docbook target.
+ * META-INF/MANIFEST.MF: New dep for Eclipse help.
+ * plugin.xml: New extension for Eclipse help.
+ * userguide/images/Screenshot-ProfileConfigurations.png: Retook screenshot.
+ * userguide/Valgrind Reference.xml: Generated docbook.
+
+2009-05-28 Elliott Baron <ebaron@redhat.com>
+
+ * .classpath: New file.
+ * .project: New file.
+ * .settings/org.eclipse.jdt.core.prefs: New file.
+ * about.html: New file.
+ * build-helper.xml: New file.
+ * build.properties: New file.
+ * doc/notices.html: New file.
+ * extract-markup.xsl: New file.
+ * META-INF/MANIFEST.MF: New file.
+ * plugin.properties: New file.
+ * plugin.xml: New file.
+ * src/org/eclipse/linuxtools/internal/valgrind/doc/anttask/MediaWikiImageFetcher.java: New file.
+ * src/org/eclipse/linuxtools/internal/valgrind/doc/anttask/tasks.properties: New file.
+ * toc.xml: New file.
+ * userguide/images/CachegrindOptions.png: New file.
+ * userguide/images/CachegrindOutput.png: New file.
+ * userguide/images/exportbuttonvalgrindview.png: New file.
+ * userguide/images/MassifChartSelect.png: New file.
+ * userguide/images/MassifOptions.png: New file.
+ * userguide/images/MassifTable.png: New file.
+ * userguide/images/MassifTree.png: New file.
+ * userguide/images/MemcheckOptions.png: New file.
+ * userguide/images/MemcheckOutput.png: New file.
+ * userguide/images/Screenshot-ProfileConfigurations-valgrind-options-tab.png: New file.
+ * userguide/images/Screenshot-ProfileConfigurations.png: New file.
+ * userguide/images/Screenshot-Suppressions.png: New file.
+ * userguide/images/Shortcut.png: New file.
+ * userguide/images/SwitchCachegrind.png: New file.
+ * userguide/images/SwitchCoreTool.png: New file.
+ * userguide/images/SwitchMassif.png: New file.
+ * userguide/images/Thread.gif: New file.
+ * userguide/images/ValgrindExportWizard.png: New file.
+ * userguide/images/ValgrindSegfault.png: New file.
+ * userguide/Updating-This-Document.html: New file.
+ * userguide/Valgrind\ Reference-toc.xml: New file.
+ * userguide/Valgrind\ Reference.html: New file. \ No newline at end of file
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.doc/META-INF/MANIFEST.MF b/valgrind/org.eclipse.linuxtools.valgrind.doc/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..92e5a06f9b
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.doc/META-INF/MANIFEST.MF
@@ -0,0 +1,11 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.eclipse.linuxtools.valgrind.doc;singleton:=true
+Bundle-Version: 0.4.0.qualifier
+Bundle-ActivationPolicy: lazy
+Bundle-Vendor: %Bundle-Vendor
+Require-Bundle: org.apache.ant;bundle-version="1.7.0";resolution:=optional,
+ org.eclipse.help
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Localization: plugin
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.doc/plugin.properties b/valgrind/org.eclipse.linuxtools.valgrind.doc/plugin.properties
new file mode 100644
index 0000000000..7992586d8b
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.doc/plugin.properties
@@ -0,0 +1,3 @@
+Bundle-Vendor = Eclipse Linux Tools
+Bundle-Name = Valgrind Documentation (Incubation)
+extension.name.0 = Valgrind \ No newline at end of file
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.doc/userguide/General-Usage.html b/valgrind/org.eclipse.linuxtools.valgrind.doc/userguide/General-Usage.html
new file mode 100644
index 0000000000..4874f8d453
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.doc/userguide/General-Usage.html
@@ -0,0 +1,215 @@
+<?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <title>Valgrind Reference - General Usage</title>
+ <link type="text/css" rel="stylesheet" href="book.css"/>
+ </head>
+ <body>
+ <table class="navigation" style="width: 100%;" border="0" summary="navigation">
+ <tr>
+ <th style="width: 100%" align="center" colspan="3">General Usage</th>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left">
+ <a href="Installing.html" title="Installing">
+ <img alt="Previous" border="0" src="images/images/prev.gif"/>
+ </a>
+ </td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right">
+ <a href="Using-Memcheck.html" title="Using Memcheck">
+ <img alt="Next" border="0" src="images/images/next.gif"/>
+ </a>
+ </td>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left" valign="top">Installing</td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right" valign="top">Using Memcheck</td>
+ </tr>
+ </table><hr/>
+ <h1 id="General_Usage">General Usage</h1>
+ <p>You can use the Valgrind plug-in's "one-click launch" shortcut to run a default profile. Doing so is similar to running <code>valgrind ./<i>program_name</i></code> from the command line. To use the one-click launch shortcut, right-click on the
+ <i>project</i> or
+ <i>binary</i> name in the
+ <b>
+ <i>Project Explorer</i>
+ </b> window and navigate to <u>Profile As</u> > <u>Profile With Valgrind</u>. If a source file belonging to that program is available on any open editor, you can also right-click inside the editor to navigate to the one-click launch.
+
+ <br/>
+ <img border="0" src="images/Shortcut.png"/>
+ </p>
+ <h2 id="Configuring_a_Profile_Run">Configuring a Profile Run</h2>
+ <p>To configure a Valgrind profile run, navigate to <u>Profile As</u> > <u>Profile Configurations</u> to access the
+ <b>
+ <i>Profile Configurations</i>
+ </b> menu.
+ <br/>
+ <img border="0" src="images/Screenshot-ProfileConfigurations.png"/>
+ </p>
+ <p>The
+ <b>
+ <i>Profile Configurations</i>
+ </b> menu allows you to configure a profile run with some basic Valgrind profiling options, along with the most useful options for each Valgrind tool. These settings can be configured in the
+ <b>
+ <i>Valgrind Options</i>
+ </b> tab of a specific profile run.
+
+ <br/>
+ <img border="0" src="images/Screenshot-ProfileConfigurations-valgrind-options-tab.png"/>
+ </p>
+ <h3 id="General_Options">General Options</h3>
+ <p>The
+ <b>
+ <i>General Options</i>
+ </b> tab allows you to configure the following options:
+ </p>
+ <ul>
+ <li>
+ <b>
+ <i>Tool to run</i>
+ </b> allows you to choose between
+ <a href="Using-Memcheck.html#Using_Memcheck">Memcheck</a>,
+ <a href="Using-Massif.html#Using_Massif">Massif</a>, and
+ <a href="Using-Cachegrind.html#Using_Cachegrind">Cachegrind</a> in your profile run. By default, using the one-click shortcut will run the
+ <a href="Using-Memcheck.html#Using_Memcheck">Memcheck</a> tool.
+ </li>
+ <li>
+ <b>
+ <i>Trace children on exec</i>
+ </b> configures whether or not to trace into sub-processes initiated via the <code>exec</code> system call. This is identical to using the <code>--trace-children=</code> option. This is disabled by default.
+ <br/>For more details on the use of the
+ <b>
+ <i>Trace children on exec</i>
+ </b> option for each Valgrind tool, refer to
+ <a href="Special-Cases.html#Profiling_Child_Processes">Profiling Child Processes</a>.
+ </li>
+ <li>
+ <b>
+ <i>Run __libc_freeres on exit</i>
+ </b> configures whether or not to run a <code>__libc_freeres</code> routine after the profile run exits. This routine instructs <code>glibc</code> to release all memory it has allocated, and is similar to using the <code>--run-libc-freeres=</code> option. This is enabled by default.
+ </li>
+ <li>
+ <b>
+ <i>Child silent after fork</i>
+ </b> is enabled by default, and in most cases cannot be configured. This option disables any debugging or logging output from child processes created from a <code>fork</code> call.
+ </li>
+ <li>
+ <b>
+ <i>Demangle C++ names</i>
+ </b> allows Valgrind to translate encoded C++ names ("mangled" by <code>g++</code> during compilation) back to something similar to their original form. This is enabled by default.
+ </li>
+ <li>
+ <b>
+ <i>Limit errors reported</i>
+ </b> instructs Valgrind to stop reporting errors after a total of 10,000,000 actual errors or 1,000 unique errors have been detected. This is enabled by default.
+ </li>
+ <li>
+ <b>
+ <i>Callers in stack trace</i>
+ </b> configures how many levels of function call names Valgrind should use to identify program locations. By default, Valgrind uses 12 levels.
+ </li>
+ <li>
+ <b>
+ <i>Show errors below main</i>
+ </b> configures stack traces for errors should show any functions that appear beneath <code>main()</code>. This is disabled by default.
+ </li>
+ <li>
+ <b>
+ <i>Max stack frame size</i>
+ </b> is the maximum size of a stack frame, and is set to 2000000 by default.
+ </li>
+ </ul>
+ <p>For more information about these options, refer to <code>man valgrind</code>.</p>
+ <h3 id="Suppressions">Suppressions</h3>
+ <p>You can also configure your profile run to use a suppressions file (similar to the <code>--suppressions=</code> option. To do this, click the
+ <b>
+ <i>Suppressions</i>
+ </b> tab.
+
+ <br/>
+ <img border="0" src="images/Screenshot-Suppressions.png"/>
+ </p>
+ <p>The <u>Workspace</u> button allows you to select a resource from the workspace as your suppressions file. To use a suppressions file outisde of the workspace, use the <u>File System</u> button.</p>
+ <h2 id="Exporting_Valgrind_Data">Exporting Valgrind Data</h2>
+ <p>To export the raw data collected during a Valgrind profile run, use the
+ <b>
+ <i>Export</i>
+ </b> wizard menu. To access the
+ <b>
+ <i>Export</i>
+ </b> wizard menu, navigate to <u>File</u> > <u>Export</u> and select <u>Valgrind Log Files</u> under the category <u>Other</u>.
+ </p>
+ <p>
+ <br/>
+ <img border="0" src="images/ValgrindExportWizard.png"/>
+ </p>
+ <p>Alternatively, you can also use the <u>Export Valgrind Log Files</u> icon (
+ <img border="0" src="images/Exportbuttonvalgrindview.gif"/> ) on the Valgrind view toolbar to access the
+ <b>
+ <i>Export</i>
+ </b> wizard menu.
+ </p>
+ <h2 id="Other_Operating_Systems">Other Operating Systems</h2>
+ <p>The Valgrind Eclipse plugins were designed and tested on Linux systems only. However, the Valgrind tools are also available on Mac OS X and so too are the Linux Tools Eclipse Valgrind plugins. The plugins are not officially supported on Mac OS X, but here are instructions to get it working.</p>
+ <h3 id="Mac_OS_X_10.6">Mac OS X 10.6</h3>
+ <p>As of Apr 19, 2010 the official release of the Valgrind tool does not work on 10.6. However, there are patches available to make it work.</p>
+ <p>Brief instructions to compile the Valgrind tool is here:
+ <a href="http://code.google.com/p/data-race-test/wiki/ValgrindOnSnowLeopard">http://code.google.com/p/data-race-test/wiki/ValgrindOnSnowLeopard</a>
+ </p>
+ <p>Essentially, you need to run the following script. (Ensure you have wget installed)</p>
+ <pre> svn co -r 11104 svn://svn.valgrind.org/valgrind/trunk valgrind
+ cd valgrind
+ wget http://bugs.kde.org/attachment.cgi?id=40091 -O snow-leopard.patch
+ wget http://bugsfiles.kde.org/attachment.cgi?id=40900 -O arc4random.patch
+ wget http://bugsfiles.kde.org/attachment.cgi?id=42530 -O sidt.patch
+ wget http://bugsfiles.kde.org/attachment.cgi?id=42892 -O signal.patch
+ patch -p0 &lt; snow-leopard.patch
+ patch -p0 &lt; arc4random.patch
+ patch -p1 &lt; signal.patch
+ cd VEX; patch -p0 &lt; ../sidt.patch ; cd ..
+ touch darwin10-drd.supp
+ touch darwin10.supp
+ ./autogen.sh || autoreconf -fvi
+ ./configure --prefix=`pwd`/inst
+ make -j 8 &amp;&amp; make install
+</pre>
+ <p>Once this is done, see instructions below for other Mac OS's</p>
+ <h3 id="x86_64_Mac_OS">x86_64 Mac OS</h3>
+ <p>Valgrind is only compatible with x86 binaries on Mac OS, so if you have x86_64 you'll need to ensure that x86 binaries are being built. To do this, right click on the project and select Properties. </p>
+ <p>Within the Properties window, select C/C++ Build then add '-m32' to the Command field for the MacOS X C++ Linker, GCC C++ Compiler and GCC C Compiler. This will cause x86 binaries to be created.</p>
+ <h3 id="Other_Mac_OS">Other Mac OS</h3>
+ <p>Ensure you have a release of the Valgrind command-line tool installed. See
+ <a href="http://valgrind.org/">http://valgrind.org/</a>.
+ </p>
+ <p>After installing, you will need to create a symlink to /usr/bin/valgrind. </p>
+ <p>Use <code>which valgrind</code> to find the install location of the Valgrind binary. </p>
+ <p><code>ln -s /usr/bin/valgrind /location/of/valgrind</code> will create the symlink.</p>
+ <p>After that, the Eclipse Valgrind plugin should work as specified in other parts of this wiki page.</p><hr/>
+ <table class="navigation" style="width: 100%;" border="0" summary="navigation">
+ <tr>
+ <td style="width: 20%" align="left">
+ <a href="Installing.html" title="Installing">
+ <img alt="Previous" border="0" src="images/images/prev.gif"/>
+ </a>
+ </td>
+ <td style="width: 60%" align="center">
+ <a href="Valgrind Reference.html" title="Valgrind Reference">
+ <img alt="Valgrind Reference" border="0" src="images/images/home.gif"/>
+ </a>
+ </td>
+ <td style="width: 20%" align="right">
+ <a href="Using-Memcheck.html" title="Using Memcheck">
+ <img alt="Next" border="0" src="images/images/next.gif"/>
+ </a>
+ </td>
+ </tr>
+ <tr>
+ <td style="width: 20%" align="left" valign="top">Installing</td>
+ <td style="width: 60%" align="center"></td>
+ <td style="width: 20%" align="right" valign="top">Using Memcheck</td>
+ </tr>
+ </table>
+ </body>
+</html> \ No newline at end of file
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.doc/userguide/Valgrind Reference-toc.xml b/valgrind/org.eclipse.linuxtools.valgrind.doc/userguide/Valgrind Reference-toc.xml
new file mode 100644
index 0000000000..66e0f6ea6c
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.doc/userguide/Valgrind Reference-toc.xml
@@ -0,0 +1,34 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<toc topic="userguide/Valgrind Reference.html" label="Valgrind Reference">
+ <topic href="userguide/Valgrind Reference.html" label="Overview"></topic>
+ <topic href="userguide/Installing.html" label="Installing"></topic>
+ <topic href="userguide/General-Usage.html" label="General Usage">
+ <topic href="userguide/General-Usage.html#Configuring_a_Profile_Run" label="Configuring a Profile Run">
+ <topic href="userguide/General-Usage.html#General_Options" label="General Options"></topic>
+ <topic href="userguide/General-Usage.html#Suppressions" label="Suppressions"></topic>
+ </topic>
+ <topic href="userguide/General-Usage.html#Exporting_Valgrind_Data" label="Exporting Valgrind Data"></topic>
+ <topic href="userguide/General-Usage.html#Other_Operating_Systems" label="Other Operating Systems">
+ <topic href="userguide/General-Usage.html#Mac_OS_X_10.6" label="Mac OS X 10.6"></topic>
+ <topic href="userguide/General-Usage.html#x86_64_Mac_OS" label="x86_64 Mac OS"></topic>
+ <topic href="userguide/General-Usage.html#Other_Mac_OS" label="Other Mac OS"></topic>
+ </topic>
+ </topic>
+ <topic href="userguide/Using-Memcheck.html" label="Using Memcheck">
+ <topic href="userguide/Using-Memcheck.html#Analyzing_Memcheck_Profile_Results" label="Analyzing Memcheck Profile Results"></topic>
+ <topic href="userguide/Using-Memcheck.html#Configuring_a_Memcheck_Profile_Run" label="Configuring a Memcheck Profile Run"></topic>
+ </topic>
+ <topic href="userguide/Using-Massif.html" label="Using Massif">
+ <topic href="userguide/Using-Massif.html#Analyzing_Massif_Profile_Results" label="Analyzing Massif Profile Results"></topic>
+ <topic href="userguide/Using-Massif.html#Configuring_a_Massif_Profile_Run" label="Configuring a Massif Profile Run"></topic>
+ </topic>
+ <topic href="userguide/Using-Cachegrind.html" label="Using Cachegrind">
+ <topic href="userguide/Using-Cachegrind.html#Analyzing_Cachegrind_Profile_Results" label="Analyzing Cachegrind Profile Results"></topic>
+ <topic href="userguide/Using-Cachegrind.html#Configuring_a_Cachegrind_Profile_Run" label="Configuring a Cachegrind Profile Run"></topic>
+ </topic>
+ <topic href="userguide/Special-Cases.html" label="Special Cases">
+ <topic href="userguide/Special-Cases.html#Encountering_Errors" label="Encountering Errors"></topic>
+ <topic href="userguide/Special-Cases.html#Profiling_Child_Processes" label="Profiling Child Processes"></topic>
+ </topic>
+ <topic href="userguide/Updating-This-Document.html" label="Updating This Document"></topic>
+</toc> \ No newline at end of file
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.doc/userguide/Valgrind Reference.xml b/valgrind/org.eclipse.linuxtools.valgrind.doc/userguide/Valgrind Reference.xml
new file mode 100644
index 0000000000..3cf3876eee
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.doc/userguide/Valgrind Reference.xml
@@ -0,0 +1,739 @@
+<?xml version='1.0' ?><!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<book>
+ <title>Valgrind Reference</title>
+ <chapter id="Overview">
+ <title>Overview</title>
+ <para>
+ <emphasis role="bold">Valgrind</emphasis> is an instrumentation framework for building dynamic analysis tools that can be used to profile applications in detail. Valgrind tools are generally used to automatically detect many memory management and threading problems. The Valgrind suite also includes tools that allow you to build new profiling tools to suit your needs.
+ </para>
+ <para>The Valgrind plug-in for Eclipse (documented herein) integrates several Valgrind tools into Eclipse. This allows Eclipse users to seamlessly include profiling capabilities into their workflow. At present, the Valgrind plug-in for Eclipse supports three Valgrind tools:
+ <link linkend="Using_Memcheck">Memcheck</link>,
+ <link linkend="Using_Massif">Massif</link>, and
+ <link linkend="Using_Cachegrind">Cachegrind</link>.
+ </para>
+ <para>For more information about Valgrind, refer to
+ <ulink url="http://www.valgrind.org/">http://www.valgrind.org/</ulink>.
+ </para>
+ </chapter>
+ <chapter id="Installing">
+ <title>Installing</title>
+ <para>In order for the Valgrind plug-in for Eclipse to work properly, you should have the
+ <emphasis role="italic">valgrind-3.3.0</emphasis> (or later) package installed on your system first.
+ </para>
+ <para>Once the
+ <emphasis role="italic">valgrind</emphasis> package is installed, the easiest way to install the Valgrind plug-in for Eclipse is through the
+ <emphasis role="bold">
+ <emphasis role="italic">Software Updates and Add-ons</emphasis>
+ </emphasis> menu. For information on how to use this menu, refer to
+ <ulink url="http://wiki.eclipse.org/Linux_Tools_Project/PluginInstallHelp#Installing_Updates_From_the_Linux_Tools_Update_Site">this link</ulink>.
+ </para>
+ </chapter>
+ <chapter id="General_Usage">
+ <title>General Usage</title>
+ <para>You can use the Valgrind plug-in's "one-click launch" shortcut to run a default profile. Doing so is similar to running <code>valgrind ./<i>program_name</i></code> from the command line. To use the one-click launch shortcut, right-click on the
+ <emphasis role="italic">project</emphasis> or
+ <emphasis role="italic">binary</emphasis> name in the
+ <emphasis role="bold">
+ <emphasis role="italic">Project Explorer</emphasis>
+ </emphasis> window and navigate to <u>Profile As</u> > <u>Profile With Valgrind</u>. If a source file belonging to that program is available on any open editor, you can also right-click inside the editor to navigate to the one-click launch.
+
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="Shortcut.png"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <section id="Configuring_a_Profile_Run">
+ <title>Configuring a Profile Run</title>
+ <para>To configure a Valgrind profile run, navigate to <u>Profile As</u> > <u>Profile Configurations</u> to access the
+ <emphasis role="bold">
+ <emphasis role="italic">Profile Configurations</emphasis>
+ </emphasis> menu.
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="Screenshot-ProfileConfigurations.png"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <para>The
+ <emphasis role="bold">
+ <emphasis role="italic">Profile Configurations</emphasis>
+ </emphasis> menu allows you to configure a profile run with some basic Valgrind profiling options, along with the most useful options for each Valgrind tool. These settings can be configured in the
+ <emphasis role="bold">
+ <emphasis role="italic">Valgrind Options</emphasis>
+ </emphasis> tab of a specific profile run.
+
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="Screenshot-ProfileConfigurations-valgrind-options-tab.png"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <section id="General_Options">
+ <title>General Options</title>
+ <para>The
+ <emphasis role="bold">
+ <emphasis role="italic">General Options</emphasis>
+ </emphasis> tab allows you to configure the following options:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ <emphasis role="italic">Tool to run</emphasis>
+ </emphasis> allows you to choose between
+ <link linkend="Using_Memcheck">Memcheck</link>,
+ <link linkend="Using_Massif">Massif</link>, and
+ <link linkend="Using_Cachegrind">Cachegrind</link> in your profile run. By default, using the one-click shortcut will run the
+ <link linkend="Using_Memcheck">Memcheck</link> tool.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ <emphasis role="italic">Trace children on exec</emphasis>
+ </emphasis> configures whether or not to trace into sub-processes initiated via the <code>exec</code> system call. This is identical to using the <code>--trace-children=</code> option. This is disabled by default.
+ For more details on the use of the
+ <emphasis role="bold">
+ <emphasis role="italic">Trace children on exec</emphasis>
+ </emphasis> option for each Valgrind tool, refer to
+ <link linkend="Profiling_Child_Processes">Profiling Child Processes</link>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ <emphasis role="italic">Run __libc_freeres on exit</emphasis>
+ </emphasis> configures whether or not to run a <code>__libc_freeres</code> routine after the profile run exits. This routine instructs <code>glibc</code> to release all memory it has allocated, and is similar to using the <code>--run-libc-freeres=</code> option. This is enabled by default.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ <emphasis role="italic">Child silent after fork</emphasis>
+ </emphasis> is enabled by default, and in most cases cannot be configured. This option disables any debugging or logging output from child processes created from a <code>fork</code> call.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ <emphasis role="italic">Demangle C++ names</emphasis>
+ </emphasis> allows Valgrind to translate encoded C++ names ("mangled" by <code>g++</code> during compilation) back to something similar to their original form. This is enabled by default.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ <emphasis role="italic">Limit errors reported</emphasis>
+ </emphasis> instructs Valgrind to stop reporting errors after a total of 10,000,000 actual errors or 1,000 unique errors have been detected. This is enabled by default.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ <emphasis role="italic">Callers in stack trace</emphasis>
+ </emphasis> configures how many levels of function call names Valgrind should use to identify program locations. By default, Valgrind uses 12 levels.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ <emphasis role="italic">Show errors below main</emphasis>
+ </emphasis> configures stack traces for errors should show any functions that appear beneath <code>main()</code>. This is disabled by default.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ <emphasis role="italic">Max stack frame size</emphasis>
+ </emphasis> is the maximum size of a stack frame, and is set to 2000000 by default.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>For more information about these options, refer to <code>man valgrind</code>.</para>
+ </section>
+ <section id="Suppressions">
+ <title>Suppressions</title>
+ <para>You can also configure your profile run to use a suppressions file (similar to the <code>--suppressions=</code> option. To do this, click the
+ <emphasis role="bold">
+ <emphasis role="italic">Suppressions</emphasis>
+ </emphasis> tab.
+
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="Screenshot-Suppressions.png"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <para>The <u>Workspace</u> button allows you to select a resource from the workspace as your suppressions file. To use a suppressions file outisde of the workspace, use the <u>File System</u> button.</para>
+ </section>
+ </section>
+ <section id="Exporting_Valgrind_Data">
+ <title>Exporting Valgrind Data</title>
+ <para>To export the raw data collected during a Valgrind profile run, use the
+ <emphasis role="bold">
+ <emphasis role="italic">Export</emphasis>
+ </emphasis> wizard menu. To access the
+ <emphasis role="bold">
+ <emphasis role="italic">Export</emphasis>
+ </emphasis> wizard menu, navigate to <u>File</u> > <u>Export</u> and select <u>Valgrind Log Files</u> under the category <u>Other</u>.
+ </para>
+ <para>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="ValgrindExportWizard.png"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <para>Alternatively, you can also use the <u>Export Valgrind Log Files</u> icon (
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="Exportbuttonvalgrindview.gif"/>
+ </imageobject>
+ </mediaobject> ) on the Valgrind view toolbar to access the
+ <emphasis role="bold">
+ <emphasis role="italic">Export</emphasis>
+ </emphasis> wizard menu.
+ </para>
+ </section>
+ <section id="Other_Operating_Systems">
+ <title>Other Operating Systems</title>
+ <para>The Valgrind Eclipse plugins were designed and tested on Linux systems only. However, the Valgrind tools are also available on Mac OS X and so too are the Linux Tools Eclipse Valgrind plugins. The plugins are not officially supported on Mac OS X, but here are instructions to get it working.</para>
+ <section id="Mac_OS_X_10.6">
+ <title>Mac OS X 10.6</title>
+ <para>As of Apr 19, 2010 the official release of the Valgrind tool does not work on 10.6. However, there are patches available to make it work.</para>
+ <para>Brief instructions to compile the Valgrind tool is here:
+ <ulink url="http://code.google.com/p/data-race-test/wiki/ValgrindOnSnowLeopard">http://code.google.com/p/data-race-test/wiki/ValgrindOnSnowLeopard</ulink>
+ </para>
+ <para>Essentially, you need to run the following script. (Ensure you have wget installed)</para>
+ <literallayout> svn co -r 11104 svn://svn.valgrind.org/valgrind/trunk valgrind
+ cd valgrind
+ wget http://bugs.kde.org/attachment.cgi?id=40091 -O snow-leopard.patch
+ wget http://bugsfiles.kde.org/attachment.cgi?id=40900 -O arc4random.patch
+ wget http://bugsfiles.kde.org/attachment.cgi?id=42530 -O sidt.patch
+ wget http://bugsfiles.kde.org/attachment.cgi?id=42892 -O signal.patch
+ patch -p0 &lt; snow-leopard.patch
+ patch -p0 &lt; arc4random.patch
+ patch -p1 &lt; signal.patch
+ cd VEX; patch -p0 &lt; ../sidt.patch ; cd ..
+ touch darwin10-drd.supp
+ touch darwin10.supp
+ ./autogen.sh || autoreconf -fvi
+ ./configure --prefix=`pwd`/inst
+ make -j 8 &amp;&amp; make install
+</literallayout>
+ <para>Once this is done, see instructions below for other Mac OS's</para>
+ </section>
+ <section id="x86_64_Mac_OS">
+ <title>x86_64 Mac OS</title>
+ <para>Valgrind is only compatible with x86 binaries on Mac OS, so if you have x86_64 you'll need to ensure that x86 binaries are being built. To do this, right click on the project and select Properties. </para>
+ <para>Within the Properties window, select C/C++ Build then add '-m32' to the Command field for the MacOS X C++ Linker, GCC C++ Compiler and GCC C Compiler. This will cause x86 binaries to be created.</para>
+ </section>
+ <section id="Other_Mac_OS">
+ <title>Other Mac OS</title>
+ <para>Ensure you have a release of the Valgrind command-line tool installed. See
+ <ulink url="http://valgrind.org/">http://valgrind.org/</ulink>.
+ </para>
+ <para>After installing, you will need to create a symlink to /usr/bin/valgrind. </para>
+ <para>Use <code>which valgrind</code> to find the install location of the Valgrind binary. </para>
+ <para><code>ln -s /usr/bin/valgrind /location/of/valgrind</code> will create the symlink.</para>
+ <para>After that, the Eclipse Valgrind plugin should work as specified in other parts of this wiki page.</para>
+ </section>
+ </section>
+ </chapter>
+ <chapter id="Using_Memcheck">
+ <title>Using Memcheck</title>
+ <para>Memcheck is the default tool used by Valgrind and the Valgrind plug-in for Eclipse. It allows you to detect memory-related problems such as memory leaks, use of uninitialized memory, and reads from/writes to inappropriate stack areas. For more information about Memcheck, refer to
+ <ulink url="http://www.valgrind.org/docs/manual/mc-manual.html">http://www.valgrind.org/docs/manual/mc-manual.html</ulink>.
+ </para>
+ <section id="Analyzing_Memcheck_Profile_Results">
+ <title>Analyzing Memcheck Profile Results</title>
+ <para>Any memory management errors detected by Memcheck are displayed in the Valgrind view, which appears automatically after a profile run. Each displayed error can be expanded in the Valgrind view to display its stack trace. </para>
+ <para>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="MemcheckOutput.png"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <para>In some cases, Memcheck can determine which section of the source code causes a reported error. Whenever this is the case, double-clicking on the stack trace of the reported error will open the related source file and place the insertion point on the line responsible for the error. </para>
+ </section>
+ <section id="Configuring_a_Memcheck_Profile_Run">
+ <title>Configuring a Memcheck Profile Run</title>
+ <para>To configure a Memcheck profile run, navigate to <u>Profile As</u> > <u>Profile Configurations</u> to access the
+ <emphasis role="bold">
+ <emphasis role="italic">Profile Configurations</emphasis>
+ </emphasis> menu. In the
+ <emphasis role="bold">
+ <emphasis role="italic">Valgrind Options</emphasis>
+ </emphasis> tab, navigate further to
+ <emphasis role="bold">
+ <emphasis role="italic">Memcheck Options</emphasis>
+ </emphasis>.
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="MemcheckOptions.png"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <para>The
+ <emphasis role="bold">
+ <emphasis role="italic">Memcheck Options</emphasis>
+ </emphasis> tab allows you to configure the following Memcheck options:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ <emphasis role="italic">leak resolution</emphasis>
+ </emphasis> sets how tolerant Memcheck should be in considering different stack traces to be the same. The default setting is "low", which means only the first two entries need to match. The "med" setting requires four entries to declare a match. The "high" setting requires all entries to declare match.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ <emphasis role="italic">freelist size (blocks)</emphasis>
+ </emphasis> is identical to the Memcheck command-line option <code>--freelist-vol=</code>, which specifies the maximum total size (in bytes) of memory blocks to be marked "inaccessible" once they have been freed using <code>free</code> (as in C) or <code>delete</code> (as in C++). The default value for
+ <emphasis role="bold">
+ <emphasis role="italic">freelist size (blocks)</emphasis>
+ </emphasis> is 10000000.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ <emphasis role="italic">minimum heap block alignment</emphasis>
+ </emphasis> is identical to the Memcheck command-line option <code>--alignment=</code>, which specifies the minimum alignment/size of heap blocks. The default value for this option is 8.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ <emphasis role="italic">show reachable blocks</emphasis>
+ </emphasis> configures whether or not Memcheck should report blocks it could not find a pointer to during leak detection. This is disabled by default (i.e. do not report blocks with undetermined pointers).
+ </para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ <emphasis role="italic">undef value errors</emphasis>
+ </emphasis> configures whether or not Memcheck should detect dangerous uses of undefined value errors. This is enabled by default.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ <emphasis role="italic">allow partial loads</emphasis>
+ </emphasis> is identical to the Memcheck command-line option <code>--partial-loads-ok=</code>, which controls how Memcheck handles word-sized, word-aligned loads from addresses from which bytes are addressable and others are not. This is disabled by default (i.e. treat loads from partially invalid and completely invalid addresses as the same).
+ </para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ <emphasis role="italic">gcc 2.96 workarounds</emphasis>
+ </emphasis> is identical to the Memcheck command-line option <code>--workaround-gcc296-bugs</code>, which controls whether Memcheck should assume that small reads/writes below the stack pointer are due to bugs in
+ <emphasis role="italic">gcc-2.96</emphasis>. This option is disabled by default (i.e. do not assume them to be reslting from
+ <emphasis role="italic">gcc-2.96</emphasis> bugs; report such reads/writes as errors).
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>Refer to
+ <ulink url="http://www.valgrind.org/docs/manual/mc-manual.html#mc-manual.suppfiles">http://www.valgrind.org/docs/manual/mc-manual.html#mc-manual.suppfiles</ulink> for information about Memcheck suppression files. For more information about each Memcheck option in the Valgrind plug-in for Eclipse, refer to <code>man valgrind</code>.
+ </para>
+ </section>
+ </chapter>
+ <chapter id="Using_Massif">
+ <title>Using Massif</title>
+ <para>Massif is a Valgrind tool that measures how much heap memory an application uses. Heap memory profiling is useful in determining how to reduce the memory usage of an application. For more information about Massif, refer to
+ <ulink url="http://www.valgrind.org/docs/manual/ms-manual.html">http://www.valgrind.org/docs/manual/ms-manual.html</ulink>.
+ </para>
+ <para>To use Massif, navigate to <u>Profile As</u> > <u>Profile Configurations</u> to access the
+ <emphasis role="bold">
+ <emphasis role="italic">Profile Configurations</emphasis>
+ </emphasis> menu. Open the
+ <emphasis role="bold">
+ <emphasis role="italic">Valgrind Options</emphasis>
+ </emphasis> tab and choose Massif from the <u>Tool to run:</u> drop-down list.
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="SwitchMassif.png"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <section id="Analyzing_Massif_Profile_Results">
+ <title>Analyzing Massif Profile Results</title>
+ <para>Massif distills a large volume of data. The Valgrind plug-in for Eclipse presents three ways to view this data:</para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">Snapshots Table</emphasis>. Each entry in the Valgrind view contains useful information about each snapshot taken by Massif during the profile run. The peak snapshot is highlighed in bold text.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="MassifTable.png"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">Heap Tree</emphasis>. Detailed snapshots are denoted by the <u>Show Heap Tree</u> icon (
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="hierarchy.gif"/>
+ </imageobject>
+ </mediaobject> ). Double-clicking any of these snapshots will modify the Valgrind view to display all detailed snapshots. Collapsing each detailed snapshot in this view will display a heirarchy of function calls (i.e. heap tree) detailing the heap allocations used during the snapshot.
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="MassifTree.png"/>
+ </imageobject>
+ </mediaobject>
+ Some functions within the heap tree list a related source file. Double-clicking these functions will open the listed source file and place the insertion point on the specific function responsible for the call.
+ You also can also toggle the <u>Show Heap Tree</u> shortcut on the Valgrind view toolbar to switch between
+ <emphasis role="bold">Snapshots Table</emphasis> and
+ <emphasis role="bold">Heap Tree</emphasis> views.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">Heap Chart</emphasis>. The information in the snapshots table is also available in line chart form, displayed in the
+ <emphasis role="bold">Heap Chart</emphasis> window. Clicking any data point in the chart will highlight its corresponding snapshot in the snapshot table. Double-clicking on a data point that corresponds to a detailed snapshot will open an editor to one of its function calls.
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="MassifChartSelect.png"/>
+ </imageobject>
+ </mediaobject>
+ If a detailed snapshot contains calls to multiple source files (or multiple functions within a source file), double-clicking its corresponding data point on the heap chart will open the
+ <emphasis role="bold">
+ <emphasis role="italic">Open Allocation Function Call</emphasis>
+ </emphasis> menu. Double-clicking a function from the
+ <emphasis role="bold">
+ <emphasis role="italic">Open Allocation Function Call</emphasis>
+ </emphasis> menu will open its corresponding source file and place the insertion point on the specific function responsible for the call.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section id="Configuring_a_Massif_Profile_Run">
+ <title>Configuring a Massif Profile Run</title>
+ <para>To configure a Massif profile run, navigate to <u>Profile As</u> > <u>Profile Configurations</u> to access the
+ <emphasis role="bold">
+ <emphasis role="italic">Profile Configurations</emphasis>
+ </emphasis> menu. In the
+ <emphasis role="bold">
+ <emphasis role="italic">Valgrind Options</emphasis>
+ </emphasis> tab, navigate further to
+ <emphasis role="bold">
+ <emphasis role="italic">Massif Options</emphasis>
+ </emphasis>.
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="MassifOptions.png"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <para>The
+ <emphasis role="bold">
+ <emphasis role="italic">Massif Options</emphasis>
+ </emphasis> tab allows you to configure the following Massif options:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ <emphasis role="italic">profile heap</emphasis>
+ </emphasis> specifies whether or not heap profiling should be performed. This option is enabled by default.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ <emphasis role="italic">profile stack</emphasis>
+ </emphasis> specifies whether or not stack profiling should be performed. This option is disabled by default, as it significantly slows down Massif.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ <emphasis role="italic">heap allocation threshold</emphasis>
+ </emphasis> specifies the significance threshold for heap allocations (as a percentage). Allocation tree entries that account for less than this will be aggregated. The default value for this option is 1%.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ <emphasis role="italic">time unit</emphasis>
+ </emphasis> specifies what time unit should be used for the profile. The possible values for this are instructions (default), milliseconds, or bytes.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ <emphasis role="italic">max snapshots</emphasis>
+ </emphasis> specifies the maximum number of snapshots that the profile should take. The default value for this is 100.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
+ <listitem>
+ <para>The
+ <emphasis role="bold">
+ <emphasis role="italic">allocated functions</emphasis>
+ </emphasis> field is identical to the Massif command-line option <code>--alloc-fn=</code>, which allows you to specify any function to be treated as a heap allocation function. To add or remove functions to this field, use the <u>New</u> or <u>Remove</u> buttons. You can specify multiple functions in this field.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ <emphasis role="italic">administrative bytes per block</emphasis>
+ </emphasis> is identical to the Massif command-line option <code>--heap-admin=</code>, which specifies the number of administrative bytes (per block) to use if heap profiling is enabled. The default value for this option is 8.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ <emphasis role="italic">allocation tree depth</emphasis>
+ </emphasis> is identical to the Massif command-line option <code>--depth=</code>, which specifies the maximum depth of the allocation trees recorded for detailed snapshots. The default value for this option is 30.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ <emphasis role="italic">allocation peak inaccuracy</emphasis>
+ </emphasis> is identical to the Massif command-line option <code>--peak-inaccuracy=</code>. Massif records a peak only when the global memory allocation size exceeds the previous peak by the specified percentage value of this option. The default value for this option is 1.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ <emphasis role="italic">detailed snapshot frequency</emphasis>
+ </emphasis> specifies the frequency at which Massif should take detailed snapshots. The default value for this option is 10; to specify that each snapshot should be detailed, set this option to 1.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ <emphasis role="italic">minimum heap block alignment</emphasis>
+ </emphasis> specifies the minimum alignment (i.e. size) of heap blocks.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>For more information about each Massif option in the Valgrind plug-in for Eclipse, refer to <code>man valgrind</code>.</para>
+ </section>
+ </chapter>
+ <chapter id="Using_Cachegrind">
+ <title>Using Cachegrind</title>
+ <para>Cachegrind performs cache and branching profiling. A Cachegrind profile run measures the number of cache misses and branch mispredictions performed by an application. Cachegrind collects the following statistics:</para>
+ <itemizedlist>
+ <listitem>
+ <para>L1 instruction cache reads and misses</para>
+ </listitem>
+ <listitem>
+ <para>L1 data cache reads and read misses, writes, and write misses</para>
+ </listitem>
+ <listitem>
+ <para>L2 unified cache reads and read misses, writes and write misses</para>
+ </listitem>
+ <listitem>
+ <para>Conditional branches and mispredicted conditional branches</para>
+ </listitem>
+ <listitem>
+ <para>Indirect branches and mispredicted indirect brances</para>
+ </listitem>
+ </itemizedlist>
+ <para>To use Cachegrind, navigate to <u>Profile As</u> > <u>Profile Configurations</u> to access the
+ <emphasis role="bold">
+ <emphasis role="italic">Profile Configurations</emphasis>
+ </emphasis> menu. Open the
+ <emphasis role="bold">
+ <emphasis role="italic">Valgrind Options</emphasis>
+ </emphasis> tab and choose Cachegrind from the
+ <emphasis role="bold">
+ <emphasis role="italic">Tool to run:</emphasis>
+ </emphasis> drop-down list.
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="SwitchCachegrind.png"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <section id="Analyzing_Cachegrind_Profile_Results">
+ <title>Analyzing Cachegrind Profile Results</title>
+ <para>The results of a Cachegrind profile run are displayed in the Valgrind view. These results show Cachegrind's cache/branch data in different levels of granularity. Double-clicking on any file, function, or line will open the corresponding source file and place the cursor on the appropriate location (if the source can be resolved).</para>
+ <para>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="CachegrindOutput.png"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ </section>
+ <section id="Configuring_a_Cachegrind_Profile_Run">
+ <title>Configuring a Cachegrind Profile Run</title>
+ <para>To configure a Massif profile run, navigate to <u>Profile As</u> > <u>Profile Configurations</u> to access the
+ <emphasis role="bold">
+ <emphasis role="italic">Profile Configurations</emphasis>
+ </emphasis> menu. In the
+ <emphasis role="bold">
+ <emphasis role="italic">Valgrind Options</emphasis>
+ </emphasis> tab, navigate further to
+ <emphasis role="bold">
+ <emphasis role="italic">Cachegrind Options</emphasis>
+ </emphasis>.
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="CachegrindOptions.png"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <para>The
+ <emphasis role="bold">
+ <emphasis role="italic">Cachegrind Options</emphasis>
+ </emphasis> tab allows you to configure the following Cachegrind options:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ <emphasis role="italic">Profile Cache Accesses/Misses</emphasis>
+ </emphasis> is identical to the Cachegrind command-line option <code>--cache-sim=</code>, which specifies whether or not to collect cache accesses and miss counts. This option is enabled by default.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">
+ <emphasis role="italic">Profile Branch Instructions/Mispredictions</emphasis>
+ </emphasis> is identical to the Cachegrind command-line option <code>--branch-sim=</code>, wich specifies whether or not to collect branch instruction and misprediction counts. This option is disabled by default.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <itemizedlist>
+ <listitem>
+ <para>The options inside the <u>Manually Set Cache Specifications</u> box allow you to configure the size, associativity, and line size of the following caches:</para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis role="bold">l1</emphasis> (level 1 instruction) cache
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">D1</emphasis> (level 1 data) cache
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis role="bold">L2</emphasis> (level 2) cache
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </itemizedlist>
+ <para>For more information about each Cachegrind option in the Valgrind plug-in for Eclipse, refer to <code>man valgrind</code>.</para>
+ </section>
+ </chapter>
+ <chapter id="Special_Cases">
+ <title>Special Cases</title>
+ <section id="Encountering_Errors">
+ <title>Encountering Errors</title>
+ <para>If the profiled application contains any errors or if any Valgrind options you selected result in an error, these errors will be reported in the
+ <emphasis role="italic">Core Messages</emphasis> pane of the Valgrind View. The Memcheck tool outputs all of its profile results on this pane.
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="ValgrindSegfault.png"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ <para>For other tools, it is possible to switch between the Core Messages pane and the tool's output in the Valgrind view menu.
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="SwitchCoreTool.png"/>
+ </imageobject>
+ </mediaobject>
+ </para>
+ </section>
+ <section id="Profiling_Child_Processes">
+ <title>Profiling Child Processes</title>
+ <para>To profile child processes during a profile run, enable the
+ <emphasis role="bold">
+ <emphasis role="italic">Trace children on exec</emphasis>
+ </emphasis> option in the
+ <emphasis role="bold">
+ <emphasis role="italic">General Options</emphasis>
+ </emphasis> tab (of the
+ <emphasis role="bold">
+ <emphasis role="italic">Valgrind Options</emphasis>
+ </emphasis> tab). Memcheck's results will list the process ID (PID) for each reported error in the Valgrind view.
+ </para>
+ <para>Massif, on the other hand, will present each process separately and allow you to switch between processes with the <u>Select Process ID</u> dropdown icon (
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="Thread.gif"/>
+ </imageobject>
+ </mediaobject> ) in the Valgrind view toolbar.
+ </para>
+ <para>Cachegrind will report each PID separately as a top-level element in its output tree.</para>
+ </section>
+ </chapter>
+ <chapter id="Updating_This_Document">
+ <title>Updating This Document</title>
+ <para>This document is maintained in a collaborative wiki. If you wish to update or modify this document please visit
+
+ <ulink url="http://wiki.eclipse.org/Linux_Tools_Project/Valgrind/User_Guide">http://wiki.eclipse.org/Linux_Tools_Project/Valgrind/User_Guide</ulink>
+ </para>
+ </chapter>
+</book> \ No newline at end of file
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.launch/ChangeLog b/valgrind/org.eclipse.linuxtools.valgrind.launch/ChangeLog
new file mode 100644
index 0000000000..4506107c6d
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.launch/ChangeLog
@@ -0,0 +1,244 @@
+2010-06-06 Elliott Baron <ebaron@fedoraproject.org>
+
+ Bug #315890
+ * src/org/eclipse/linuxtools/internal/valgrind/launch/messages.properties: Mention preference page.
+ * src/org/eclipse/linuxtools/internal/valgrind/launch/ValgrindLaunchPlugin.java (start): Register as listener
+ for Valgrind preference page changes.
+ (getValgrindLocation): Handle preference page in ValgrindCommand.
+ (propertyChange): Reset location and version, so the low-level methods will be called again.
+
+2010-05-28 Elliott Baron <ebaron@fedoraproject.org>
+
+ Bug #314680
+ * META-INF/MANIFEST.MF: Added new dependency.
+ * src/org/eclipse/linuxtools/internal/valgrind/launch/ValgrindLaunchConfigurationDelegate.java (createMarkers): Account
+ for source lookup returning LocalFileStorage.
+
+2009-08-11 Elliott Baron <ebaron@redhat.com>
+
+ * META-INF/MANIFEST.MF: Bump version to 0.3.0.
+
+2009-08-10 Elliott Baron <ebaron@redhat.com>
+
+ * src/org/eclipse/linuxtools/internal/valgrind/launch/messages.properties: Added keys.
+ * src/org/eclipse/linuxtools/internal/valgrind/launch/ValgrindLaunchConfigurationDelegate.java: Suppression file
+ attribute now contains a list.
+ * src/org/eclipse/linuxtools/internal/valgrind/launch/ValgrindOptionsTab.java: Changed suppression
+ file control to a List and corresponding attributes.
+
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ Bug #285861
+
+ * plugin.properties: Change Provider to Eclipse.
+
+2009-07-30 Elliott Baron <ebaron@redhat.com>
+
+ * src/org/eclipse/linuxtools/valgrind/launch: Moved all but IValgrindLaunchDelegate,
+ IValgrindOutputDirectoryProvider, IValgrindToolPage.
+ * src/org/eclipse/linuxtools/internal/valgrind/launch: New package.
+ * .project: Added API analysis.
+ * META-INF/MANIFEST.MF: Export internal package.
+ * plugin.xml: Update class references.
+
+2009-07-09 Elliott Baron <ebaron@redhat.com>
+
+ * ValgrindLaunchPlugin.java (parseWSPath): Don't report undef variables as errors.
+ * ValgrindOptionsTab.java: Display version exceptions only in tab's errorMessage.
+
+2009-06-25 Elliott Baron <ebaron@redhat.com>
+
+ * ValgrindLaunchConfigurationDelegate.java: Removed unused code.
+
+2009-06-23 Elliott Baron <ebaron@redhat.com>
+
+ * ValgrindExportWizardPage.java (getSelectAllButton): Created getter.
+ (getViewer): Likewise.
+ (getDeselectAllButton): Likewise.
+ (getDestText): Likewise.
+ * src/org/eclipse/linuxtools/valgrind/launch/ValgrindLaunchPlugin.java (getValgrindCommand):
+ (setValgrindCommand):
+ * src/org/eclipse/linuxtools/valgrind/launch/ValgrindOptionsTab.java (getMainStackSizeButton): Created getter.
+ (getMaxStackFrameSpinner): Likewise.
+ (getNumCallersSpinner): Likewise.
+ (loadDynamicTab): Renamed from getDynamicTab.
+ (getShowBelowMainButton): Created getter.
+ (loadDynamicArea): Call loadDynamicTab.
+ (getTraceChildrenButton): Created getter.
+ (getRunFreeresButton): Likewise.
+ (getErrorLimitButton): Likewise.
+ (getTools): Likewise.
+ (getToolsCombo): Likewise.
+ (getMainStackSizeSpinner): Likewise.
+ (getDemangleButton): Likewise.
+ (getChildSilentButton): Likewise.
+ (getSuppFileText): Likewise.
+ (getDynamicTab): Likewise.
+
+2009-06-22 Elliott Baron <ebaron@redhat.com>
+
+ * messages.properties: New key.
+ * ValgrindLaunchConfigurationDelegate.java (launch): Perform version check.
+ * ValgrindLaunchPlugin.java (getValgrindVersion): Compare installed Valgrind
+ version to minimum supported version.
+
+2009-05-28 Elliott Baron <ebaron@redhat.com>
+
+ * ValgrindLaunchPlugin.java (findValgrindVersion): Call findValgrindLocation first if necessary.
+
+2009-05-27 Elliott Baron <ebaron@redhat.com>
+
+ * ValgrindLaunchPlugin.java (setValgrindLocation): Setter for use by test suite.
+ (setValgrindVersion): Likewise.
+ (findValgrindLocation): Made into private helper.
+ (findValgrindVersion): Likewise.
+ (getValgrindLocation): Use instead of find*.
+ (getValgrindVersion): Likewise.
+ * ValgrindLaunchConfigurationDelegate.java: Changed for above.
+ * ValgrindOptionsTab.java: Likewise.
+
+2009-05-26 Elliott Baron <ebaron@redhat.com>
+
+ * messages.properties: New key.
+ * ValgrindLaunchConfigurationDelegate.java (getValgrindArgumentsArray): Support for --main-stacksize.
+ * ValgrindLaunchPlugin.java (findValgrindVersion): Remove path arg, call findValgrindLocation
+ if necessary.
+ * ValgrindOptionsTab.java: Support for --main-stacksize.
+
+2009-05-22 Elliott Baron <ebaron@redhat.com>
+
+ #275685
+ * ValgrindLaunchPlugin.java (findValgrindVersion): Version parsing fixed on Debian distros.
+
+2009-04-30 Elliott Baron <ebaron@redhat.com>
+
+ * META-INF/MANIFEST.MF: New deps.
+ * plugin.properties: Marker moved from Memcheck plugin.
+ * plugin.xml: Likewise.
+ * ValgrindLaunchConfigurationDelegate.java: Parsing Valgrind logs and creating markers
+ now done here.
+
+2009-04-23 Elliott Baron <ebaron@redhat.com>
+
+ * plugin.xml: Removed unused extension.
+ * ExportWizardConstants.java: Window title added.
+ * messages.properties: New key, capitalized options in tab.
+ * ValgrindExportWizard.java (init): Set window title.
+ * ValgrindOptionsTab.java: Moved suppressions to a new tab.
+
+2009-04-03 Elliott Baron <ebaron@redhat.com>
+
+ * src/org/eclipse/linuxtools/valgrind/launch/ExportHandler.java: New file.
+ * META-INF/MANIFEST.MF: 0.2.0 version.
+ * plugin.xml: New extensions.
+ * ValgrindExportWizardPage.java (createControl): Renaming.
+ * ValgrindLaunchConfigurationDelegate.java (launch): Clear previous saved
+ launch config/launch at beginning of method.
+ (createNewProcess): Wrapper for creating a new IProcess.
+ * ValgrindLaunchPlugin.java (setCurrentLaunchConfiguration): Renamed.
+ (getCurrentLaunchConfiguration): Likewise.
+ (getCurrentLaunch): Likewise.
+ (setCurrentLaunch): Likewise.
+
+2009-03-25 Elliott Baron <ebaron@redhat.com>
+
+ * icons/export_wiz.gif: New file.
+ * ExportWizardConstants.java: New file.
+ * ValgrindExportWizard.java: New file.
+ * ValgrindExportWizardPage.java: New file.
+ * META-INF/MANIFEST.MF: New deps.
+ * plugin.properties: New strings.
+ * plugin.xml: Added exportWizards extension and commands extension
+ * messages.properties: New strings.
+ * ValgrindLaunchConfigurationDelegate.java: Added handler for export command.
+ * ValgrindLaunchPlugin.java: Store most recent launch config and launch.
+
+2009-03-12 Elliott Baron <ebaron@redhat.com>
+
+ * messages.properties: Remove colons from checkboxes.
+ * ValgrindOptionsTab.java: Use two columns, equal width.
+
+2009-03-11 Elliott Baron <ebaron@redhat.com>
+
+ * ValgrindLaunchConfigurationDelegate.java:
+ (launch): Use new findValgrindLocation method.
+ (getPlugin): New method for subclassing.
+ * ValgrindLaunchPlugin.java (findValgrindVersion): New method.
+ (getValgrindCommand): New method for subclassing.
+ (findValgrindLocation): New method.
+ * ValgrindOptionsTab.java (handleToolChanged): Call recomputeSize.
+ (createBasicOptions): New UI.
+ (recomputeSize): New method.
+ (createErrorOptions): New UI.
+ (createControl): Find Valgrind version upon creation; use ScrolledComposite; redesigned UI.
+ (isValid): Check version obtained correctly.
+ (getDynamicTab): Call getPlugin() for subclassing.
+ (createSuppressionsOption): New UI.
+
+2009-02-27 Elliott Baron <ebaron@redhat.com>
+
+ * IValgrindOutputDirectoryProvider.java: Clarified comment.
+ * ValgrindLaunchConfigurationDelegate.java: Ensure files to delete when cleaning
+ output directory are not directories themselves.
+
+2009-02-25 Elliott Baron <ebaron@redhat.com>
+
+ * IValgrindLaunchDelegate.java: Renamed launch to handleLaunch.
+ * ValgrindLaunchConfigurationDelegate.java (handleValgrindError): Extracted.
+ (getDynamicDelegate): Extracted.
+ (launch): Various changes to facilitate subclassing.
+ (getValgrindCommand): Extracted.
+
+2009-02-20 Elliott Baron <ebaron@redhat.com>
+
+ * IValgrindOutputDirectoryProvider.java (getOutputPath): No longer responsible for
+ creating/emptying directory. Simply return path.
+ * ValgrindLaunchConfigurationDelegate.java (createDirectory): Receive role of above.
+ (setOutputPath): Stores output directory in LaunchConfiguration.
+ (launch): Changes from above.
+ * ValgrindOptionsTab.java: No longer sets output directory. Moved to delegate for
+ compatibility with old Launch Configurations.
+ * ValgrindOutputDirectoryProvider.java (getOutputPath): Changes from interface.
+
+2009-02-12 Elliott Baron <ebaron@redhat.com>
+
+ * schema/org.eclipse.linuxtools.valgrind.launch.valgrindTools.exsd: Renamed.
+ * schema/outputDirectoryProviders.exsd: New file.
+ * schema/valgrindTools.exsd: New file.
+ * IValgrindOutputDirectoryProvider.java: New file.
+ * ValgrindOutputDirectoryProvider.java: New file.
+ * META-INF/MANIFEST.MF: Removed core.util import.
+ * plugin.properties: New key for new extension point.
+ * plugin.xml: New extension point for output directory handling.
+ * IValgrindLaunchDelegate.java: Passing ValgrindCommand removed.
+ * messages.properties: New keys.
+ * ValgrindLaunchConfigurationDelegate.java
+ (verifyOutputPath): Retrieve path for output directory, optionally from extension point.
+ (launch): New output directory handling, store command line in IProcess, removed passing
+ of ValgrindCommand to tool extension.
+ * ValgrindLaunchPlugin.java (getOutputDirectoryProvider): Retrieve path for output directory,
+ optionally from extension point.
+ * ValgrindLaunchShortcut.java: Update with refactored constants.
+ * ValgrindOptionsTab.java
+ (setDefaults): Refactoring.
+ (performApply): Likewise.
+ (initializeFrom): Likewise.
+ (createToolCombo): Switch toolsCombo from SelectionListener to ModifyListener.
+ (setOutputDirectory): Store output directory in launch config.
+
+2009-02-02 Elliott Baron <ebaron@redhat.com>
+
+ * ValgrindLaunchConfigurationDelegate: Use DebugUITools to retrieve IProcess'
+ console.
+
+2009-01-05 Elliott Baron <ebaron@redhat.com>
+
+ * ValgrindLaunchConfigurationDelegate: Graceful handling for absence of
+ Valgrind. Also Valgrind view will display the absolute path of valgrind
+ that was launched.
+ * messages.properties: New key.
+
+2009-01-05 Elliott Baron <ebaron@redhat.com>
+
+ * META-INF/MANIFEST.MF: Changed version to 0.1.0.
+ * build.properties: Include about.html and icons. \ No newline at end of file
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.launch/META-INF/MANIFEST.MF b/valgrind/org.eclipse.linuxtools.valgrind.launch/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..7ceceb21be
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.launch/META-INF/MANIFEST.MF
@@ -0,0 +1,38 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.eclipse.linuxtools.valgrind.launch;singleton:=true
+Bundle-Version: 0.4.0.qualifier
+Bundle-Activator: org.eclipse.linuxtools.internal.valgrind.launch.ValgrindLaunchPlugin
+Bundle-Vendor: %Bundle-Vendor.0
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Import-Package: org.eclipse.cdt.core,
+ org.eclipse.cdt.core.model,
+ org.eclipse.cdt.debug.core,
+ org.eclipse.cdt.debug.core.model,
+ org.eclipse.cdt.launch,
+ org.eclipse.cdt.utils,
+ org.eclipse.core.expressions,
+ org.eclipse.core.filesystem,
+ org.eclipse.core.resources,
+ org.eclipse.core.variables,
+ org.eclipse.debug.core,
+ org.eclipse.debug.core.model,
+ org.eclipse.debug.core.sourcelookup.containers,
+ org.eclipse.debug.ui,
+ org.eclipse.debug.ui.console,
+ org.eclipse.debug.ui.sourcelookup,
+ org.eclipse.linuxtools.internal.valgrind.core,
+ org.eclipse.linuxtools.internal.valgrind.ui,
+ org.eclipse.linuxtools.profiling.launch,
+ org.eclipse.linuxtools.valgrind.core,
+ org.eclipse.linuxtools.valgrind.ui,
+ org.eclipse.ui.console,
+ org.eclipse.ui.model,
+ org.eclipse.ui.views.navigator
+Export-Package: org.eclipse.linuxtools.internal.valgrind.launch,
+ org.eclipse.linuxtools.valgrind.launch
+Bundle-Localization: plugin
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.launch/about.html b/valgrind/org.eclipse.linuxtools.valgrind.launch/about.html
new file mode 100644
index 0000000000..c258ef55d8
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.launch/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2006</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.launch/plugin.properties b/valgrind/org.eclipse.linuxtools.valgrind.launch/plugin.properties
new file mode 100644
index 0000000000..35c71b55b0
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.launch/plugin.properties
@@ -0,0 +1,13 @@
+#Properties file for org.eclipse.linuxtools.valgrind.launch
+launchConfigurationType.name.0 = Profile With Valgrind
+launchConfigurationTabGroup.description.0 = Profile C/C++ Application Using Valgrind
+shortcut.label.0 = Profile With Valgrind
+Bundle-Vendor.0 = Eclipse Linux Tools
+Bundle-Name.0 = Valgrind Launch Plug-in (Incubation)
+extension-point.name.0 = Valgrind Tool
+extension-point.name.1 = Valgrind Output Directory Providers
+command.name.0 = Export Valgrind Log Files
+command.description.0 = Exports Valgrind log output to a directory
+wizard.name.0 = Valgrind Log Files
+wizard.description.0 = Export Valgrind's output logs from a recent launch to the file system.
+marker.name = Valgrind Problem \ No newline at end of file
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.launch/src/org/eclipse/linuxtools/internal/valgrind/launch/ValgrindLaunchConfigurationDelegate.java b/valgrind/org.eclipse.linuxtools.valgrind.launch/src/org/eclipse/linuxtools/internal/valgrind/launch/ValgrindLaunchConfigurationDelegate.java
new file mode 100644
index 0000000000..782b58213a
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.launch/src/org/eclipse/linuxtools/internal/valgrind/launch/ValgrindLaunchConfigurationDelegate.java
@@ -0,0 +1,354 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * 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:
+ * Elliott Baron <ebaron@redhat.com> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.valgrind.launch;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.IOException;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Stack;
+
+import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
+import org.eclipse.cdt.launch.AbstractCLaunchDelegate;
+import org.eclipse.core.filesystem.URIUtil;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.SubMonitor;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.debug.core.model.ISourceLocator;
+import org.eclipse.debug.core.sourcelookup.containers.LocalFileStorage;
+import org.eclipse.debug.ui.DebugUITools;
+import org.eclipse.debug.ui.sourcelookup.ISourceLookupResult;
+import org.eclipse.linuxtools.internal.valgrind.core.CommandLineConstants;
+import org.eclipse.linuxtools.internal.valgrind.core.LaunchConfigurationConstants;
+import org.eclipse.linuxtools.internal.valgrind.core.ValgrindCommand;
+import org.eclipse.linuxtools.internal.valgrind.core.ValgrindCoreParser;
+import org.eclipse.linuxtools.internal.valgrind.core.ValgrindError;
+import org.eclipse.linuxtools.internal.valgrind.core.ValgrindStackFrame;
+import org.eclipse.linuxtools.internal.valgrind.ui.ValgrindUIPlugin;
+import org.eclipse.linuxtools.valgrind.core.IValgrindMessage;
+import org.eclipse.linuxtools.valgrind.launch.IValgrindLaunchDelegate;
+import org.eclipse.linuxtools.valgrind.launch.IValgrindOutputDirectoryProvider;
+import org.eclipse.osgi.util.NLS;
+import org.osgi.framework.Version;
+
+public class ValgrindLaunchConfigurationDelegate extends AbstractCLaunchDelegate {
+
+ protected static final String EMPTY_STRING = ""; //$NON-NLS-1$
+ protected static final String NO = "no"; //$NON-NLS-1$
+ protected static final String YES = "yes"; //$NON-NLS-1$
+ protected static final String EQUALS = "="; //$NON-NLS-1$
+
+ protected static final String LOG_FILE = CommandLineConstants.LOG_PREFIX + "%p.txt"; //$NON-NLS-1$
+ protected static final FileFilter LOG_FILTER = new FileFilter() {
+ public boolean accept(File pathname) {
+ return pathname.getName().startsWith(CommandLineConstants.LOG_PREFIX);
+ }
+ };
+
+ protected String toolID;
+ protected ValgrindCommand command;
+ protected IPath outputPath;
+ protected IValgrindLaunchDelegate dynamicDelegate;
+ protected ILaunchConfiguration config;
+ protected ILaunch launch;
+ protected IProcess process;
+ protected String launchStr;
+
+ public void launch(ILaunchConfiguration config, String mode,
+ ILaunch launch, IProgressMonitor m) throws CoreException {
+ if (m == null) {
+ m = new NullProgressMonitor();
+ }
+
+ SubMonitor monitor = SubMonitor.convert(m, Messages.getString("ValgrindLaunchConfigurationDelegate.Profiling_Local_CCPP_Application"), 10); //$NON-NLS-1$
+ // check for cancellation
+ if (monitor.isCanceled()) {
+ return;
+ }
+
+ this.config = config;
+ this.launch = launch;
+ try {
+ command = getValgrindCommand();
+
+ // remove any output from previous run
+ ValgrindUIPlugin.getDefault().resetView();
+ // reset stored launch data
+ getPlugin().setCurrentLaunchConfiguration(null);
+ getPlugin().setCurrentLaunch(null);
+
+ // find Valgrind binary if not already done
+ IPath valgrindLocation = getPlugin().getValgrindLocation();
+ // also ensure Valgrind version is usable
+ getPlugin().getValgrindVersion();
+
+ monitor.worked(1);
+ IPath exePath = verifyProgramPath(config);
+ String[] arguments = getProgramArgumentsArray(config);
+ File workDir = getWorkingDirectory(config);
+ if (workDir == null) {
+ workDir = new File(System.getProperty("user.home", ".")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ // set output directory in config
+ setOutputPath(config);
+ outputPath = verifyOutputPath(config);
+ // create/empty output directory
+ createDirectory(outputPath);
+
+ // tool that was launched
+ toolID = getTool(config);
+ // ask tool extension for arguments
+ dynamicDelegate = getDynamicDelegate(toolID);
+ String[] opts = getValgrindArgumentsArray(config);
+
+ // set the default source locator if required
+ setDefaultSourceLocator(launch, config);
+
+ ArrayList<String> cmdLine = new ArrayList<String>(1 + arguments.length);
+ cmdLine.add(valgrindLocation.toOSString());
+ cmdLine.addAll(Arrays.asList(opts));
+ cmdLine.add(exePath.toOSString());
+ cmdLine.addAll(Arrays.asList(arguments));
+ String[] commandArray = (String[]) cmdLine.toArray(new String[cmdLine.size()]);
+ boolean usePty = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_USE_TERMINAL, ICDTLaunchConfigurationConstants.USE_TERMINAL_DEFAULT);
+ monitor.worked(1);
+
+ // check for cancellation
+ if (monitor.isCanceled()) {
+ return;
+ }
+ // call Valgrind
+ command.execute(commandArray, getEnvironment(config), workDir, usePty);
+ monitor.worked(3);
+ process = createNewProcess(launch, command.getProcess() ,commandArray[0]);
+ // set the command line used
+ process.setAttribute(IProcess.ATTR_CMDLINE, command.getCommandLine());
+ while (!process.isTerminated()) {
+ Thread.sleep(100);
+ }
+
+ // store these for use by other classes
+ getPlugin().setCurrentLaunchConfiguration(config);
+ getPlugin().setCurrentLaunch(launch);
+
+ // parse Valgrind logs
+ IValgrindMessage[] messages = parseLogs(outputPath);
+
+ // create launch summary string to distinguish this launch
+ launchStr = createLaunchStr();
+
+ // create view
+ ValgrindUIPlugin.getDefault().createView(launchStr, toolID);
+ // set log messages
+ ValgrindUIPlugin.getDefault().getView().setMessages(messages);
+ monitor.worked(1);
+
+ // pass off control to extender
+ dynamicDelegate.handleLaunch(config, launch, monitor.newChild(3));
+
+ // refresh view
+ ValgrindUIPlugin.getDefault().refreshView();
+
+ // show view
+ ValgrindUIPlugin.getDefault().showView();
+ monitor.worked(1);
+ } catch (IOException e) {
+ abort(Messages.getString("ValgrindLaunchConfigurationDelegate.Error_starting_process"), e, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR); //$NON-NLS-1$
+ e.printStackTrace();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ } finally {
+ m.done();
+ }
+ }
+
+ protected IValgrindMessage[] parseLogs(IPath outputPath) throws IOException, CoreException {
+ List<IValgrindMessage> messages = new ArrayList<IValgrindMessage>();
+
+ for (File log : outputPath.toFile().listFiles(LOG_FILTER)) {
+ ValgrindCoreParser parser = new ValgrindCoreParser(log, launch);
+ IValgrindMessage[] results = parser.getMessages();
+ messages.addAll(Arrays.asList(results));
+ createMarkers(results);
+ }
+
+ return messages.toArray(new IValgrindMessage[messages.size()]);
+ }
+
+ protected void createMarkers(IValgrindMessage[] messages) throws CoreException, IOException {
+ // find the topmost stack frame within the workspace to annotate with marker
+ // traverse nested errors as well
+ Stack<IValgrindMessage> messageStack = new Stack<IValgrindMessage>();
+ messageStack.addAll(Arrays.asList(messages));
+ while (!messageStack.isEmpty()) {
+ IValgrindMessage message = messageStack.pop();
+ IMarker marker = null;
+ IValgrindMessage[] children = message.getChildren();
+ for (int i = 0; i < children.length; i++) {
+ // if we've found our marker we don't care about any further frames in this stack
+ if (children[i] instanceof ValgrindStackFrame && marker == null) {
+ ValgrindStackFrame frame = (ValgrindStackFrame) children[i];
+ if (frame.getLine() > 0) {
+ ISourceLocator locator = frame.getLaunch().getSourceLocator();
+ ISourceLookupResult result = DebugUITools.lookupSource(frame.getFile(), locator);
+ Object sourceElement = result.getSourceElement();
+
+ if (sourceElement != null) {
+ // Resolve IResource in case we get a LocalFileStorage object
+ if (sourceElement instanceof LocalFileStorage) {
+ IPath filePath = ((LocalFileStorage) sourceElement).getFullPath();
+ URI fileURI = URIUtil.toURI(filePath);
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ IFile[] files = root.findFilesForLocationURI(fileURI);
+ if (files.length > 0) {
+ // Take the first match
+ sourceElement = files[0];
+ }
+ }
+
+ if (sourceElement instanceof IResource) {
+ IResource resource = (IResource) sourceElement;
+ marker = resource.createMarker(ValgrindLaunchPlugin.MARKER_TYPE);
+ marker.setAttribute(IMarker.MESSAGE, message.getText());
+ marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
+ marker.setAttribute(IMarker.LINE_NUMBER, frame.getLine());
+ }
+ }
+ }
+ }
+ else if (children[i] instanceof ValgrindError) {
+ // nested error
+ messageStack.push(children[i]);
+ }
+ }
+ }
+ }
+
+ protected IProcess createNewProcess(ILaunch launch, Process systemProcess, String programName) {
+ return DebugPlugin.newProcess(launch, systemProcess, renderProcessLabel(programName));
+ }
+
+ protected ValgrindCommand getValgrindCommand() {
+ return getPlugin().getValgrindCommand();
+ }
+
+ protected ValgrindLaunchPlugin getPlugin() {
+ return ValgrindLaunchPlugin.getDefault();
+ }
+
+ protected IValgrindLaunchDelegate getDynamicDelegate(String toolID) throws CoreException {
+ return getPlugin().getToolDelegate(toolID);
+ }
+
+ protected IPath verifyOutputPath(ILaunchConfiguration config) throws CoreException {
+ IPath result = null;
+ String strPath = config.getAttribute(LaunchConfigurationConstants.ATTR_INTERNAL_OUTPUT_DIR, (String) null);
+ if (strPath != null) {
+ result = Path.fromPortableString(strPath);
+ }
+ if (result == null) {
+ abort(Messages.getString("ValgrindLaunchConfigurationDelegate.Retrieving_location_failed"), null, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR); //$NON-NLS-1$
+ }
+ return result;
+ }
+
+ protected void setOutputPath(ILaunchConfiguration config) throws CoreException, IOException {
+ IValgrindOutputDirectoryProvider provider = getPlugin().getOutputDirectoryProvider();
+ ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
+ wc.setAttribute(LaunchConfigurationConstants.ATTR_INTERNAL_OUTPUT_DIR, provider.getOutputPath().toPortableString());
+ wc.doSave();
+ }
+
+ protected void createDirectory(IPath path) throws IOException {
+ File outputDir = path.toFile();
+
+ if (outputDir.exists()) {
+ // delete any preexisting files
+ for (File outputFile : outputDir.listFiles()) {
+ if (outputFile.isFile() && !outputFile.delete()) {
+ throw new IOException(NLS.bind(Messages.getString("ValgrindOutputDirectory.Couldnt_delete"), outputFile.getAbsolutePath())); //$NON-NLS-1$
+ }
+ }
+ }
+ else if (!outputDir.mkdir()) {
+ throw new IOException(NLS.bind(Messages.getString("ValgrindOutputDirectory.Couldnt_create"), outputDir.getAbsolutePath())); //$NON-NLS-1$
+ }
+ }
+
+ protected String createLaunchStr() {
+ return config.getName() + " [" + getPlugin().getToolName(toolID) + "] " + process.getLabel(); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ protected String[] getValgrindArgumentsArray(ILaunchConfiguration config) throws CoreException, IOException {
+ ArrayList<String> opts = new ArrayList<String>();
+ opts.add(CommandLineConstants.OPT_TOOL + EQUALS + getPlugin().getToolName(toolID));
+ opts.add(CommandLineConstants.OPT_QUIET); // suppress uninteresting output
+ opts.add(CommandLineConstants.OPT_LOGFILE + EQUALS + outputPath.append(LOG_FILE).toOSString());
+
+ opts.add(CommandLineConstants.OPT_TRACECHILD + EQUALS + (config.getAttribute(LaunchConfigurationConstants.ATTR_GENERAL_TRACECHILD, LaunchConfigurationConstants.DEFAULT_GENERAL_TRACECHILD) ? YES : NO));
+ opts.add(CommandLineConstants.OPT_CHILDSILENT + EQUALS + YES); // necessary for parsing
+ opts.add(CommandLineConstants.OPT_FREERES + EQUALS + (config.getAttribute(LaunchConfigurationConstants.ATTR_GENERAL_FREERES, LaunchConfigurationConstants.DEFAULT_GENERAL_FREERES) ? YES : NO));
+
+ opts.add(CommandLineConstants.OPT_DEMANGLE + EQUALS + (config.getAttribute(LaunchConfigurationConstants.ATTR_GENERAL_DEMANGLE, LaunchConfigurationConstants.DEFAULT_GENERAL_DEMANGLE) ? YES : NO));
+ opts.add(CommandLineConstants.OPT_NUMCALLERS + EQUALS + config.getAttribute(LaunchConfigurationConstants.ATTR_GENERAL_NUMCALLERS, LaunchConfigurationConstants.DEFAULT_GENERAL_NUMCALLERS));
+ opts.add(CommandLineConstants.OPT_ERRLIMIT + EQUALS + (config.getAttribute(LaunchConfigurationConstants.ATTR_GENERAL_ERRLIMIT, LaunchConfigurationConstants.DEFAULT_GENERAL_ERRLIMIT) ? YES : NO));
+ opts.add(CommandLineConstants.OPT_BELOWMAIN + EQUALS + (config.getAttribute(LaunchConfigurationConstants.ATTR_GENERAL_BELOWMAIN, LaunchConfigurationConstants.DEFAULT_GENERAL_BELOWMAIN) ? YES : NO));
+ opts.add(CommandLineConstants.OPT_MAXFRAME + EQUALS + config.getAttribute(LaunchConfigurationConstants.ATTR_GENERAL_MAXFRAME, LaunchConfigurationConstants.DEFAULT_GENERAL_MAXFRAME));
+
+ // 3.4.0 specific
+ Version ver = getPlugin().getValgrindVersion();
+ if (ver.compareTo(ValgrindLaunchPlugin.VER_3_4_0) >= 0) {
+ boolean useMainStack = config.getAttribute(LaunchConfigurationConstants.ATTR_GENERAL_MAINSTACK_BOOL, LaunchConfigurationConstants.DEFAULT_GENERAL_MAINSTACK_BOOL);
+ if (useMainStack) {
+ opts.add(CommandLineConstants.OPT_MAINSTACK + EQUALS + config.getAttribute(LaunchConfigurationConstants.ATTR_GENERAL_MAINSTACK, LaunchConfigurationConstants.DEFAULT_GENERAL_MAINSTACK));
+ }
+ }
+
+ List<?> suppFiles = config.getAttribute(LaunchConfigurationConstants.ATTR_GENERAL_SUPPFILES, LaunchConfigurationConstants.DEFAULT_GENERAL_SUPPFILES);
+ for (Object strpath : suppFiles) {
+ IPath suppfile = getPlugin().parseWSPath((String) strpath);
+ if (suppfile != null) {
+ opts.add(CommandLineConstants.OPT_SUPPFILE + EQUALS + suppfile.toOSString());
+ }
+ }
+ opts.addAll(Arrays.asList(dynamicDelegate.getCommandArray(config)));
+
+ String[] ret = new String[opts.size()];
+ return opts.toArray(ret);
+ }
+
+ protected String getTool(ILaunchConfiguration config) throws CoreException {
+ return config.getAttribute(LaunchConfigurationConstants.ATTR_TOOL, LaunchConfigurationConstants.DEFAULT_TOOL);
+ }
+
+ @Override
+ protected String getPluginID() {
+ return ValgrindLaunchPlugin.PLUGIN_ID;
+ }
+
+}
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.launch/src/org/eclipse/linuxtools/internal/valgrind/launch/ValgrindLaunchPlugin.java b/valgrind/org.eclipse.linuxtools.valgrind.launch/src/org/eclipse/linuxtools/internal/valgrind/launch/ValgrindLaunchPlugin.java
new file mode 100644
index 0000000000..4a664eda17
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.launch/src/org/eclipse/linuxtools/internal/valgrind/launch/ValgrindLaunchPlugin.java
@@ -0,0 +1,322 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2009 Red Hat, Inc.
+ * 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:
+ * Elliott Baron <ebaron@redhat.com> - initial API and implementation
+ * Patrick Hofer (Noser Engineering AG) - fix for Bug 275685
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.valgrind.launch;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Set;
+
+import org.eclipse.cdt.launch.LaunchUtils;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.linuxtools.internal.valgrind.core.PluginConstants;
+import org.eclipse.linuxtools.internal.valgrind.core.ValgrindCommand;
+import org.eclipse.linuxtools.internal.valgrind.core.ValgrindPlugin;
+import org.eclipse.linuxtools.internal.valgrind.core.ValgrindPreferencePage;
+import org.eclipse.linuxtools.valgrind.launch.IValgrindLaunchDelegate;
+import org.eclipse.linuxtools.valgrind.launch.IValgrindOutputDirectoryProvider;
+import org.eclipse.linuxtools.valgrind.launch.IValgrindToolPage;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Version;
+
+public class ValgrindLaunchPlugin extends AbstractUIPlugin implements IPropertyChangeListener {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = PluginConstants.LAUNCH_PLUGIN_ID;
+ public static final String LAUNCH_ID = PLUGIN_ID + ".valgrindLaunch"; //$NON-NLS-1$
+ public static final String MARKER_TYPE = PLUGIN_ID + ".marker"; //$NON-NLS-1$
+
+ // Extension point constants
+ protected static final String EXT_ELEMENT_TOOL = "tool"; //$NON-NLS-1$
+ protected static final String EXT_ATTR_NAME = "name"; //$NON-NLS-1$
+ protected static final String EXT_ATTR_ID = "id"; //$NON-NLS-1$
+ protected static final String EXT_ATTR_PAGE = "page"; //$NON-NLS-1$
+ protected static final String EXT_ATTR_DELEGATE = "delegate"; //$NON-NLS-1$
+
+ protected static final String EXT_ELEMENT_PROVIDER = "provider"; //$NON-NLS-1$
+ protected static final String EXT_ATTR_CLASS = "class"; //$NON-NLS-1$
+
+ public static final Version VER_3_3_0 = new Version(3, 3, 0);
+ public static final Version VER_3_3_1 = new Version(3, 3, 1);
+ public static final Version VER_3_4_0 = new Version(3, 4, 0);
+ public static final Version VER_3_4_1 = new Version(3, 4, 1);
+ private static final Version MIN_VER = VER_3_3_0;
+ private static final String VERSION_PREFIX = "valgrind-"; //$NON-NLS-1$
+ private static final char VERSION_DELIMITER = '-';
+
+ protected HashMap<String, IConfigurationElement> toolMap;
+
+ private ValgrindCommand valgrindCommand;
+ private IPath valgrindLocation;
+ private Version valgrindVersion;
+ private ILaunchConfiguration config;
+ private ILaunch launch;
+
+ // The shared instance
+ private static ValgrindLaunchPlugin plugin;
+
+ /**
+ * The constructor
+ */
+ public ValgrindLaunchPlugin() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+
+ // Register as listener for changes to the property page
+ ValgrindPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static ValgrindLaunchPlugin getDefault() {
+ return plugin;
+ }
+
+ public IPath getValgrindLocation() throws CoreException {
+ if (valgrindLocation == null) {
+ findValgrindLocation();
+ }
+
+ return valgrindLocation;
+ }
+
+ public void setValgrindLocation(IPath valgrindLocation) {
+ this.valgrindLocation = valgrindLocation;
+ }
+
+ public Version getValgrindVersion() throws CoreException {
+ if (valgrindVersion == null) {
+ findValgrindVersion();
+ }
+ // check for minimum supported version
+ if (valgrindVersion.compareTo(MIN_VER) < 0) {
+ throw new CoreException(new Status(IStatus.ERROR, PLUGIN_ID, NLS.bind(Messages.getString("ValgrindLaunchPlugin.Error_min_version"), valgrindVersion.toString(), MIN_VER.toString()))); //$NON-NLS-1$
+ }
+ return valgrindVersion;
+ }
+
+ public void setValgrindVersion(Version valgrindVersion) {
+ this.valgrindVersion = valgrindVersion;
+ }
+
+ private void findValgrindLocation() throws CoreException {
+ try {
+ valgrindLocation = Path.fromOSString(getValgrindCommand().whichValgrind());
+ } catch (IOException e) {
+ IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, Messages.getString("ValgrindLaunchPlugin.Please_ensure_Valgrind"), e); //$NON-NLS-1$
+ throw new CoreException(status);
+ }
+ }
+
+ private void findValgrindVersion() throws CoreException {
+ try {
+ if (valgrindLocation == null) {
+ findValgrindLocation();
+ }
+
+ String verString = getValgrindCommand().whichVersion(valgrindLocation.toOSString());
+ verString = verString.replace(VERSION_PREFIX, ""); //$NON-NLS-1$
+ if (verString.indexOf(VERSION_DELIMITER) > 0) {
+ verString = verString.substring(0, verString.indexOf(VERSION_DELIMITER));
+ }
+ if (verString.length() > 0) {
+ valgrindVersion = Version.parseVersion(verString);
+ }
+ else {
+ throw new CoreException(new Status(IStatus.ERROR, PLUGIN_ID, NLS.bind(Messages.getString("ValgrindLaunchPlugin.Couldn't_determine_version"), valgrindLocation))); //$NON-NLS-1$
+ }
+ } catch (IOException e) {
+ IStatus status = new Status(IStatus.ERROR, PLUGIN_ID, NLS.bind(Messages.getString("ValgrindLaunchPlugin.Couldn't_determine_version"), valgrindLocation), e); //$NON-NLS-1$
+ throw new CoreException(status);
+ }
+ }
+
+ public void setValgrindCommand(ValgrindCommand command) {
+ valgrindCommand = command;
+ }
+
+ protected ValgrindCommand getValgrindCommand() {
+ if (valgrindCommand == null) {
+ valgrindCommand = new ValgrindCommand();
+ }
+ return valgrindCommand;
+ }
+
+ public String[] getRegisteredToolIDs() {
+ Set<String> ids = getToolMap().keySet();
+ return ids.toArray(new String[ids.size()]);
+ }
+
+ public String getToolName(String id) {
+ String name = null;
+ IConfigurationElement config = getToolMap().get(id);
+ if (config != null) {
+ name = config.getAttribute(EXT_ATTR_NAME);
+ }
+ return name;
+ }
+
+ public IValgrindToolPage getToolPage(String id) throws CoreException {
+ IValgrindToolPage tab = null;
+ IConfigurationElement config = getToolMap().get(id);
+ if (config != null) {
+ Object obj = config.createExecutableExtension(EXT_ATTR_PAGE);
+ if (obj instanceof IValgrindToolPage) {
+ tab = (IValgrindToolPage) obj;
+ }
+ }
+ if (tab == null) {
+ throw new CoreException(new Status(IStatus.ERROR, PLUGIN_ID, Messages.getString("ValgrindLaunchPlugin.Cannot_retrieve_page"))); //$NON-NLS-1$
+ }
+ return tab;
+ }
+
+ public IValgrindLaunchDelegate getToolDelegate(String id) throws CoreException {
+ IValgrindLaunchDelegate delegate = null;
+ IConfigurationElement config = getToolMap().get(id);
+ if (config != null) {
+ Object obj = config.createExecutableExtension(EXT_ATTR_DELEGATE);
+ if (obj instanceof IValgrindLaunchDelegate) {
+ delegate = (IValgrindLaunchDelegate) obj;
+ }
+ }
+ if (delegate == null) {
+ throw new CoreException(new Status(IStatus.ERROR, PLUGIN_ID, Messages.getString("ValgrindLaunchPlugin.Cannot_retrieve_delegate"))); //$NON-NLS-1$
+ }
+ return delegate;
+ }
+
+ public IValgrindOutputDirectoryProvider getOutputDirectoryProvider() throws CoreException {
+ IValgrindOutputDirectoryProvider provider = null;
+ IExtensionPoint extPoint = Platform.getExtensionRegistry().getExtensionPoint(PLUGIN_ID, PluginConstants.OUTPUT_DIR_EXT_ID);
+
+ // if we find more than one provider just take the first one
+ IConfigurationElement[] configs = extPoint.getConfigurationElements();
+ for (int i = 0; i < configs.length && provider == null; i++) {
+ IConfigurationElement config = configs[i];
+ if (config.getName().equals(EXT_ELEMENT_PROVIDER)) {
+ Object obj = config.createExecutableExtension(EXT_ATTR_CLASS);
+ if (obj instanceof IValgrindOutputDirectoryProvider) {
+ provider = (IValgrindOutputDirectoryProvider) obj;
+ }
+ }
+ }
+
+ // if no extender, use default
+ if (provider == null) {
+ provider = new ValgrindOutputDirectoryProvider();
+ }
+
+ return provider;
+ }
+
+ public void setCurrentLaunchConfiguration(ILaunchConfiguration config) {
+ this.config = config;
+ }
+
+ /**
+ * @return ILaunchConfiguration associated with Valgrind execution
+ * currently displayed in the Valgrind view.
+ */
+ public ILaunchConfiguration getCurrentLaunchConfiguration() {
+ return config;
+ }
+
+ public void setCurrentLaunch(ILaunch launch) {
+ this.launch = launch;
+ }
+
+ /**
+ * @return ILaunch associated with Valgrind execution currently displayed
+ * in the Valgrind view.
+ */
+ public ILaunch getCurrentLaunch() {
+ return launch;
+ }
+
+ IPath parseWSPath(String strpath) throws CoreException {
+ strpath = LaunchUtils.getStringVariableManager().performStringSubstitution(strpath, false);
+ IPath path = new Path(strpath);
+ if (!path.isAbsolute()) {
+ IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(path);
+ if (res != null) {
+ path = res.getLocation();
+ }
+ }
+ return path;
+ }
+
+ protected void initializeToolMap() {
+ toolMap = new HashMap<String, IConfigurationElement>();
+ IExtensionPoint extPoint = Platform.getExtensionRegistry().getExtensionPoint(PLUGIN_ID, PluginConstants.TOOL_EXT_ID);
+ IConfigurationElement[] configs = extPoint.getConfigurationElements();
+ for (IConfigurationElement config : configs) {
+ if (config.getName().equals(EXT_ELEMENT_TOOL)) {
+ String id = config.getAttribute(EXT_ATTR_ID);
+ if (id != null && config.getAttribute(EXT_ATTR_NAME) != null
+ && config.getAttribute(EXT_ATTR_PAGE) != null
+ && config.getAttribute(EXT_ATTR_DELEGATE) != null) {
+ toolMap.put(id, config);
+ }
+ }
+ }
+ }
+
+ protected HashMap<String, IConfigurationElement> getToolMap() {
+ if (toolMap == null) {
+ initializeToolMap();
+ }
+ return toolMap;
+ }
+
+ public void propertyChange(PropertyChangeEvent event) {
+ if (event.getProperty().equals(ValgrindPreferencePage.VALGRIND_PATH)) {
+ // Reset Valgrind location and version
+ valgrindLocation = null;
+ valgrindVersion = null;
+ }
+ }
+
+}
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.launch/src/org/eclipse/linuxtools/internal/valgrind/launch/messages.properties b/valgrind/org.eclipse.linuxtools.valgrind.launch/src/org/eclipse/linuxtools/internal/valgrind/launch/messages.properties
new file mode 100644
index 0000000000..8cddd6ed28
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.launch/src/org/eclipse/linuxtools/internal/valgrind/launch/messages.properties
@@ -0,0 +1,55 @@
+ExportWizardConstants.Window_title=Export
+ExportWizardConstants.Wizard_desc=Export Valgrind's output logs from a recent launch to the file system.
+ExportWizardConstants.Wizard_title=Valgrind Log Files
+ValgrindExportWizard.Export_fail=Problems were encountered during export.
+ValgrindExportWizard.Export_subtask=Copying {0}
+ValgrindExportWizard.Export_task=Copying Valgrind output logs to {0}
+ValgrindExportWizard.Page_name=Export Page
+ValgrindExportWizardPage.Browse=Browse...
+ValgrindExportWizardPage.Deselect_all=&Deselect All
+ValgrindExportWizardPage.Destination_group=Destination directory
+ValgrindExportWizardPage.Err_Dir_not_exist=Directory {0} does not exist.
+ValgrindExportWizardPage.Err_No_Valgrind_run=No Valgrind run available.
+ValgrindExportWizardPage.Err_Not_dir={0} is not a directory.
+ValgrindExportWizardPage.Msg_Select_destination=Select a destination for files.
+ValgrindExportWizardPage.Select_all=&Select All
+ValgrindExportWizardPage.Viewer_label=Log files to export:
+ValgrindLaunchConfigurationDelegate.Error_starting_process=Error starting process
+ValgrindLaunchConfigurationDelegate.Launch_unsuccessful=Valgrind launch unsuccessful. Check console for details.
+ValgrindLaunchConfigurationDelegate.Profiling_Local_CCPP_Application=Profiling Local C/C++ Application
+ValgrindLaunchConfigurationDelegate.Saving_Valgrind_output=Saving Valgrind output
+ValgrindLaunchConfigurationDelegate.Select_Destination=Select Destination
+ValgrindLaunchConfigurationDelegate.Retrieving_location_failed=Retrieving location of output directory failed
+ValgrindLaunchConfigurationDelegate.Valgrind_error_msg=Valgrind encountered an error during execution.
+ValgrindLaunchConfigurationDelegate.Valgrind_error_title=Valgrind Error
+ValgrindLaunchPlugin.Cannot_retrieve_delegate=Cannot retrieve delegate from extension
+ValgrindLaunchPlugin.Cannot_retrieve_page=Cannot retrieve page from extension
+ValgrindLaunchPlugin.Please_ensure_Valgrind=Please ensure Valgrind is installed and in your path, or manually set a location in Preferences.
+ValgrindLaunchPlugin.Couldn't_determine_version=Couldn't determine version of Valgrind located at {0}.
+ValgrindLaunchPlugin.Error_min_version=The installed Valgrind ({0}) is older than the minimum supported version ({1}).
+ValgrindOptionsTab.Basic_Options=Basic Options
+ValgrindOptionsTab.child_silent=Child silent after fork
+ValgrindOptionsTab.demangle=Demangle C++ names
+ValgrindOptionsTab.Error_Options=Error Options
+ValgrindOptionsTab.File_System=File Syste&m...
+ValgrindOptionsTab.General=General Options
+ValgrindOptionsTab.limit_errors=Limit errors reported
+ValgrindOptionsTab.Main_stack_size=Set main thread's stack size (B):
+ValgrindOptionsTab.max_size_of_stack_frame=Max stack frame size (B):
+ValgrindOptionsTab.No_options_tab_found=No options tab found for tool
+ValgrindOptionsTab.num_callers=Callers in stack trace:
+ValgrindOptionsTab.run_freeres=Run __libc_freeres on exit
+ValgrindOptionsTab.Select_a_Resource=Select a Resource:
+ValgrindOptionsTab.Select_a_Suppressions_File=Select a Suppressions File:
+ValgrindOptionsTab.Supp_remove=&Remove File
+ValgrindOptionsTab.Suppressions=Suppressions
+ValgrindOptionsTab.show_errors_below_main=Show errors below main
+ValgrindOptionsTab.suppressions_file=Suppression files:
+ValgrindOptionsTab.suppressions_file_doesnt_exist=Suppressions file: {0} doesn't exist.
+ValgrindOptionsTab.Tool=Tool
+ValgrindOptionsTab.Tool_to_run=Tool to run:
+ValgrindOptionsTab.trace_children=Trace children on exec
+ValgrindOptionsTab.Valgrind_Options=Valgrind Options
+ValgrindOptionsTab.Workspace=&Workspace...
+ValgrindOutputDirectory.Couldnt_create=Couldn't create {0}
+ValgrindOutputDirectory.Couldnt_delete=Couldn't delete {0} \ No newline at end of file
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.massif.tests/ChangeLog b/valgrind/org.eclipse.linuxtools.valgrind.massif.tests/ChangeLog
new file mode 100644
index 0000000000..86f3c7ed52
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.massif.tests/ChangeLog
@@ -0,0 +1,160 @@
+2010-05-26 Elliott Baron <ebaron@fedoraproject.org>
+
+ Bug #314376
+ * src/org/eclipse/linuxtools/internal/valgrind/massif/tests/DoubleClickTest.java (doDoubleClick): Change access to TreeViewer.
+ * src/org/eclipse/linuxtools/internal/valgrind/massif/tests/ExpandCollapseTest.java (testExpand): Likewise.
+ * src/org/eclipse/linuxtools/internal/valgrind/massif/tests/TreeTest.java (testTreeNodes): Likewise.
+ (testNoDetailed): Likewise.
+
+2009-12-22 Roland Grunberg <rgrunber@redhat.com>
+
+ * META-INF/MANIFEST.MF: Make necessary changes for switch from JUnit 3 to JUnit 4.
+
+2009-09-28 Elliott Baron <ebaron@fedoraproject.org>
+
+ * valgrindFiles: Regenerated.
+ * src/org/eclipse/linuxtools/internal/valgrind/massif/tests/LaunchConfigTabTest.java: Alignment option changes.
+
+2009-08-11 Elliott Baron <ebaron@redhat.com>
+
+ * src/org/eclipse/linuxtools/valgrind/massif: Removed.
+ * META-INF/MANIFEST.MF: Bump version to 0.3.0.
+
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ Bug #285861
+
+ * plugin.properties: Change Provider to Eclipse.
+
+2009-07-30 Elliott Baron <ebaron@redhat.com>
+
+ * src/org/eclipse/linuxtools/valgrind/massif/tests: Removed.
+ * src/org/eclipse/linuxtools/internal/valgrind/massif/tests: New package.
+ * .project: Added API analysis.
+ * META-INF/MANIFEST.MF: Export internal package.
+ * test.xml: Update class references.
+
+2009-06-23 Elliott Baron <ebaron@redhat.com>
+
+ * ChartExportTest.java (testChartExportSVG): Fix test name.
+ * MassifTestToolPage.java: Removed.
+ * AbstractMassifTest.java: Remove reference to TestToolPage.
+ * ExportWizardTest.java (createWizard): Use actual ExportWizard.
+ * LaunchConfigTabTest.java: Use actual ToolPage.
+
+2009-06-22 Elliott Baron <ebaron@redhat.com>
+
+ * ChartExportTest.java: New file.
+ * META-INF/MANIFEST.MF: New deps.
+ * AllTests.java (suite): Added ChartExportTest.
+
+2009-04-30 Elliott Baron <ebaron@redhat.com>
+
+ * MultiProcessTest.java: Delete referenced project.
+
+2009-04-23 Elliott Baron <ebaron@redhat.com>
+
+ * SortTest.java: New file.
+ * AllTests.java (suite): Added SortTest.
+
+2009-04-21 Elliott Baron <ebaron@redhat.com>
+
+ * BasicMassifTest.java (tearDown): Call super last.
+ * ChartTests.java (tearDown): Likewise.
+ * DoubleClickTest.java (tearDown): Likewise.
+ * ExpandCollapseTest.java (tearDown): Likewise.
+ * ExportWizardTest.java (tearDown): Likewise.
+ * LaunchConfigTabTest.java (tearDown): Likewise.
+ * MultiProcessTest.java (tearDown): Likewise.
+ * TreeTest.java (tearDown): Likewise.
+ * test.xml: Fix classname in cleanup target.
+
+2009-04-03 Elliott Baron <ebaron@redhat.com>
+
+ * META-INF/MANIFEST.MF: 0.2.0 version.
+ * AbstractMassifTest.java (checkFile): New helper.
+ (checkLine): Likewise.
+ * ChartTests.java (testChartLocationsDialog): New test.
+ * DoubleClickTest.java (testDoubleClickLine): Changes from refactoring.
+ (testDoubleClickFile): Likewise.
+
+2009-03-31 Elliott Baron <ebaron@redhat.com>
+
+ * ExpandCollapseTest.java: New file.
+ * AllTests.java (suite): Added ExpandCollapseTest.
+
+2009-03-26 Elliott Baron <ebaron@redhat.com>
+
+ * resources/multiProcTest: New test project.
+ * MultiProcessTest.java: New file.
+ * AllTests.java (suite): Added MultiProcessTest.
+
+2009-03-25 Elliott Baron <ebaron@redhat.com>
+
+ * ExportWizardTest.java: New file.
+ * AllTests.java (suite): Added ExportWizardTest.
+
+2009-03-18 Elliott Baron <ebaron@redhat.com>
+
+ * BasicMassifTest.java (setUp): Refactoring from profiling.tests.
+ * ChartTests.java (setUp): Likewise.
+ * DoubleClickTest.java (setUp): Likewise.
+ * LaunchConfigTabTest.java (setUp): Likewise.
+ * TreeTest.java (setUp): Likewise.
+
+2009-03-11 Elliott Baron <ebaron@redhat.com>
+
+ * AbstractMassifTest.java: Pass tool page to superclass.
+ * AllTests.java: Added LaunchConfigTabTest to suite.
+ * BasicMassifTest.java: Call super on setUp tearDown.
+ * ChartTests.java: Likewise.
+ * DoubleClickTest.java: Likewise.
+ * TreeTest.java: Likewise.
+ * LaunchConfigTabTest.java: New file.
+ * MassifTestToolPage.java: New file.
+ * META-INF/MANIFEST.MF: Added debug.core.model dependency.
+
+2009-02-25 Elliott Baron <ebaron@redhat.com>
+
+ * valgrindFiles/: Saved output from actual valgrind run. Used for testing
+ in environments without Valgrind.
+ * build.properties: Added valgrindFiles.
+ * META-INF/MANIFEST.MF: New dependencies.
+ * AbstractMassifTest.java: Extracted superclass.
+ * BasicMassifTest.java: Use new launch method.
+ * DoubleClickTest.java: Likewise.
+ * TreeTest.java: Likewise.
+ * ChartTests.java: Likewise. New interactivity test.
+
+2009-02-12 Elliott Baron <ebaron@redhat.com>
+
+ * META-INF/MANIFEST.MF: Removed core.util import.
+ * AbstractMassifTest.java: Refactoring.
+ * ChartTests.java: Refactoring.
+ * DoubleClickTest.java: Modified file comparison.
+ * TreeTest.java: Refactoring.
+
+2009-02-03 Elliott Baron <ebaron@redhat.com>
+
+ * META-INF/MANIFEST.MF: Require-Bundle for JUnit < 4.0.0
+
+2009-02-03 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Move JUnit from Import-package to Require-bundle to see
+ if this fixes the JUnit4 vs. JUnit 3.x issues.
+ * test.xml: plugin-name -> massif-plugin-name.
+
+2009-02-02 Andrew Overholt <overholt@redhat.com>
+
+ * build.properties: Add test.xml.
+ * test.xml: Update.
+
+2009-01-13 Elliott Baron <ebaron@redhat.com>
+
+ * AllTests: ChartTests added to suite.
+
+2009-01-05 Elliott Baron <ebaron@redhat.com>
+
+ * META-INF/MANIFEST.MF: Changed version to 0.1.0.
+ * build.properties: Include about.html.
+ * about.html: Added.
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.massif.tests/META-INF/MANIFEST.MF b/valgrind/org.eclipse.linuxtools.valgrind.massif.tests/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..ee3a7ecfd3
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.massif.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,38 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.eclipse.linuxtools.valgrind.massif.tests
+Bundle-Version: 0.4.0.qualifier
+Bundle-Activator: org.eclipse.linuxtools.internal.valgrind.massif.tests.MassifTestsPlugin
+Bundle-Vendor: %Bundle-Vendor.0
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.junit;bundle-version="4.7.0"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Bundle-Localization: plugin
+Import-Package: org.eclipse.birt.chart.computation,
+ org.eclipse.birt.chart.event,
+ org.eclipse.birt.chart.model,
+ org.eclipse.birt.core.exception,
+ org.eclipse.cdt.core.model,
+ org.eclipse.cdt.debug.core,
+ org.eclipse.core.resources,
+ org.eclipse.debug.core,
+ org.eclipse.debug.core.model,
+ org.eclipse.debug.ui,
+ org.eclipse.emf.common,
+ org.eclipse.emf.ecore,
+ org.eclipse.jface.text,
+ org.eclipse.linuxtools.internal.valgrind.core,
+ org.eclipse.linuxtools.internal.valgrind.launch,
+ org.eclipse.linuxtools.internal.valgrind.massif,
+ org.eclipse.linuxtools.internal.valgrind.massif.birt,
+ org.eclipse.linuxtools.internal.valgrind.tests,
+ org.eclipse.linuxtools.internal.valgrind.ui,
+ org.eclipse.linuxtools.profiling.tests,
+ org.eclipse.linuxtools.valgrind.launch,
+ org.eclipse.linuxtools.valgrind.ui,
+ org.eclipse.ui,
+ org.eclipse.ui.texteditor
+Export-Package: org.eclipse.linuxtools.internal.valgrind.massif.tests
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.massif.tests/plugin.properties b/valgrind/org.eclipse.linuxtools.valgrind.massif.tests/plugin.properties
new file mode 100644
index 0000000000..a893030cca
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.massif.tests/plugin.properties
@@ -0,0 +1,3 @@
+#Properties file for org.eclipse.linuxtools.valgrind.massif.tests
+Bundle-Vendor.0 = Eclipse Linux Tools
+Bundle-Name.0 = Massif Tests Plug-in (Incubation) \ No newline at end of file
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.massif.tests/src/org/eclipse/linuxtools/internal/valgrind/massif/tests/DoubleClickTest.java b/valgrind/org.eclipse.linuxtools.valgrind.massif.tests/src/org/eclipse/linuxtools/internal/valgrind/massif/tests/DoubleClickTest.java
new file mode 100644
index 0000000000..8ddf3b35a8
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.massif.tests/src/org/eclipse/linuxtools/internal/valgrind/massif/tests/DoubleClickTest.java
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2009 Red Hat, Inc.
+ * 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:
+ * Elliott Baron <ebaron@redhat.com> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.valgrind.massif.tests;
+
+
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.TreePath;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.linuxtools.internal.valgrind.massif.MassifHeapTreeNode;
+import org.eclipse.linuxtools.internal.valgrind.massif.MassifLaunchConstants;
+import org.eclipse.linuxtools.internal.valgrind.massif.MassifSnapshot;
+import org.eclipse.linuxtools.internal.valgrind.massif.MassifTreeViewer;
+import org.eclipse.linuxtools.internal.valgrind.massif.MassifViewPart;
+import org.eclipse.linuxtools.internal.valgrind.ui.ValgrindUIPlugin;
+
+public class DoubleClickTest extends AbstractMassifTest {
+ private MassifHeapTreeNode node;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ proj = createProjectAndBuild("alloctest"); //$NON-NLS-1$
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ deleteProject(proj);
+ super.tearDown();
+ }
+
+ private void doDoubleClick() {
+ MassifViewPart view = (MassifViewPart) ValgrindUIPlugin.getDefault().getView().getDynamicView();
+ MassifTreeViewer treeViewer = view.getTreeViewer();
+
+ MassifSnapshot[] snapshots = view.getSnapshots();
+ node = snapshots[1].getRoot(); // first detailed
+ TreePath path = new TreePath(new Object[] { node });
+ while (node.getChildren().length > 0 && !node.hasSourceFile()) {
+ node = node.getChildren()[0];
+ path = path.createChildPath(node);
+ }
+ if (node.hasSourceFile()) {
+ treeViewer.getViewer().expandToLevel(node, TreeViewer.ALL_LEVELS);
+ TreeSelection selection = new TreeSelection(path);
+
+ // do double click
+ IDoubleClickListener listener = treeViewer.getDoubleClickListener();
+ listener.doubleClick(new DoubleClickEvent(treeViewer.getViewer(), selection));
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testDoubleClickFile() throws Exception {
+ ILaunchConfiguration config = createConfiguration(proj.getProject());
+ ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
+ wc.setAttribute(MassifLaunchConstants.ATTR_MASSIF_DETAILEDFREQ, 2);
+ wc.doSave();
+ doLaunch(config, "testDoubleClickFile"); //$NON-NLS-1$
+
+ doDoubleClick();
+
+ checkFile(proj.getProject(), node);
+ }
+
+ public void testDoubleClickLine() throws Exception {
+ ILaunchConfiguration config = createConfiguration(proj.getProject());
+ ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
+ wc.setAttribute(MassifLaunchConstants.ATTR_MASSIF_DETAILEDFREQ, 2);
+ wc.doSave();
+ doLaunch(config, "testDoubleClickLine"); //$NON-NLS-1$
+
+ doDoubleClick();
+
+ checkLine(node);
+ }
+}
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.massif.tests/src/org/eclipse/linuxtools/internal/valgrind/massif/tests/ExpandCollapseTest.java b/valgrind/org.eclipse.linuxtools.valgrind.massif.tests/src/org/eclipse/linuxtools/internal/valgrind/massif/tests/ExpandCollapseTest.java
new file mode 100644
index 0000000000..4b59ef80fa
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.massif.tests/src/org/eclipse/linuxtools/internal/valgrind/massif/tests/ExpandCollapseTest.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * 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:
+ * Elliott Baron <ebaron@redhat.com> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.valgrind.massif.tests;
+
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.jface.viewers.TreePath;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.linuxtools.internal.valgrind.massif.MassifHeapTreeNode;
+import org.eclipse.linuxtools.internal.valgrind.massif.MassifViewPart;
+import org.eclipse.linuxtools.internal.valgrind.ui.ValgrindUIPlugin;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Menu;
+
+public class ExpandCollapseTest extends AbstractMassifTest {
+
+ protected TreeViewer viewer;
+ protected Menu contextMenu;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ proj = createProjectAndBuild("alloctest"); //$NON-NLS-1$
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ deleteProject(proj);
+ super.tearDown();
+ }
+
+ public void testExpand() throws Exception {
+ ILaunchConfiguration config = createConfiguration(proj.getProject());
+ doLaunch(config, "testDefaults"); //$NON-NLS-1$
+
+ MassifViewPart view = (MassifViewPart) ValgrindUIPlugin.getDefault().getView().getDynamicView();
+ viewer = view.getTreeViewer().getViewer();
+ contextMenu = viewer.getTree().getMenu();
+
+ // Select first snapshot and expand it
+ MassifHeapTreeNode[] snapshots = (MassifHeapTreeNode[]) viewer.getInput();
+ MassifHeapTreeNode snapshot = snapshots[0];
+ TreeSelection selection = new TreeSelection(new TreePath(new Object[] { snapshot }));
+ viewer.setSelection(selection);
+ contextMenu.notifyListeners(SWT.Show, null);
+ contextMenu.getItem(0).notifyListeners(SWT.Selection, null);
+
+ checkExpanded(snapshot, true);
+ }
+
+ public void testCollapse() throws Exception {
+ // Expand the element first
+ testExpand();
+
+ // Then collapse it
+ MassifHeapTreeNode[] snapshots = (MassifHeapTreeNode[]) viewer.getInput();
+ MassifHeapTreeNode snapshot = snapshots[0];
+ TreeSelection selection = new TreeSelection(new TreePath(new Object[] { snapshot }));
+ viewer.setSelection(selection);
+ contextMenu.notifyListeners(SWT.Show, null);
+ contextMenu.getItem(1).notifyListeners(SWT.Selection, null);
+
+ checkExpanded(snapshot, false);
+ }
+
+ private void checkExpanded(MassifHeapTreeNode element, boolean expanded) {
+ if (element.getChildren().length > 0) {
+ // only applicable to internal nodes
+ if (expanded) {
+ assertTrue(viewer.getExpandedState(element));
+ }
+ else {
+ assertFalse(viewer.getExpandedState(element));
+ }
+ }
+ for (MassifHeapTreeNode child : element.getChildren()) {
+ checkExpanded(child, expanded);
+ }
+ }
+}
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.massif.tests/src/org/eclipse/linuxtools/internal/valgrind/massif/tests/LaunchConfigTabTest.java b/valgrind/org.eclipse.linuxtools.valgrind.massif.tests/src/org/eclipse/linuxtools/internal/valgrind/massif/tests/LaunchConfigTabTest.java
new file mode 100644
index 0000000000..ee8b27770f
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.massif.tests/src/org/eclipse/linuxtools/internal/valgrind/massif/tests/LaunchConfigTabTest.java
@@ -0,0 +1,364 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * 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:
+ * Elliott Baron <ebaron@redhat.com> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.valgrind.massif.tests;
+
+import java.util.Arrays;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.debug.ui.ILaunchConfigurationTab;
+import org.eclipse.linuxtools.internal.valgrind.launch.ValgrindOptionsTab;
+import org.eclipse.linuxtools.internal.valgrind.massif.MassifPlugin;
+import org.eclipse.linuxtools.internal.valgrind.massif.MassifToolPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+
+public class LaunchConfigTabTest extends AbstractMassifTest {
+
+ protected ValgrindOptionsTab tab;
+ protected MassifToolPage dynamicTab;
+ protected ILaunchConfiguration config;
+ protected Shell testShell;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ proj = createProjectAndBuild("alloctest"); //$NON-NLS-1$
+
+ config = createConfiguration(proj.getProject());
+
+ testShell = new Shell(Display.getDefault());
+ testShell.setLayout(new GridLayout());
+ tab = new ValgrindOptionsTab();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ tab.dispose();
+ testShell.dispose();
+ deleteProject(proj);
+ super.tearDown();
+ }
+
+ private ILaunchConfigurationWorkingCopy initConfig() throws CoreException {
+ ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
+ tab.setDefaults(wc);
+ tab.createControl(testShell);
+ tab.initializeFrom(config);
+ int ix = Arrays.asList(tab.getTools()).indexOf(MassifPlugin.TOOL_ID);
+ tab.getToolsCombo().select(ix);
+ ILaunchConfigurationTab dynamicTab = tab.getDynamicTab();
+ this.dynamicTab = (MassifToolPage) dynamicTab;
+ return wc;
+ }
+
+ private ILaunch saveAndLaunch(ILaunchConfigurationWorkingCopy wc, String testName)
+ throws Exception {
+ tab.performApply(wc);
+ config = wc.doSave();
+
+ ILaunch launch = doLaunch(config, testName);
+ return launch;
+ }
+
+ public void testDefaults() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ ILaunch launch = saveAndLaunch(wc, "testDefaults"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--tool=massif")); //$NON-NLS-1$
+ assertFalse(cmd.contains("--xml=yes")); //$NON-NLS-1$
+ assertTrue(cmd.contains("-q")); //$NON-NLS-1$
+ assertTrue(cmd.contains("--trace-children=no")); //$NON-NLS-1$
+ assertTrue(cmd.contains("--child-silent-after-fork=yes")); //$NON-NLS-1$
+ assertTrue(cmd.contains("--demangle=yes")); //$NON-NLS-1$
+ assertTrue(cmd.contains("--num-callers=12")); //$NON-NLS-1$
+ assertTrue(cmd.contains("--error-limit=yes")); //$NON-NLS-1$
+ assertTrue(cmd.contains("--show-below-main=no")); //$NON-NLS-1$
+ assertFalse(cmd.contains("--suppressions")); //$NON-NLS-1$
+ assertTrue(cmd.contains("--max-stackframe=2000000")); //$NON-NLS-1$
+ assertTrue(cmd.contains("--run-libc-freeres=yes")); //$NON-NLS-1$
+
+ assertTrue(cmd.contains("--heap=yes")); //$NON-NLS-1$
+ assertTrue(cmd.contains("--heap-admin=8")); //$NON-NLS-1$
+ assertTrue(cmd.contains("--stacks=no")); //$NON-NLS-1$
+ assertFalse(cmd.contains("--alloc-fn")); //$NON-NLS-1$
+ assertTrue(cmd.contains("--threshold=1.0")); //$NON-NLS-1$
+ assertTrue(cmd.contains("--peak-inaccuracy=1.0")); //$NON-NLS-1$
+ assertTrue(cmd.contains("--time-unit=i")); //$NON-NLS-1$
+ assertTrue(cmd.contains("--detailed-freq=10")); //$NON-NLS-1$
+ assertTrue(cmd.contains("--max-snapshots=100")); //$NON-NLS-1$
+ assertFalse(cmd.contains("--alignment=")); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testHeap() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ dynamicTab.getHeapButton().setSelection(false);
+ ILaunch launch = saveAndLaunch(wc, "testHeap"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--heap=no")); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testHeapAdmin() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ dynamicTab.getHeapAdminSpinner().setSelection(30);
+ ILaunch launch = saveAndLaunch(wc, "testHeapAdmin"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--heap-admin=30")); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testStacks() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ dynamicTab.getStacksButton().setSelection(true);
+ ILaunch launch = saveAndLaunch(wc, "testStacks"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--stacks=yes")); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testDepth() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ dynamicTab.getDepthSpinner().setSelection(50);
+ ILaunch launch = saveAndLaunch(wc, "testDepth"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--depth=50")); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testAllocFn() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ dynamicTab.getAllocFnList().add("foo"); //$NON-NLS-1$
+ ILaunch launch = saveAndLaunch(wc, "testAllocFn"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--alloc-fn=foo")); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testAllocFnMultiple() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ dynamicTab.getAllocFnList().add("foo"); //$NON-NLS-1$
+ dynamicTab.getAllocFnList().add("bar"); //$NON-NLS-1$
+ ILaunch launch = saveAndLaunch(wc, "testAllocFnMultiple"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--alloc-fn=foo")); //$NON-NLS-1$
+ assertTrue(cmd.contains("--alloc-fn=bar")); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testAllocFnSpace() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ dynamicTab.getAllocFnList().add("operator new(unsigned)"); //$NON-NLS-1$
+ ILaunch launch = saveAndLaunch(wc, "testAllocFnSpace"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--alloc-fn=operator new(unsigned)")); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testThreshold() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ dynamicTab.getThresholdSpinner().setSelection(20);
+ ILaunch launch = saveAndLaunch(wc, "testThreshold"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--threshold=2.0")); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testPeakInaccuracy() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ dynamicTab.getPeakInaccuracySpinner().setSelection(0);
+ ILaunch launch = saveAndLaunch(wc, "testPeakInaccuracy"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--peak-inaccuracy=0.0")); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testTimeUnitBytes() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ String[] items = dynamicTab.getTimeUnitCombo().getItems();
+ int ix = -1;
+ for (int i = 0; i < items.length; i++) {
+ if (items[i].equals(MassifToolPage.TIME_B_STRING)) {
+ ix = i;
+ }
+ }
+ dynamicTab.getTimeUnitCombo().select(ix);
+ ILaunch launch = saveAndLaunch(wc, "testTimeUnitBytes"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--time-unit=B")); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testTimeUnitMilliseconds() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ String[] items = dynamicTab.getTimeUnitCombo().getItems();
+ int ix = -1;
+ for (int i = 0; i < items.length; i++) {
+ if (items[i].equals(MassifToolPage.TIME_MS_STRING)) {
+ ix = i;
+ }
+ }
+ dynamicTab.getTimeUnitCombo().select(ix);
+ ILaunch launch = saveAndLaunch(wc, "testTimeUnitMilliseconds"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--time-unit=ms")); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testDetailedFreq() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ dynamicTab.getDetailedFreqSpinner().setSelection(1);
+ ILaunch launch = saveAndLaunch(wc, "testDetailedFreq"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--detailed-freq=1")); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testMaxSnapshots() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ dynamicTab.getMaxSnapshotsSpinner().setSelection(200);
+ ILaunch launch = saveAndLaunch(wc, "testMaxSpapshots"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--max-snapshots=200")); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testAlignment() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+
+ assertFalse(dynamicTab.getAlignmentSpinner().getEnabled());
+ dynamicTab.getAlignmentButton().setSelection(true);
+ dynamicTab.getAlignmentButton().notifyListeners(SWT.Selection, null);
+ assertTrue(dynamicTab.getAlignmentSpinner().getEnabled());
+
+ dynamicTab.getAlignmentSpinner().setSelection(512);
+ tab.performApply(wc);
+ config = wc.doSave();
+
+ assertTrue(tab.isValid(config));
+
+ ILaunch launch = doLaunch(config, "testAlignment"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--alignment=512")); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testAlignmentBad() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+
+ assertFalse(dynamicTab.getAlignmentSpinner().getEnabled());
+ dynamicTab.getAlignmentButton().setSelection(true);
+ dynamicTab.getAlignmentButton().notifyListeners(SWT.Selection, null);
+ assertTrue(dynamicTab.getAlignmentSpinner().getEnabled());
+
+ dynamicTab.getAlignmentSpinner().setSelection(63);
+ tab.performApply(wc);
+ config = wc.doSave();
+
+ assertFalse(tab.isValid(config));
+ }
+}
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.massif.tests/src/org/eclipse/linuxtools/internal/valgrind/massif/tests/TreeTest.java b/valgrind/org.eclipse.linuxtools.valgrind.massif.tests/src/org/eclipse/linuxtools/internal/valgrind/massif/tests/TreeTest.java
new file mode 100644
index 0000000000..9be5f5898f
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.massif.tests/src/org/eclipse/linuxtools/internal/valgrind/massif/tests/TreeTest.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2009 Red Hat, Inc.
+ * 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:
+ * Elliott Baron <ebaron@redhat.com> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.valgrind.massif.tests;
+
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.linuxtools.internal.valgrind.massif.MassifHeapTreeNode;
+import org.eclipse.linuxtools.internal.valgrind.massif.MassifLaunchConstants;
+import org.eclipse.linuxtools.internal.valgrind.massif.MassifSnapshot;
+import org.eclipse.linuxtools.internal.valgrind.massif.MassifViewPart;
+import org.eclipse.linuxtools.internal.valgrind.ui.ValgrindUIPlugin;
+
+public class TreeTest extends AbstractMassifTest {
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ proj = createProjectAndBuild("alloctest"); //$NON-NLS-1$
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ deleteProject(proj);
+ super.tearDown();
+ }
+
+ public void testTreeNodes() throws Exception {
+ ILaunchConfiguration config = createConfiguration(proj.getProject());
+ ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
+ wc.setAttribute(MassifLaunchConstants.ATTR_MASSIF_DETAILEDFREQ, 2);
+ wc.doSave();
+ doLaunch(config, "testTreeNodes"); //$NON-NLS-1$
+
+ MassifViewPart view = (MassifViewPart) ValgrindUIPlugin.getDefault().getView().getDynamicView();
+ TreeViewer treeViewer = view.getTreeViewer().getViewer();
+
+ MassifSnapshot[] snapshots = view.getSnapshots();
+ MassifHeapTreeNode[] nodes = (MassifHeapTreeNode[]) treeViewer.getInput();
+ for (int i = 0; i < nodes.length; i++) {
+ // every odd snapshot should be detailed with --detailed-freq=2
+ // and thus in the tree
+ assertEquals(snapshots[2 * i + 1].getRoot(), nodes[i]);
+ }
+ }
+
+ public void testNoDetailed() throws Exception {
+ ILaunchConfiguration config = createConfiguration(proj.getProject());
+ ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
+ wc.setAttribute(MassifLaunchConstants.ATTR_MASSIF_DETAILEDFREQ, 12); // > #snapshots
+ wc.doSave();
+ doLaunch(config, "testNoDetailed"); //$NON-NLS-1$
+
+ MassifViewPart view = (MassifViewPart) ValgrindUIPlugin.getDefault().getView().getDynamicView();
+ TreeViewer treeViewer = view.getTreeViewer().getViewer();
+
+ MassifHeapTreeNode[] nodes = (MassifHeapTreeNode[]) treeViewer.getInput();
+
+ assertNotNull(nodes);
+ assertEquals(1, nodes.length); // should always contain peak
+ }
+
+}
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.massif/ChangeLog b/valgrind/org.eclipse.linuxtools.valgrind.massif/ChangeLog
new file mode 100644
index 0000000000..8ed2f5c290
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.massif/ChangeLog
@@ -0,0 +1,210 @@
+2010-05-26 Elliott Baron <ebaron@fedoraproject.org>
+
+ Bug #314376
+ * src/org/eclipse/linuxtools/internal/valgrind/massif/birt/ChartEditorInput.java (getAdapter): Change @suppresswarnings.
+ * src/org/eclipse/linuxtools/internal/valgrind/massif/MassifTreeViewer.java (MassifTreeViewer): Do not extend TreeViewer,
+ act as a wrapper instead.
+ (.doubleClick): Change access to TreeViewer.
+ (.menuAboutToShow): Likewise.
+ (getViewer): Likewise.
+ * src/org/eclipse/linuxtools/internal/valgrind/massif/MassifViewPart.java (createPartControl): Likewise.
+ (.doubleClick): Likewise.
+ (.run): Likewise.
+ (refreshView): Likewise.
+ (getTreeViewer): Likewise.
+
+2009-09-28 Elliott Baron <ebaron@fedoraproject.org>
+
+ #290597
+ * src/org/eclipse/linuxtools/internal/valgrind/massif/MassifLaunchConstants.java: Changed alignment option.
+ * src/org/eclipse/linuxtools/internal/valgrind/massif/MassifLaunchDelegate.java (getCommandArray): Likewise.
+ * src/org/eclipse/linuxtools/internal/valgrind/massif/MassifToolPage.java: Likewise.
+
+2009-08-11 Elliott Baron <ebaron@redhat.com>
+
+ * src/org/eclipse/linuxtools/valgrind/massif: Removed.
+ * META-INF/MANIFEST.MF: Bump version to 0.3.0.
+
+2009-08-10 Elliott Baron <ebaron@redhat.com>
+
+ * src/org/eclipse/linuxtools/internal/valgrind/massif/MassifViewPart.java: Append
+ ".svg" to default file name.
+
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ Bug #285861
+
+ * plugin.properties: Change Provider to Eclipse.
+
+2009-07-30 Elliott Baron <ebaron@redhat.com>
+
+ * src/org/eclipse/linuxtools/valgrind/massif/birt: Removed.
+ * src/org/eclipse/linuxtools/valgrind/massif: Removed.
+ * src/org/eclipse/linuxtools/internal/valgrind/massif: New package.
+ * src/org/eclipse/linuxtools/internal/valgrind/massif/birt: New package.
+ * .project: Added API analysis.
+ * META-INF/MANIFEST.MF: Export internal packages.
+ * plugin.xml: Update class references.
+
+2009-06-25 Elliott Baron <ebaron@redhat.com>
+
+ * MassifHeapTreeNode.java (MassifHeapTreeNode): Handle ??? symbol case.
+ * MassifParser.java (parseFunction): Likewise.
+
+2009-06-23 Elliott Baron <ebaron@redhat.com>
+
+ * MassifToolPage.java (getMaxSnapshotsSpinner): Added getter.
+ (getHeapAdminSpinner): Likewise.
+ (getAllocFnList): Likewise.
+ (getStacksButton): Likewise.
+ (getDepthSpinner): Likewise.
+ (getHeapButton): Likewise.
+ (getTimeUnitCombo): Likewise.
+ (getAlignmentSpinner): Likewise.
+ (getDetailedFreqSpinner): Likewise.
+ (getThresholdSpinner): Likewise.
+ (getPeakInaccuracySpinner): Likewise.
+
+2009-06-22 Elliott Baron <ebaron@redhat.com>
+
+ * icons/chart-save.png: New file.
+ * src/org/eclipse/linuxtools/valgrind/massif/birt/ChartSVG.java: New file.
+ * META-INF/MANIFEST.MF: New deps.
+ * birt/ChartControl.java (paintControl): Fix comment typo.
+ * birt/HeapChart.java (HeapChart): Remove suppress warnings for unchecked casts,
+ fixed with BIRT 2.5.
+ * MassifLaunchDelegate.java: Cleanup unused code.
+ * MassifViewPart.java: Add action for chart export.
+ * messages.properties: New key.
+
+2009-06-04 Elliott Baron <ebaron@redhat.com>
+
+ * META-INF/MANIFEST.MF: Removing birt.chart plugin from dependencies.
+
+2009-04-30 Elliott Baron <ebaron@redhat.com>
+
+ * MassifParser.java: Pulled up parseFilename.
+ * MassifViewPart.java: Make proper use of StackLayout.
+
+2009-04-23 Elliott Baron <ebaron@redhat.com>
+
+ * MassifViewPart.java (.widgetSelected): Default sorting now ascending.
+
+2009-04-03 Elliott Baron <ebaron@redhat.com>
+
+ * birt/ChartLocationsDialog.java: New file.
+ * MassifTreeLabelProvider.java: New file.
+ * META-INF/MANIFEST.MF: 0.2.0 version.
+ * ChartControl.java (callback): Added double-click callback.
+ * HeapChart.java: Likewise.
+ * messages.properties: New strings.
+ * MassifHeapTreeNode.java: Redesigned to store parsed components instead
+ of just text.
+ * MassifParser.java (parseFilename): Helper for parsing filenames.
+ (parseTree): Parse each component in the heap tree.
+ (parseFunction): Helper for parsing function names.
+ * MassifPlugin.java (openEditorForNode): Refactored.
+ * MassifTreeViewer.java (MassifTreeViewer): Likewise.
+
+2009-03-31 Elliott Baron <ebaron@redhat.com>
+
+ * MassifTreeViewer.java: Added expand/collapse actions.
+ * MassifViewPart.java (dispose): Check if page is null.
+ (createPartControl): Changed style bits for viewers.
+
+2009-03-26 Elliott Baron <ebaron@redhat.com>
+
+ * MassifPidMenuAction.java (getMenu): Access for testing.
+ * MassifViewPart.java (getPid): Likewise.
+ (getOutput): Likewise.
+
+2009-03-17 Elliott Baron <ebaron@redhat.com>
+
+ * MassifViewPart.java (dispose): Close all chart editors.
+ * MassifLaunchDelegate.java (handleLaunch): Bounds checking on number of output files.
+
+2009-03-16 Elliott Baron <ebaron@redhat.com>
+
+ * MassifParser.java (MassifParser): Explicitly close file.
+
+2009-03-13 Elliott Baron <ebaron@redhat.com>
+
+ * MassifParser.java (parseTree): Fixed NFE on localized percentage strings.
+
+2009-03-12 Elliott Baron <ebaron@redhat.com>
+
+ * MassifPlugin.java: Use PluginConstants for referencing LaunchPlugin.
+ * MassifToolPage.java (createControl): Remove labels for checkboxes.
+ * messages.properties: Remove colons from text for above.
+
+2009-03-11 Elliott Baron <ebaron@redhat.com>
+
+ * MassifToolPage.java: Extracted constants for time unit names.
+
+2009-02-27 Elliott Baron <ebaron@redhat.com>
+
+ * ChartControl.java: Clicking on interactive data point now also gives
+ Valgrind view focus.
+
+2009-02-25 Elliott Baron <ebaron@redhat.com>
+
+ * birt/ChartEditor.java (getControl): New getter.
+ * MassifLaunchDelegate.java (handleLaunch): Renamed.
+
+2009-02-20 Elliott Baron <ebaron@redhat.com>
+
+ * HeapChart.java (HeapChart): Added suppressWarnings.
+
+2009-02-12 Elliott Baron <ebaron@redhat.com>
+
+ * PowerOfTwoSpinner.java: Removed.
+ * MassifCommandConstants.java: New file.
+ * MassifLaunchConstants.java: New file.
+ * MassifLaunchDelegate.java: New output path handling.
+ * MassifToolPage.java (setDefaults): Refactored constants.
+ (performApply): Likewise.
+ (initializeFrom): Likewise.
+ (isValid): Check alignment for power of 2.
+ * messages.properties: New key.
+
+2009-01-21 Elliott Baron <ebaron@redhat.com>
+
+ * MassifParser: Moved parsePID to AbstractValgrindTextParser.
+
+2009-01-20 Elliott Baron <ebaron@redhat.com>
+
+ * MassifLaunchDelegate: Changed to handle multiple pids.
+ * MassifOutput: New, organizes multiple snapshot arrays by pid.
+ * MassifParser: Added parsing for pid.
+ * MassifPidMenuAction: UI to switch between pids.
+ * MassifViewPart: Added handling for multiple pids.
+ * messages.properties: New key.
+ * ChartEditorInput: Store pid for EditorInput caching.
+
+2009-01-13 Elliott Baron <ebaron@redhat.com>
+
+ * MassifParser: Implements new abstract parser.
+
+2009-01-09 Elliott Baron <ebaron@redhat.com>
+
+ * MassifSnapshot: New convenience method isDetailed().
+ * MassifViewPart: Changed visibility of setTopControl to public.
+ * ChartControl: Integrated with ChartRenderer, implementer of ICallBackNotifier must
+ also extend Composite.
+ * ChartRenderer: Deleted.
+ * HeapChart: Added triggers for single click.
+ * META-INF/MANIFEST.MF: Added all needed BIRT plugins to required bundles.
+
+2009-01-08 Elliott Baron <ebaron@redhat.com>
+
+ * META-INF/MANIFEST.MF: Added org.eclipse.birt.device.swt to required bundles.
+
+2009-01-05 Elliott Baron <ebaron@redhat.com>
+
+ * MassifViewPart: Chart now opens upon launch; EditorInput is cached once
+ created.
+ * ChartControl: Catches ChartException.
+ * ChartRenderer: First attempt at callbacks
+ * HeapChart: Likewise.
+ * META-INF/MANIFEST.MF: Changed version to 0.1.0.
+ * build.properties: Include about.html and icons. \ No newline at end of file
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.massif/META-INF/MANIFEST.MF b/valgrind/org.eclipse.linuxtools.valgrind.massif/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..c4a63a6934
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.massif/META-INF/MANIFEST.MF
@@ -0,0 +1,55 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.eclipse.linuxtools.valgrind.massif;singleton:=true
+Bundle-Version: 0.4.0.qualifier
+Bundle-Activator: org.eclipse.linuxtools.internal.valgrind.massif.MassifPlugin
+Bundle-Vendor: %Bundle-Vendor.0
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.birt.chart.device.swt;bundle-version="2.3.1",
+ org.eclipse.birt.chart.device.extension;bundle-version="2.3.1",
+ org.eclipse.birt.chart.engine;bundle-version="2.3.1",
+ org.eclipse.birt.chart.engine.extension;bundle-version="2.3.1",
+ org.eclipse.birt.chart.device.svg;bundle-version="2.3.1"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Bundle-Localization: plugin
+Import-Package: org.eclipse.birt.chart.device,
+ org.eclipse.birt.chart.exception,
+ org.eclipse.birt.chart.factory,
+ org.eclipse.birt.chart.model,
+ org.eclipse.birt.chart.model.attribute,
+ org.eclipse.birt.chart.model.attribute.impl,
+ org.eclipse.birt.chart.model.component,
+ org.eclipse.birt.chart.model.component.impl,
+ org.eclipse.birt.chart.model.data,
+ org.eclipse.birt.chart.model.data.impl,
+ org.eclipse.birt.chart.model.impl,
+ org.eclipse.birt.chart.model.layout,
+ org.eclipse.birt.chart.model.type,
+ org.eclipse.birt.chart.model.type.impl,
+ org.eclipse.birt.chart.util,
+ org.eclipse.birt.core.exception,
+ org.eclipse.cdt.debug.core,
+ org.eclipse.cdt.debug.ui,
+ org.eclipse.cdt.launch,
+ org.eclipse.core.resources,
+ org.eclipse.debug.core,
+ org.eclipse.debug.core.model,
+ org.eclipse.debug.core.sourcelookup,
+ org.eclipse.debug.ui,
+ org.eclipse.emf.common,
+ org.eclipse.emf.common.util,
+ org.eclipse.emf.ecore,
+ org.eclipse.jface.text,
+ org.eclipse.linuxtools.internal.valgrind.core,
+ org.eclipse.linuxtools.internal.valgrind.launch,
+ org.eclipse.linuxtools.internal.valgrind.ui,
+ org.eclipse.linuxtools.profiling.ui,
+ org.eclipse.linuxtools.valgrind.launch,
+ org.eclipse.linuxtools.valgrind.ui,
+ org.eclipse.ui,
+ org.mozilla.javascript
+Export-Package: org.eclipse.linuxtools.internal.valgrind.massif,
+ org.eclipse.linuxtools.internal.valgrind.massif.birt;uses:="org.eclipse.swt.events,org.eclipse.swt.widgets,org.eclipse.birt.chart.model"
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.massif/about.html b/valgrind/org.eclipse.linuxtools.valgrind.massif/about.html
new file mode 100644
index 0000000000..c258ef55d8
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.massif/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2006</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.massif/plugin.properties b/valgrind/org.eclipse.linuxtools.valgrind.massif/plugin.properties
new file mode 100644
index 0000000000..b0ff965c7f
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.massif/plugin.properties
@@ -0,0 +1,4 @@
+#Properties file for org.eclipse.linuxtools.valgrind.massif
+Bundle-Vendor.0 = Eclipse Linux Tools
+Bundle-Name.0 = Massif Plug-in (Incubation)
+editor.name.0 = Heap Chart \ No newline at end of file
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifLaunchConstants.java b/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifLaunchConstants.java
new file mode 100644
index 0000000000..4172a0c85f
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifLaunchConstants.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * 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:
+ * Elliott Baron <ebaron@redhat.com> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.valgrind.massif;
+
+import java.util.Collections;
+import java.util.List;
+
+public final class MassifLaunchConstants {
+ // LaunchConfiguration attributes
+ public static final String ATTR_MASSIF_OUTFILE = MassifPlugin.PLUGIN_ID + ".MASSIF_OUTFILE"; //$NON-NLS-1$
+ public static final String ATTR_MASSIF_HEAP = MassifPlugin.PLUGIN_ID + ".MASSIF_HEAP"; //$NON-NLS-1$
+ public static final String ATTR_MASSIF_HEAPADMIN = MassifPlugin.PLUGIN_ID + ".MASSIF_HEAPADMIN"; //$NON-NLS-1$
+ public static final String ATTR_MASSIF_STACKS = MassifPlugin.PLUGIN_ID + ".MASSIF_STACKS"; //$NON-NLS-1$
+ public static final String ATTR_MASSIF_DEPTH = MassifPlugin.PLUGIN_ID + ".MASSIF_DEPTH"; //$NON-NLS-1$
+ public static final String ATTR_MASSIF_ALLOCFN = MassifPlugin.PLUGIN_ID + ".MASSIF_ALLOCFN"; //$NON-NLS-1$
+ public static final String ATTR_MASSIF_THRESHOLD = MassifPlugin.PLUGIN_ID + ".MASSIF_THRESHOLD"; //$NON-NLS-1$
+ public static final String ATTR_MASSIF_PEAKINACCURACY = MassifPlugin.PLUGIN_ID + ".MASSIF_PEAKINACCURACY"; //$NON-NLS-1$
+ public static final String ATTR_MASSIF_TIMEUNIT = MassifPlugin.PLUGIN_ID + ".MASSIF_TIMEUNIT"; //$NON-NLS-1$
+ public static final String ATTR_MASSIF_DETAILEDFREQ = MassifPlugin.PLUGIN_ID + ".MASSIF_DETAILEDFREQ"; //$NON-NLS-1$
+ public static final String ATTR_MASSIF_MAXSNAPSHOTS = MassifPlugin.PLUGIN_ID + ".MASSIF_MAXSNAPSHOTS"; //$NON-NLS-1$
+ public static final String ATTR_MASSIF_ALIGNMENT_BOOL = MassifPlugin.PLUGIN_ID + ".MASSIF_ALIGNMENT_BOOL"; //$NON-NLS-1$
+ public static final String ATTR_MASSIF_ALIGNMENT_VAL = MassifPlugin.PLUGIN_ID + ".MASSIF_ALIGNMENT_VAL"; //$NON-NLS-1$
+
+ public static final String TIME_I = "i"; //$NON-NLS-1$
+ public static final String TIME_MS = "ms"; //$NON-NLS-1$
+ public static final String TIME_B = "B"; //$NON-NLS-1$
+
+ public static final boolean DEFAULT_MASSIF_HEAP = true;
+ public static final int DEFAULT_MASSIF_HEAPADMIN = 8;
+ public static final boolean DEFAULT_MASSIF_STACKS = false;
+ public static final int DEFAULT_MASSIF_DEPTH = 30;
+ public static final List<?> DEFAULT_MASSIF_ALLOCFN = Collections.EMPTY_LIST;
+ public static final int DEFAULT_MASSIF_THRESHOLD = 10;
+ public static final int DEFAULT_MASSIF_PEAKINACCURACY = 10;
+ public static final String DEFAULT_MASSIF_TIMEUNIT = TIME_I;
+ public static final int DEFAULT_MASSIF_DETAILEDFREQ = 10;
+ public static final int DEFAULT_MASSIF_MAXSNAPSHOTS = 100;
+ public static final boolean DEFAULT_MASSIF_ALIGNMENT_BOOL = false;
+ public static final int DEFAULT_MASSIF_ALIGNMENT_VAL = 0;
+}
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifLaunchDelegate.java b/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifLaunchDelegate.java
new file mode 100644
index 0000000000..93aecb407c
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifLaunchDelegate.java
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * 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:
+ * Elliott Baron <ebaron@redhat.com> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.valgrind.massif;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.linuxtools.internal.valgrind.launch.ValgrindLaunchConfigurationDelegate;
+import org.eclipse.linuxtools.internal.valgrind.ui.ValgrindUIPlugin;
+import org.eclipse.linuxtools.internal.valgrind.ui.ValgrindViewPart;
+import org.eclipse.linuxtools.valgrind.launch.IValgrindLaunchDelegate;
+import org.eclipse.linuxtools.valgrind.ui.IValgrindToolView;
+
+public class MassifLaunchDelegate extends ValgrindLaunchConfigurationDelegate
+implements IValgrindLaunchDelegate {
+ protected static final String OUT_PREFIX = "massif_"; //$NON-NLS-1$
+ protected static final String OUT_FILE = OUT_PREFIX + "%p.txt"; //$NON-NLS-1$
+ protected static final FileFilter MASSIF_FILTER = new FileFilter() {
+ public boolean accept(File pathname) {
+ return pathname.getName().startsWith(OUT_PREFIX);
+ }
+ };
+
+ protected MassifOutput output;
+
+ public void handleLaunch(ILaunchConfiguration config, ILaunch launch, IProgressMonitor monitor)
+ throws CoreException {
+ MassifPlugin.getDefault().setConfig(config);
+ MassifPlugin.getDefault().setSourceLocator(launch.getSourceLocator());
+ try {
+ monitor.beginTask(Messages.getString("MassifLaunchDelegate.Parsing_Massif_Output"), 3); //$NON-NLS-1$
+
+ IPath outputPath = verifyOutputPath(config);
+ File[] massifOutputs = outputPath.toFile().listFiles(MASSIF_FILTER);
+
+ if (massifOutputs.length > 0) {
+ parseOutput(massifOutputs, monitor);
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ abort(Messages.getString("MassifLaunchDelegate.Error_parsing_output"), e, ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR); //$NON-NLS-1$
+ } finally {
+ monitor.done();
+ }
+ }
+
+ protected void parseOutput(File[] massifOutputs, IProgressMonitor monitor) throws IOException {
+ output = new MassifOutput();
+ for (File file : massifOutputs) {
+ MassifParser parser = new MassifParser(file);
+ output.putSnapshots(parser.getPid(), parser.getSnapshots());
+ }
+ monitor.worked(2);
+
+ ValgrindViewPart view = ValgrindUIPlugin.getDefault().getView();
+ IValgrindToolView massifPart = view.getDynamicView();
+ if (massifPart instanceof MassifViewPart) {
+ ((MassifViewPart) massifPart).setOutput(output);
+ // initialize to first pid
+ ((MassifViewPart) massifPart).setPid(output.getPids()[0]);
+ }
+ monitor.worked(1);
+ }
+
+ @SuppressWarnings("unchecked")
+ public String[] getCommandArray(ILaunchConfiguration config)
+ throws CoreException {
+ ArrayList<String> opts = new ArrayList<String>();
+
+ IPath outputPath = verifyOutputPath(config);
+ opts.add(MassifCommandConstants.OPT_MASSIF_OUTFILE + EQUALS + outputPath.append(OUT_FILE).toOSString());
+
+ opts.add(MassifCommandConstants.OPT_HEAP + EQUALS + (config.getAttribute(MassifLaunchConstants.ATTR_MASSIF_HEAP, MassifLaunchConstants.DEFAULT_MASSIF_HEAP) ? YES : NO));
+ opts.add(MassifCommandConstants.OPT_HEAPADMIN + EQUALS + config.getAttribute(MassifLaunchConstants.ATTR_MASSIF_HEAPADMIN, MassifLaunchConstants.DEFAULT_MASSIF_HEAPADMIN));
+ opts.add(MassifCommandConstants.OPT_STACKS + EQUALS + (config.getAttribute(MassifLaunchConstants.ATTR_MASSIF_STACKS, MassifLaunchConstants.DEFAULT_MASSIF_STACKS) ? YES : NO));
+ opts.add(MassifCommandConstants.OPT_DEPTH + EQUALS + config.getAttribute(MassifLaunchConstants.ATTR_MASSIF_DEPTH, MassifLaunchConstants.DEFAULT_MASSIF_DEPTH));
+ List<String> allocFns = config.getAttribute(MassifLaunchConstants.ATTR_MASSIF_ALLOCFN, MassifLaunchConstants.DEFAULT_MASSIF_ALLOCFN);
+ for (String func : allocFns) {
+ opts.add(MassifCommandConstants.OPT_ALLOCFN + EQUALS + func);
+ }
+ opts.add(MassifCommandConstants.OPT_THRESHOLD + EQUALS + config.getAttribute(MassifLaunchConstants.ATTR_MASSIF_THRESHOLD, MassifLaunchConstants.DEFAULT_MASSIF_THRESHOLD) / 10.0);
+ opts.add(MassifCommandConstants.OPT_PEAKINACCURACY + EQUALS + config.getAttribute(MassifLaunchConstants.ATTR_MASSIF_PEAKINACCURACY, MassifLaunchConstants.DEFAULT_MASSIF_PEAKINACCURACY) / 10.0);
+ opts.add(MassifCommandConstants.OPT_TIMEUNIT + EQUALS + config.getAttribute(MassifLaunchConstants.ATTR_MASSIF_TIMEUNIT, MassifLaunchConstants.DEFAULT_MASSIF_TIMEUNIT));
+ opts.add(MassifCommandConstants.OPT_DETAILEDFREQ + EQUALS + config.getAttribute(MassifLaunchConstants.ATTR_MASSIF_DETAILEDFREQ, MassifLaunchConstants.DEFAULT_MASSIF_DETAILEDFREQ));
+ opts.add(MassifCommandConstants.OPT_MAXSNAPSHOTS + EQUALS + config.getAttribute(MassifLaunchConstants.ATTR_MASSIF_MAXSNAPSHOTS, MassifLaunchConstants.DEFAULT_MASSIF_MAXSNAPSHOTS));
+ if (config.getAttribute(MassifLaunchConstants.ATTR_MASSIF_ALIGNMENT_BOOL, MassifLaunchConstants.DEFAULT_MASSIF_ALIGNMENT_BOOL)) {
+ opts.add(MassifCommandConstants.OPT_ALIGNMENT + EQUALS + config.getAttribute(MassifLaunchConstants.ATTR_MASSIF_ALIGNMENT_VAL, MassifLaunchConstants.DEFAULT_MASSIF_ALIGNMENT_VAL));
+ }
+
+ return opts.toArray(new String[opts.size()]);
+ }
+}
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifToolPage.java b/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifToolPage.java
new file mode 100644
index 0000000000..aac8c02764
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifToolPage.java
@@ -0,0 +1,414 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * 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:
+ * Elliott Baron <ebaron@redhat.com> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.valgrind.massif;
+
+import java.util.Arrays;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.jface.window.Window;
+import org.eclipse.linuxtools.valgrind.launch.IValgrindToolPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.FontMetrics;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.Spinner;
+
+public class MassifToolPage extends AbstractLaunchConfigurationTab
+ implements IValgrindToolPage {
+ public static final String TIME_B_STRING = Messages.getString("MassifToolPage.bytes"); //$NON-NLS-1$
+ public static final String TIME_MS_STRING = Messages.getString("MassifToolPage.milliseconds"); //$NON-NLS-1$
+ public static final String TIME_I_STRING = Messages.getString("MassifToolPage.instructions"); //$NON-NLS-1$
+ public static final String MASSIF = "massif"; //$NON-NLS-1$
+ public static final String PLUGIN_ID = MassifPlugin.PLUGIN_ID;
+
+ // Massif controls
+ protected Button heapButton;
+ protected Spinner heapAdminSpinner;
+ protected Button stacksButton;
+ protected Spinner depthSpinner;
+ protected List allocFnList;
+ protected Spinner thresholdSpinner;
+ protected Spinner peakInaccuracySpinner;
+ protected Combo timeUnitCombo;
+ protected Spinner detailedFreqSpinner;
+ protected Spinner maxSnapshotsSpinner;
+ protected Button alignmentButton;
+ protected Spinner alignmentSpinner;
+
+ protected boolean isInitializing = false;
+ protected SelectionListener selectListener = new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ updateLaunchConfigurationDialog();
+ }
+ };
+ protected ModifyListener modifyListener = new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ updateLaunchConfigurationDialog();
+ }
+ };
+
+ public void createControl(Composite parent) {
+ Composite top = new Composite(parent, SWT.NONE);
+
+ GridLayout topLayout = new GridLayout(2, true);
+ topLayout.horizontalSpacing = 10;
+ top.setLayout(topLayout);
+ top.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ Composite heapTop = new Composite(top, SWT.NONE);
+ heapTop.setLayout(new GridLayout(2, false));
+
+ heapButton = new Button(heapTop, SWT.CHECK);
+ heapButton.setText(Messages.getString("MassifToolPage.profile_heap")); //$NON-NLS-1$
+ heapButton.addSelectionListener(selectListener);
+
+ Composite heapAdminTop = new Composite(top, SWT.NONE);
+ heapAdminTop.setLayout(new GridLayout(2, false));
+
+ Label heapAdminLabel = new Label(heapAdminTop, SWT.NONE);
+ heapAdminLabel.setText(Messages.getString("MassifToolPage.administrative_bytes")); //$NON-NLS-1$
+
+ heapAdminSpinner = new Spinner(heapAdminTop, SWT.BORDER);
+ heapAdminSpinner.addModifyListener(modifyListener);
+
+ Composite stacksTop = new Composite(top, SWT.NONE);
+ stacksTop.setLayout(new GridLayout(2, false));
+
+ stacksButton = new Button(stacksTop, SWT.CHECK);
+ stacksButton.setText(Messages.getString("MassifToolPage.profile_stack")); //$NON-NLS-1$
+ stacksButton.addSelectionListener(selectListener);
+
+ Composite depthTop = new Composite(top, SWT.NONE);
+ depthTop.setLayout(new GridLayout(2, false));
+
+ Label depthLabel = new Label(depthTop, SWT.NONE);
+ depthLabel.setText(Messages.getString("MassifToolPage.allocation_tree_depth")); //$NON-NLS-1$
+
+ depthSpinner = new Spinner(depthTop, SWT.BORDER);
+ depthSpinner.addModifyListener(modifyListener);
+
+ Composite thresholdTop = new Composite(top, SWT.NONE);
+ thresholdTop.setLayout(new GridLayout(3, false));
+
+ Label thresholdLabel = new Label(thresholdTop, SWT.NONE);
+ thresholdLabel.setText(Messages.getString("MassifToolPage.heap_allocation_threshold")); //$NON-NLS-1$
+
+ thresholdSpinner = new Spinner(thresholdTop, SWT.BORDER);
+ thresholdSpinner.setDigits(1);
+ thresholdSpinner.setMaximum(1000);
+ thresholdSpinner.addModifyListener(modifyListener);
+
+ Label thresholdPercentLabel = new Label(thresholdTop, SWT.NONE);
+ thresholdPercentLabel.setText("%"); //$NON-NLS-1$
+
+ Composite peakInaccuracyTop = new Composite(top, SWT.NONE);
+ peakInaccuracyTop.setLayout(new GridLayout(3, false));
+
+ Label peakInaccuracyLabel = new Label(peakInaccuracyTop, SWT.NONE);
+ peakInaccuracyLabel.setText(Messages.getString("MassifToolPage.allocation_peak_inaccuracy")); //$NON-NLS-1$
+
+ peakInaccuracySpinner = new Spinner(peakInaccuracyTop, SWT.BORDER);
+ peakInaccuracySpinner.setDigits(1);
+ peakInaccuracySpinner.setMaximum(1000);
+ peakInaccuracySpinner.addModifyListener(modifyListener);
+
+ Label peakInaccuracyPercentLabel = new Label(peakInaccuracyTop, SWT.NONE);
+ peakInaccuracyPercentLabel.setText("%"); //$NON-NLS-1$
+
+ Composite timeUnitTop = new Composite(top, SWT.NONE);
+ timeUnitTop.setLayout(new GridLayout(2, false));
+
+ Label timeUnitLabel = new Label(timeUnitTop, SWT.NONE);
+ timeUnitLabel.setText(Messages.getString("MassifToolPage.time_unit")); //$NON-NLS-1$
+
+ timeUnitCombo = new Combo(timeUnitTop, SWT.READ_ONLY);
+ String[] items = new String[] { TIME_I_STRING, TIME_MS_STRING, TIME_B_STRING };
+ timeUnitCombo.setItems(items);
+ timeUnitCombo.addSelectionListener(selectListener);
+
+ Composite detailedFreqTop = new Composite(top, SWT.NONE);
+ detailedFreqTop.setLayout(new GridLayout(2, false));
+
+ Label detailedFreqLabel = new Label(detailedFreqTop, SWT.NONE);
+ detailedFreqLabel.setText(Messages.getString("MassifToolPage.detailed_snapshot_freq")); //$NON-NLS-1$
+
+ detailedFreqSpinner = new Spinner(detailedFreqTop, SWT.BORDER);
+ detailedFreqSpinner.setMinimum(1);
+ detailedFreqSpinner.setMaximum(Integer.MAX_VALUE);
+ detailedFreqSpinner.addModifyListener(modifyListener);
+
+ Composite maxSnapshotsTop = new Composite(top, SWT.NONE);
+ maxSnapshotsTop.setLayout(new GridLayout(2, false));
+
+ Label maxSnapshotsLabel = new Label(maxSnapshotsTop, SWT.NONE);
+ maxSnapshotsLabel.setText(Messages.getString("MassifToolPage.max_snapshots")); //$NON-NLS-1$
+
+ maxSnapshotsSpinner = new Spinner(maxSnapshotsTop, SWT.BORDER);
+ maxSnapshotsSpinner.setMaximum(Integer.MAX_VALUE);
+ maxSnapshotsSpinner.addModifyListener(modifyListener);
+
+ Composite alignmentTop = new Composite(top, SWT.NONE);
+ GridLayout alignmentLayout = new GridLayout(2, false);
+ alignmentLayout.marginWidth = alignmentLayout.marginHeight = 0;
+ alignmentTop.setLayout(alignmentLayout);
+ alignmentButton = new Button(alignmentTop, SWT.CHECK);
+ alignmentButton.setText(Messages.getString("MassifToolPage.minimum_heap_block")); //$NON-NLS-1$
+ alignmentButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ checkAlignmentEnablement();
+ updateLaunchConfigurationDialog();
+ }
+ });
+ alignmentSpinner = new Spinner(alignmentTop, SWT.BORDER);
+ alignmentSpinner.setMinimum(0);
+ alignmentSpinner.setMaximum(4096);
+ alignmentSpinner.addModifyListener(modifyListener);
+
+ Composite allocFnTop = new Composite(top, SWT.NONE);
+ allocFnTop.setLayout(new GridLayout(3, false));
+ allocFnTop.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false, 2, 1));
+
+ Label allocFnLabel = new Label(allocFnTop, SWT.NONE);
+ allocFnLabel.setText(Messages.getString("MassifToolPage.allocation_functions")); //$NON-NLS-1$
+ allocFnLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false));
+
+ createAllocFnControls(allocFnTop);
+ }
+
+ private void checkAlignmentEnablement() {
+ alignmentSpinner.setEnabled(alignmentButton.getSelection());
+ }
+
+ private void createAllocFnControls(Composite top) {
+
+ allocFnList = new List(top, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
+ FontMetrics fm = MassifPlugin.getFontMetrics(allocFnList);
+ allocFnList.setLayoutData(new GridData(Dialog.convertWidthInCharsToPixels(fm, 50), Dialog.convertHeightInCharsToPixels(fm, 5)));
+
+ Composite allocButtons = new Composite(top, SWT.NONE);
+ GridLayout allocButtonsLayout = new GridLayout();
+ allocButtonsLayout.marginWidth = allocButtonsLayout.marginHeight = 0;
+ allocButtons.setLayout(allocButtonsLayout);
+ allocButtons.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false));
+
+ Button newButton = new Button(allocButtons, SWT.PUSH);
+ newButton.setText(Messages.getString("MassifToolPage.New")); //$NON-NLS-1$
+ newButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ newButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ handleNewButtonPressed();
+ updateLaunchConfigurationDialog();
+ }
+ });
+
+ Button removeButton = new Button(allocButtons, SWT.PUSH);
+ removeButton.setText(Messages.getString("MassifToolPage.Remove")); //$NON-NLS-1$
+ removeButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ removeButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ handleRemoveButtonPressed();
+ updateLaunchConfigurationDialog();
+ }
+ });
+ }
+
+ protected void handleNewButtonPressed() {
+ InputDialog dialog = new InputDialog(getShell(), Messages.getString("MassifToolPage.New_Allocation_Function"), Messages.getString("MassifToolPage.Function_name"), "", null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ if (dialog.open() == Window.OK) {
+ String function = dialog.getValue();
+ if (!function.equals("")) { //$NON-NLS-1$
+ allocFnList.add(function);
+ }
+ }
+ }
+
+ protected void handleRemoveButtonPressed() {
+ int[] selections = allocFnList.getSelectionIndices();
+ allocFnList.remove(selections);
+ }
+
+ public String getName() {
+ return Messages.getString("MassifToolPage.Massif_Options"); //$NON-NLS-1$
+ }
+
+ @SuppressWarnings("unchecked")
+ public void initializeFrom(ILaunchConfiguration configuration) {
+ isInitializing = true;
+ try {
+ heapButton.setSelection(configuration.getAttribute(MassifLaunchConstants.ATTR_MASSIF_HEAP, MassifLaunchConstants.DEFAULT_MASSIF_HEAP));
+ heapAdminSpinner.setSelection(configuration.getAttribute(MassifLaunchConstants.ATTR_MASSIF_HEAPADMIN, MassifLaunchConstants.DEFAULT_MASSIF_HEAPADMIN));
+ stacksButton.setSelection(configuration.getAttribute(MassifLaunchConstants.ATTR_MASSIF_STACKS, MassifLaunchConstants.DEFAULT_MASSIF_STACKS));
+ depthSpinner.setSelection(configuration.getAttribute(MassifLaunchConstants.ATTR_MASSIF_DEPTH, MassifLaunchConstants.DEFAULT_MASSIF_DEPTH));
+ java.util.List<String> allocFns = configuration.getAttribute(MassifLaunchConstants.ATTR_MASSIF_ALLOCFN, MassifLaunchConstants.DEFAULT_MASSIF_ALLOCFN);
+ allocFnList.setItems(allocFns.toArray(new String[allocFns.size()]));
+ thresholdSpinner.setSelection(configuration.getAttribute(MassifLaunchConstants.ATTR_MASSIF_THRESHOLD, MassifLaunchConstants.DEFAULT_MASSIF_THRESHOLD));
+ peakInaccuracySpinner.setSelection(configuration.getAttribute(MassifLaunchConstants.ATTR_MASSIF_PEAKINACCURACY, MassifLaunchConstants.DEFAULT_MASSIF_PEAKINACCURACY));
+ String timeUnit = configuration.getAttribute(MassifLaunchConstants.ATTR_MASSIF_TIMEUNIT, MassifLaunchConstants.DEFAULT_MASSIF_TIMEUNIT);
+ if (timeUnit.equals(MassifLaunchConstants.TIME_I)) {
+ timeUnitCombo.select(0);
+ }
+ else if (timeUnit.equals(MassifLaunchConstants.TIME_MS)) {
+ timeUnitCombo.select(1);
+ }
+ else {
+ timeUnitCombo.select(2);
+ }
+ detailedFreqSpinner.setSelection(configuration.getAttribute(MassifLaunchConstants.ATTR_MASSIF_DETAILEDFREQ, MassifLaunchConstants.DEFAULT_MASSIF_DETAILEDFREQ));
+ maxSnapshotsSpinner.setSelection(configuration.getAttribute(MassifLaunchConstants.ATTR_MASSIF_MAXSNAPSHOTS, MassifLaunchConstants.DEFAULT_MASSIF_MAXSNAPSHOTS));
+ alignmentButton.setSelection(configuration.getAttribute(MassifLaunchConstants.ATTR_MASSIF_ALIGNMENT_BOOL, MassifLaunchConstants.DEFAULT_MASSIF_ALIGNMENT_BOOL));
+ checkAlignmentEnablement();
+ int alignment = configuration.getAttribute(MassifLaunchConstants.ATTR_MASSIF_ALIGNMENT_VAL, MassifLaunchConstants.DEFAULT_MASSIF_ALIGNMENT_VAL);
+ alignmentSpinner.setSelection(alignment);
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ isInitializing = false;
+ }
+
+ public void performApply(ILaunchConfigurationWorkingCopy configuration) {
+ configuration.setAttribute(MassifLaunchConstants.ATTR_MASSIF_HEAP, heapButton.getSelection());
+ configuration.setAttribute(MassifLaunchConstants.ATTR_MASSIF_HEAPADMIN, heapAdminSpinner.getSelection());
+ configuration.setAttribute(MassifLaunchConstants.ATTR_MASSIF_STACKS, stacksButton.getSelection());
+ configuration.setAttribute(MassifLaunchConstants.ATTR_MASSIF_DEPTH, depthSpinner.getSelection());
+ configuration.setAttribute(MassifLaunchConstants.ATTR_MASSIF_ALLOCFN, Arrays.asList(allocFnList.getItems()));
+ configuration.setAttribute(MassifLaunchConstants.ATTR_MASSIF_THRESHOLD, thresholdSpinner.getSelection());
+ configuration.setAttribute(MassifLaunchConstants.ATTR_MASSIF_PEAKINACCURACY, peakInaccuracySpinner.getSelection());
+ int ix = timeUnitCombo.getSelectionIndex();
+ String value;
+ if (ix == 0) {
+ value = MassifLaunchConstants.TIME_I;
+ }
+ else if (ix == 1) {
+ value = MassifLaunchConstants.TIME_MS;
+ }
+ else {
+ value = MassifLaunchConstants.TIME_B;
+ }
+ configuration.setAttribute(MassifLaunchConstants.ATTR_MASSIF_TIMEUNIT, value);
+ configuration.setAttribute(MassifLaunchConstants.ATTR_MASSIF_DETAILEDFREQ, detailedFreqSpinner.getSelection());
+ configuration.setAttribute(MassifLaunchConstants.ATTR_MASSIF_MAXSNAPSHOTS, maxSnapshotsSpinner.getSelection());
+ configuration.setAttribute(MassifLaunchConstants.ATTR_MASSIF_ALIGNMENT_BOOL, alignmentButton.getSelection());
+ configuration.setAttribute(MassifLaunchConstants.ATTR_MASSIF_ALIGNMENT_VAL, alignmentSpinner.getSelection());
+ }
+
+ @Override
+ public boolean isValid(ILaunchConfiguration launchConfig) {
+ setErrorMessage(null);
+
+ boolean result = false;
+ try {
+ int alignment = launchConfig.getAttribute(MassifLaunchConstants.ATTR_MASSIF_ALIGNMENT_VAL, MassifLaunchConstants.DEFAULT_MASSIF_ALIGNMENT_VAL);
+ result = (alignment & (alignment - 1)) == 0; // is power of two?
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+
+ if (!result) {
+ setErrorMessage(Messages.getString("MassifToolPage.Alignment_must_be_power_2")); //$NON-NLS-1$
+ }
+ return result;
+ }
+
+ public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
+ configuration.setAttribute(MassifLaunchConstants.ATTR_MASSIF_HEAP, MassifLaunchConstants.DEFAULT_MASSIF_HEAP);
+ configuration.setAttribute(MassifLaunchConstants.ATTR_MASSIF_HEAPADMIN, MassifLaunchConstants.DEFAULT_MASSIF_HEAPADMIN);
+ configuration.setAttribute(MassifLaunchConstants.ATTR_MASSIF_STACKS, MassifLaunchConstants.DEFAULT_MASSIF_STACKS);
+ configuration.setAttribute(MassifLaunchConstants.ATTR_MASSIF_DEPTH, MassifLaunchConstants.DEFAULT_MASSIF_DEPTH);
+ configuration.setAttribute(MassifLaunchConstants.ATTR_MASSIF_ALLOCFN, MassifLaunchConstants.DEFAULT_MASSIF_ALLOCFN);
+ configuration.setAttribute(MassifLaunchConstants.ATTR_MASSIF_THRESHOLD, MassifLaunchConstants.DEFAULT_MASSIF_THRESHOLD);
+ configuration.setAttribute(MassifLaunchConstants.ATTR_MASSIF_PEAKINACCURACY, MassifLaunchConstants.DEFAULT_MASSIF_PEAKINACCURACY);
+ configuration.setAttribute(MassifLaunchConstants.ATTR_MASSIF_TIMEUNIT, MassifLaunchConstants.DEFAULT_MASSIF_TIMEUNIT);
+ configuration.setAttribute(MassifLaunchConstants.ATTR_MASSIF_DETAILEDFREQ, MassifLaunchConstants.DEFAULT_MASSIF_DETAILEDFREQ);
+ configuration.setAttribute(MassifLaunchConstants.ATTR_MASSIF_MAXSNAPSHOTS, MassifLaunchConstants.DEFAULT_MASSIF_MAXSNAPSHOTS);
+ configuration.setAttribute(MassifLaunchConstants.ATTR_MASSIF_ALIGNMENT_BOOL, MassifLaunchConstants.DEFAULT_MASSIF_ALIGNMENT_BOOL);
+ configuration.setAttribute(MassifLaunchConstants.ATTR_MASSIF_ALIGNMENT_VAL, MassifLaunchConstants.DEFAULT_MASSIF_ALIGNMENT_VAL);
+ }
+
+ protected void createHorizontalSpacer(Composite comp, int numlines) {
+ Label lbl = new Label(comp, SWT.NONE);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = numlines;
+ lbl.setLayoutData(gd);
+ }
+
+ @Override
+ protected void updateLaunchConfigurationDialog() {
+ if (!isInitializing) {
+ super.updateLaunchConfigurationDialog();
+ }
+ }
+
+ public Button getHeapButton() {
+ return heapButton;
+ }
+
+ public Spinner getHeapAdminSpinner() {
+ return heapAdminSpinner;
+ }
+
+ public Button getStacksButton() {
+ return stacksButton;
+ }
+
+ public Spinner getDepthSpinner() {
+ return depthSpinner;
+ }
+
+ public List getAllocFnList() {
+ return allocFnList;
+ }
+
+ public Spinner getThresholdSpinner() {
+ return thresholdSpinner;
+ }
+
+ public Spinner getPeakInaccuracySpinner() {
+ return peakInaccuracySpinner;
+ }
+
+ public Combo getTimeUnitCombo() {
+ return timeUnitCombo;
+ }
+
+ public Spinner getDetailedFreqSpinner() {
+ return detailedFreqSpinner;
+ }
+
+ public Spinner getMaxSnapshotsSpinner() {
+ return maxSnapshotsSpinner;
+ }
+
+ public Button getAlignmentButton() {
+ return alignmentButton;
+ }
+
+ public Spinner getAlignmentSpinner() {
+ return alignmentSpinner;
+ }
+
+}
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifTreeViewer.java b/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifTreeViewer.java
new file mode 100644
index 0000000000..0bd06bcfe6
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifTreeViewer.java
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * 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:
+ * Elliott Baron <ebaron@redhat.com> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.valgrind.massif;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.ITreeSelection;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.linuxtools.internal.valgrind.ui.CollapseAction;
+import org.eclipse.linuxtools.internal.valgrind.ui.ExpandAction;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Menu;
+
+public class MassifTreeViewer {
+
+ protected IDoubleClickListener doubleClickListener;
+ protected ITreeContentProvider contentProvider;
+ protected Action expandAction;
+ protected Action collapseAction;
+
+ private TreeViewer viewer;
+
+ public MassifTreeViewer(Composite parent) {
+ viewer = new TreeViewer(parent, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL);
+
+ contentProvider = new ITreeContentProvider() {
+ public Object[] getChildren(Object parentElement) {
+ return ((MassifHeapTreeNode) parentElement).getChildren();
+ }
+
+ public Object getParent(Object element) {
+ return ((MassifHeapTreeNode) element).getParent();
+ }
+
+ public boolean hasChildren(Object element) {
+ MassifHeapTreeNode[] children = ((MassifHeapTreeNode) element).getChildren();
+ return children != null && children.length > 0;
+ }
+
+ public Object[] getElements(Object inputElement) {
+ return (Object[]) inputElement;
+ }
+
+ public void dispose() {}
+
+ public void inputChanged(Viewer viewer, Object oldInput,
+ Object newInput) {}
+
+ };
+ viewer.setContentProvider(contentProvider);
+
+ viewer.setLabelProvider(new MassifTreeLabelProvider());
+
+ doubleClickListener = new IDoubleClickListener() {
+ public void doubleClick(DoubleClickEvent event) {
+ MassifHeapTreeNode element = (MassifHeapTreeNode) ((TreeSelection) event.getSelection()).getFirstElement();
+ if (element.hasSourceFile()) {
+ MassifPlugin.getDefault().openEditorForNode(element);
+ }
+ if (contentProvider.hasChildren(element)) {
+ viewer.expandToLevel(element, 1);
+ }
+ }
+ };
+ viewer.addDoubleClickListener(doubleClickListener);
+
+ expandAction = new ExpandAction(viewer);
+ collapseAction = new CollapseAction(viewer);
+
+ MenuManager manager = new MenuManager();
+ manager.addMenuListener(new IMenuListener() {
+ public void menuAboutToShow(IMenuManager manager) {
+ ITreeSelection selection = (ITreeSelection) viewer.getSelection();
+ MassifHeapTreeNode element = (MassifHeapTreeNode) selection.getFirstElement();
+ if (contentProvider.hasChildren(element)) {
+ manager.add(expandAction);
+ manager.add(collapseAction);
+ }
+ }
+ });
+
+ manager.setRemoveAllWhenShown(true);
+ Menu contextMenu = manager.createContextMenu(viewer.getTree());
+ viewer.getControl().setMenu(contextMenu);
+ }
+
+ public IDoubleClickListener getDoubleClickListener() {
+ return doubleClickListener;
+ }
+
+ public TreeViewer getViewer() {
+ return viewer;
+ }
+}
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifViewPart.java b/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifViewPart.java
new file mode 100644
index 0000000000..490fea5b5c
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifViewPart.java
@@ -0,0 +1,491 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * 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:
+ * Elliott Baron <ebaron@redhat.com> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.valgrind.massif;
+
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.IFontProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerComparator;
+import org.eclipse.linuxtools.internal.valgrind.massif.MassifSnapshot.SnapshotType;
+import org.eclipse.linuxtools.internal.valgrind.massif.birt.ChartEditorInput;
+import org.eclipse.linuxtools.internal.valgrind.massif.birt.ChartSVG;
+import org.eclipse.linuxtools.internal.valgrind.massif.birt.HeapChart;
+import org.eclipse.linuxtools.internal.valgrind.ui.ValgrindUIPlugin;
+import org.eclipse.linuxtools.valgrind.ui.IValgrindToolView;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StackLayout;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.ViewPart;
+
+public class MassifViewPart extends ViewPart implements IValgrindToolView {
+
+ protected static final String TITLE_STACKS = Messages
+ .getString("MassifViewPart.Stacks"); //$NON-NLS-1$
+ protected static final String TITLE_EXTRA = Messages
+ .getString("MassifViewPart.Extra_Heap"); //$NON-NLS-1$
+ protected static final String TITLE_USEFUL = Messages
+ .getString("MassifViewPart.Useful_Heap"); //$NON-NLS-1$
+ protected static final String TITLE_TOTAL = Messages
+ .getString("MassifViewPart.Total"); //$NON-NLS-1$
+ protected static final String TITLE_TIME = Messages
+ .getString("MassifViewPart.Time"); //$NON-NLS-1$
+ protected static final String TITLE_NUMBER = Messages
+ .getString("MassifViewPart.Snapshot"); //$NON-NLS-1$
+ protected static final String TREE_ACTION = MassifPlugin.PLUGIN_ID
+ + ".treeAction"; //$NON-NLS-1$
+ public static final String CHART_ACTION = MassifPlugin.PLUGIN_ID
+ + ".chartAction"; //$NON-NLS-1$
+ public static final String PID_ACTION = MassifPlugin.PLUGIN_ID
+ + ".pidAction"; //$NON-NLS-1$
+ public static final String SAVE_CHART_ACTION = MassifPlugin.PLUGIN_ID
+ + ".saveChartAction"; //$NON-NLS-1$
+
+ protected MassifOutput output;
+ protected Integer pid;
+
+ protected Composite top;
+ protected StackLayout stackLayout;
+ protected TableViewer viewer;
+ protected MassifTreeViewer treeViewer;
+ protected MassifHeapTreeNode[] nodes;
+
+ protected static final int COLUMN_SIZE = 125;
+
+ protected Action treeAction;
+ protected Action chartAction;
+ protected MassifPidMenuAction pidAction;
+ protected Action saveChartAction;
+
+ protected List<ChartEditorInput> chartInputs;
+
+ @Override
+ public void createPartControl(Composite parent) {
+ chartInputs = new ArrayList<ChartEditorInput>();
+
+ top = new Composite(parent, SWT.NONE);
+ stackLayout = new StackLayout();
+ top.setLayout(stackLayout);
+ top.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ viewer = new TableViewer(top, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL
+ | SWT.FULL_SELECTION);
+
+ Table table = viewer.getTable();
+ table.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+
+ String[] columnTitles = { TITLE_NUMBER, TITLE_TIME, TITLE_TOTAL,
+ TITLE_USEFUL, TITLE_EXTRA, TITLE_STACKS };
+
+ for (int i = 0; i < columnTitles.length; i++) {
+ TableViewerColumn column = new TableViewerColumn(viewer, SWT.NONE);
+ column.getColumn().setText(columnTitles[i]);
+ column.getColumn().setWidth(COLUMN_SIZE);
+ column.getColumn().setResizable(true);
+ column.getColumn().addSelectionListener(getHeaderListener());
+ }
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
+
+ viewer.setContentProvider(new ArrayContentProvider());
+ viewer.setLabelProvider(new MassifLabelProvider());
+
+ treeViewer = new MassifTreeViewer(top);
+ treeViewer.getViewer().getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ viewer.addDoubleClickListener(new IDoubleClickListener() {
+ public void doubleClick(DoubleClickEvent event) {
+ MassifSnapshot snapshot = (MassifSnapshot) ((IStructuredSelection) event
+ .getSelection()).getFirstElement();
+ if (snapshot.getType() != SnapshotType.EMPTY) {
+ treeAction.setChecked(true);
+ setTopControl(treeViewer.getViewer().getControl());
+ treeViewer.getViewer().setSelection(new StructuredSelection(snapshot
+ .getRoot()), true);
+ treeViewer.getViewer().expandToLevel(snapshot.getRoot(),
+ TreeViewer.ALL_LEVELS);
+ }
+ }
+ });
+
+ stackLayout.topControl = viewer.getControl();
+ top.layout();
+ }
+
+ private String getUnitString(MassifSnapshot[] snapshots) {
+ String result;
+ MassifSnapshot snapshot = snapshots[0];
+ switch (snapshot.getUnit()) {
+ case BYTES:
+ result = "B"; //$NON-NLS-1$
+ break;
+ case INSTRUCTIONS:
+ result = "i"; //$NON-NLS-1$
+ break;
+ default:
+ result = "ms"; //$NON-NLS-1$
+ break;
+ }
+ return result;
+ }
+
+ private SelectionListener getHeaderListener() {
+ return new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ TableColumn column = (TableColumn) e.widget;
+ Table table = viewer.getTable();
+ if (column.equals(table.getSortColumn())) {
+ int direction = table.getSortDirection() == SWT.UP ? SWT.DOWN
+ : SWT.UP;
+ table.setSortDirection(direction);
+ } else {
+ table.setSortDirection(SWT.UP);
+ }
+ table.setSortColumn(column);
+ viewer.setComparator(new ViewerComparator() {
+ @Override
+ public int compare(Viewer viewer, Object o1, Object o2) {
+ Table table = ((TableViewer) viewer).getTable();
+ int direction = table.getSortDirection();
+ MassifSnapshot s1 = (MassifSnapshot) o1;
+ MassifSnapshot s2 = (MassifSnapshot) o2;
+ long result;
+ TableColumn column = table.getSortColumn();
+ if (column.getText().equals(TITLE_NUMBER)) {
+ result = s1.getNumber() - s2.getNumber();
+ } else if (column.getText().startsWith(TITLE_TIME)) {
+ result = s1.getTime() - s2.getTime();
+ } else if (column.getText().equals(TITLE_TOTAL)) {
+ result = s1.getTotal() - s2.getTotal();
+ } else if (column.getText().equals(TITLE_USEFUL)) {
+ result = s1.getHeapBytes() - s2.getHeapBytes();
+ } else if (column.getText().equals(TITLE_EXTRA)) {
+ result = s1.getHeapExtra() - s2.getHeapExtra();
+ } else {
+ result = s1.getStacks() - s2.getStacks();
+ }
+
+ // ascending / descending
+ result = direction == SWT.UP ? result : -result;
+
+ // overflow check
+ if (result > Integer.MAX_VALUE) {
+ result = Integer.MAX_VALUE;
+ } else if (result < Integer.MIN_VALUE) {
+ result = Integer.MIN_VALUE;
+ }
+ return (int) result;
+ }
+ });
+ }
+ };
+ }
+
+ public IAction[] getToolbarActions() {
+ pidAction = new MassifPidMenuAction(this);
+ pidAction.setId(PID_ACTION);
+
+ chartAction = new Action(
+ Messages.getString("MassifViewPart.Display_Heap_Allocation"), IAction.AS_PUSH_BUTTON) { //$NON-NLS-1$
+ @Override
+ public void run() {
+ ChartEditorInput input = getChartInput(pid);
+ if (input != null) {
+ displayChart(input);
+ }
+ }
+ };
+ chartAction.setId(CHART_ACTION);
+ chartAction.setImageDescriptor(MassifPlugin.imageDescriptorFromPlugin(
+ MassifPlugin.PLUGIN_ID, "icons/linecharticon.gif")); //$NON-NLS-1$
+ chartAction.setToolTipText(Messages
+ .getString("MassifViewPart.Display_Heap_Allocation")); //$NON-NLS-1$
+
+ saveChartAction = new Action(Messages.getString("MassifViewPart.Save_Chart"), IAction.AS_PUSH_BUTTON) { //$NON-NLS-1$
+ @Override
+ public void run() {
+ ChartEditorInput currentInput = getChartInput(pid);
+ String path = getChartSavePath(currentInput.getName() + ".svg"); //$NON-NLS-1$
+ if (path != null) {
+ ChartSVG renderer = new ChartSVG(currentInput.getChart());
+ renderer.renderSVG(Path.fromOSString(path));
+ }
+ }
+ };
+ saveChartAction.setId(SAVE_CHART_ACTION);
+ saveChartAction.setImageDescriptor(MassifPlugin.imageDescriptorFromPlugin(
+ MassifPlugin.PLUGIN_ID, "icons/chart-save.png")); //$NON-NLS-1$
+ saveChartAction.setToolTipText(Messages.getString("MassifViewPart.Save_Chart")); //$NON-NLS-1$
+
+ treeAction = new Action(
+ Messages.getString("MassifViewPart.Show_Heap_Tree"), IAction.AS_CHECK_BOX) { //$NON-NLS-1$
+ @Override
+ public void run() {
+ if (isChecked()) {
+ stackLayout.topControl = treeViewer.getViewer().getControl();
+ top.layout();
+ } else {
+ stackLayout.topControl = viewer.getControl();
+ top.layout();
+ }
+ }
+ };
+ treeAction.setId(TREE_ACTION);
+ treeAction.setImageDescriptor(MassifPlugin.imageDescriptorFromPlugin(
+ MassifPlugin.PLUGIN_ID, "icons/call_hierarchy.gif")); //$NON-NLS-1$
+ treeAction.setToolTipText(Messages
+ .getString("MassifViewPart.Show_Heap_Tree")); //$NON-NLS-1$
+
+ return new IAction[] { pidAction, chartAction, saveChartAction, treeAction };
+ }
+
+ protected String getChartSavePath(String defaultName) {
+ Shell parent = new Shell(Display.getDefault());
+ FileDialog dialog = new FileDialog(parent, SWT.SAVE);
+ dialog.setText(Messages.getString("MassifViewPart.Save_chart_dialog_title")); //$NON-NLS-1$
+ dialog.setOverwrite(true);
+ dialog.setFilterExtensions(new String[] { ".svg" }); //$NON-NLS-1$
+ dialog.setFileName(defaultName);
+
+ return dialog.open();
+ }
+
+ protected void createChart(MassifSnapshot[] snapshots) {
+ HeapChart chart = new HeapChart(snapshots);
+ String title = ValgrindUIPlugin.getDefault().getView().getContentDescription() + " [PID: " + pid + "]"; //$NON-NLS-1$//$NON-NLS-2$
+ chart.getTitle().getLabel().getCaption().setValue(title);
+
+ String name = getInputName(title);
+ ChartEditorInput input = new ChartEditorInput(chart, name, pid);
+ chartInputs.add(input);
+
+ // open the editor
+ displayChart(input);
+ }
+
+ protected void displayChart(final ChartEditorInput chartInput) {
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ try {
+ IWorkbenchPage page = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage();
+ page.openEditor(chartInput, MassifPlugin.EDITOR_ID);
+ } catch (PartInitException e) {
+ e.printStackTrace();
+ }
+ }
+ });
+ }
+
+ protected String getInputName(String description) {
+ String launchName = description.substring(0, description
+ .indexOf("[massif]")); //$NON-NLS-1$
+ return launchName.trim();
+ }
+
+ @Override
+ public void setFocus() {
+ viewer.getTable().setFocus();
+ }
+
+ public void refreshView() {
+ if (output != null && pid != null) {
+ MassifSnapshot[] snapshots = output.getSnapshots(pid);
+ pidAction.setPids(output.getPids());
+ if (snapshots != null) {
+ viewer.setInput(snapshots);
+
+ String timeWithUnit = TITLE_TIME + " (" + getUnitString(snapshots) + ")"; //$NON-NLS-1$ //$NON-NLS-2$
+ for (TableColumn column : viewer.getTable().getColumns()) {
+ if (column.getText().startsWith(TITLE_TIME)) {
+ column.setText(timeWithUnit);
+ }
+ viewer.getTable().layout(true);
+ }
+ MassifSnapshot[] detailed = getDetailed(snapshots);
+ nodes = new MassifHeapTreeNode[detailed.length];
+ for (int i = 0; i < detailed.length; i++) {
+ nodes[i] = detailed[i].getRoot();
+ }
+ treeViewer.getViewer().setInput(nodes);
+
+ // create and display chart
+ if (snapshots.length > 0) {
+ ChartEditorInput input = getChartInput(pid);
+ if (input == null) {
+ createChart(snapshots);
+ }
+ else {
+ displayChart(input);
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ public void dispose() {
+ // Close all chart editors to keep Valgrind output consistent throughout workbench
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ if (page != null) {
+ for (IEditorInput input : chartInputs) {
+ IEditorPart part = page.findEditor(input);
+ if (part != null) {
+ page.closeEditor(part, false);
+ }
+ }
+ }
+ super.dispose();
+ }
+
+ public void setTopControl(Control control) {
+ stackLayout.topControl = control;
+ top.layout(true);
+ }
+
+ public void setOutput(MassifOutput output) {
+ this.output = output;
+ }
+
+ public MassifOutput getOutput() {
+ return output;
+ }
+
+ public void setPid(Integer pid) {
+ this.pid = pid;
+ }
+
+ public Integer getPid() {
+ return pid;
+ }
+
+ public MassifSnapshot[] getSnapshots() {
+ return output != null && pid != null ? output.getSnapshots(pid) : null;
+ }
+
+ public TableViewer getTableViewer() {
+ return viewer;
+ }
+
+ public MassifTreeViewer getTreeViewer() {
+ return treeViewer;
+ }
+
+ protected class MassifLabelProvider extends LabelProvider implements
+ ITableLabelProvider, IFontProvider {
+
+ public Image getColumnImage(Object element, int columnIndex) {
+ Image image = null;
+ if (columnIndex == 0) {
+ MassifSnapshot snapshot = (MassifSnapshot) element;
+ switch (snapshot.getType()) {
+ case EMPTY:
+ break;
+ case PEAK:
+ case DETAILED:
+ image = MassifPlugin
+ .imageDescriptorFromPlugin(MassifPlugin.PLUGIN_ID,
+ "icons/call_hierarchy.gif").createImage(); //$NON-NLS-1$
+ }
+ }
+ return image;
+ }
+
+ public String getColumnText(Object element, int columnIndex) {
+ MassifSnapshot snapshot = (MassifSnapshot) element;
+ DecimalFormat df = new DecimalFormat("#,##0"); //$NON-NLS-1$
+ switch (columnIndex) {
+ case 0:
+ return df.format(snapshot.getNumber());
+ case 1:
+ return df.format(snapshot.getTime());
+ case 2:
+ return df.format(snapshot.getTotal());
+ case 3:
+ return df.format(snapshot.getHeapBytes());
+ case 4:
+ return df.format(snapshot.getHeapExtra());
+ default:
+ return df.format(snapshot.getStacks());
+ }
+ }
+
+ public Font getFont(Object element) {
+ Font font = null;
+ MassifSnapshot snapshot = (MassifSnapshot) element;
+ switch (snapshot.getType()) {
+ case EMPTY:
+ case DETAILED:
+ break;
+ case PEAK:
+ font = JFaceResources.getFontRegistry().getBold(
+ JFaceResources.DIALOG_FONT);
+ }
+ return font;
+ }
+ }
+
+ private MassifSnapshot[] getDetailed(MassifSnapshot[] snapshots) {
+ ArrayList<MassifSnapshot> list = new ArrayList<MassifSnapshot>();
+ for (MassifSnapshot snapshot : snapshots) {
+ if (snapshot.getType() != SnapshotType.EMPTY) {
+ list.add(snapshot);
+ }
+ }
+ return list.toArray(new MassifSnapshot[list.size()]);
+ }
+
+ private ChartEditorInput getChartInput(Integer pid) {
+ ChartEditorInput result = null;
+ for (int i = 0; i < chartInputs.size(); i++) {
+ ChartEditorInput input = chartInputs.get(i);
+ if (input.getPid().equals(pid)) {
+ result = input;
+ }
+ }
+ return result;
+ }
+}
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/birt/ChartEditorInput.java b/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/birt/ChartEditorInput.java
new file mode 100644
index 0000000000..3a4dbfcb09
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/birt/ChartEditorInput.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2009 Red Hat, Inc.
+ * 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:
+ * Elliott Baron <ebaron@redhat.com> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.valgrind.massif.birt;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.linuxtools.internal.valgrind.massif.MassifPlugin;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPersistableElement;
+
+public class ChartEditorInput implements IEditorInput {
+
+ protected HeapChart chart;
+ protected String name;
+ protected Integer pid;
+
+ public ChartEditorInput(HeapChart chart, String name, Integer pid) {
+ this.chart = chart;
+ this.name = name;
+ this.pid = pid;
+ }
+
+ public boolean exists() {
+ return false;
+ }
+
+ public ImageDescriptor getImageDescriptor() {
+ return MassifPlugin.imageDescriptorFromPlugin(MassifPlugin.PLUGIN_ID, "icons/linecharticon.gif"); //$NON-NLS-1$
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public Integer getPid() {
+ return pid;
+ }
+
+ public IPersistableElement getPersistable() {
+ return null;
+ }
+
+ public String getToolTipText() {
+ return NLS.bind(Messages.getString("ChartEditorInput.Heap_allocation_chart_for"), name); //$NON-NLS-1$
+ }
+
+ @SuppressWarnings("rawtypes")
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
+
+ public HeapChart getChart() {
+ return chart;
+ }
+
+}
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/ChangeLog b/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/ChangeLog
new file mode 100644
index 0000000000..9879c7c931
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/ChangeLog
@@ -0,0 +1,208 @@
+2010-06-06 Elliott Baron <ebaron@fedoraproject.org>
+
+ Bug #315890
+ * src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/LocationPreferenceTest.java: New file.
+ * src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/AllTests.java (suite): Added new test.
+
+2010-05-26 Elliott Baron <ebaron@fedoraproject.org>
+
+ Bug #314376
+ * src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/DoubleClickTest.java (doDoubleClick): Change access to TreeViewer.
+ * src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/ExpandCollapseTest.java (testExpand): Likewise.
+ (testCollapse): Likewise.
+ (checkExpanded): Likewise.
+ * src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/LinkedResourceDoubleClickTest.java (doDoubleClick): Likewise.
+
+2009-12-22 Roland Grunberg <rgrunber@redhat.com>
+
+ * META-INF/MANIFEST.MF: Make necessary changes for switch from JUnit 3 to JUnit 4.
+
+2009-09-28 Elliott Baron <ebaron@fedoraproject.org>
+
+ * valgrindFiles: Regenerated.
+ * resources/basicTest/test.c (main): More reliable cross-platform.
+ * resources/linkedTest/src/test.c (main): Likewise.
+ * resources/multiProcTest/parent.c (main): Likewise.
+ * src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/LaunchConfigTabTest.java (testAlignmentBad): Alignment option changes.
+ (testAlignment): Likewise.
+ (testDefaults): Likewise.
+ * src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/LinkedResourceMarkerTest.java (testLinkedMarkers): Change number of expected markers.
+ * src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/MarkerTest.java (testMarkers): Likewise.
+
+2009-08-11 Elliott Baron <ebaron@redhat.com>
+
+ * src/org/eclipse/linuxtools/valgrind/memcheck: Removed.
+ * META-INF/MANIFEST.MF: Bump version to 0.3.0.
+
+2009-08-10 Elliott Baron <ebaron@redhat.com>
+
+ * resources/basicTest/testsuppfile2.supp: New file.
+ * src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/DoubleClickTest.java: Add test case
+ for source lookup after launch removed.
+ * src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/LaunchConfigTabTest.java: Test case
+ for multiple suppression files.
+
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ Bug #285861
+
+ * plugin.properties: Change Provider to Eclipse.
+
+2009-07-30 Elliott Baron <ebaron@redhat.com>
+
+ * src/org/eclipse/linuxtools/valgrind/memcheck/tests: Removed.
+ * src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests: New package.
+ * .project: Added API analysis.
+ * META-INF/MANIFEST.MF: Export internal package.
+ * test.xml: Update class references.
+
+2009-07-07 Elliott Baron <ebaron@redhat.com>
+
+ * LaunchConfigTabTest.java (testNoLeakCheck): New test.
+
+2009-06-23 Elliott Baron <ebaron@redhat.com>
+
+ * MemcheckTestToolPage.java: Removed.
+ * AbstractMemcheckTest.java: Remove reference to TestToolPage.
+ * LaunchConfigTabTest.java: Use real ToolPage.
+
+2009-06-22 Elliott Baron <ebaron@redhat.com>
+
+ * MinVersionTest.java: New file.
+ * AllTests.java (suite): Added MinVersionTest.
+
+2009-05-27 Elliott Baron <ebaron@redhat.com>
+
+ * LaunchConfigTabTest.java: Changed for restructuring of findValgrindVersion.
+
+2009-05-26 Elliott Baron <ebaron@redhat.com>
+
+ * LaunchConfigTabTest.java: New tests for --main-stacksize and --track-origins.
+ * MemcheckTestToolPage.java: Getters for new controls.
+
+2009-04-30 Elliott Baron <ebaron@redhat.com>
+
+ * resources/segvtest/.cproject: New file.
+ * resources/segvtest/.project: New file.
+ * resources/segvtest/Debug: New file.
+ * resources/segvtest/main.c: New file.
+ * SignalTest.java: New file.
+ * META-INF/MANIFEST.MF: New deps.
+ * AllTests.java (suite): Added SignalTest.
+ * BasicMemcheckTest.java: Handle refactoring of Memcheck plugin.
+ * DoubleClickTest.java: Likewise.
+ * ExpandCollapseTest.java: Likewise.
+ * LaunchConfigTabTest.java: Likewise.
+ * LinkedResourceDoubleClickTest.java: Likewise.
+ * LinkedResourceMarkerTest.java: Likewise.
+ * MarkerTest.java: Likewise.
+ * MultiProcessTest.java: Likewise; delete referenced project.
+
+2009-04-23 Elliott Baron <ebaron@redhat.com>
+
+ * ShortcutTest.java: New file.
+ * META-INF/MANIFEST.MF: New dep.
+ * AllTests.java (suite): ShortcutTest added.
+
+2009-04-21 Elliott Baron <ebaron@redhat.com>
+
+ * AbstractLinkedResourceMemcheckTest.java (setUp): Turning off autobuilding now done in super,
+ call buildProject, instead of building manually.
+ (tearDown): Call super last.
+ * BasicMemcheckTest.java (tearDown): Likewise.
+ * DoubleClickTest.java (tearDown): Likewise.
+ * ExpandCollapseTest.java (tearDown): Likewise.
+ * LaunchConfigTabTest.java (tearDown): Likewise.
+ * MarkerTest.java (tearDown): Likewise.
+ * MultiProcessTest.java (tearDown): Likewise.
+ * test.xml: Fix classname in cleanup target.
+
+2009-04-03 Elliott Baron <ebaron@redhat.com>
+
+ * META-INF/MANIFEST.MF: 0.2.0 version.
+
+2009-03-31 Elliott Baron <ebaron@redhat.com>
+
+ * ExpandCollapseTest.java: New file.
+ * AllTests.java (suite): Added ExpandCollapseTest.
+
+2009-03-26 Elliott Baron <ebaron@redhat.com>
+
+ * resources/multiProcTest: New test project.
+ * MultiProcessTest.java: New file.
+ * AllTests.java: Added MultiProcessTest to suite.
+
+2009-03-18 Elliott Baron <ebaron@redhat.com>
+
+ * resources/linkedTest/: New test project.
+ * AbstractLinkedResourceMemcheckTest.java: New file.
+ * LinkedResourceDoubleClickTest.java: New file.
+ * LinkedResourceMarkerTest.java: New file.
+ * META-INF/MANIFEST.MF: New deps.
+ * AllTests.java (suite): Added new tests to suite.
+ * BasicMemcheckTest.java (setUp): Refactoring from profiling.tests.
+ * DoubleClickTest.java (setUp): Likewise.
+ * LaunchConfigTabTest.java (setUp): Likewise.
+ * MarkerTest.java (setUp): Likewise.
+ (getTopWorkspaceFrame): Use findFilesForLocation for linked resource compatibility.
+
+2009-03-13 Andrew Overholt <overholt@redhat.com>
+
+ * test.xml: classname -> memcheck_classname.
+
+2009-03-10 Elliott Baron <ebaron@redhat.com>
+
+ * AbstractMemcheckTest.java (getToolPage): Pass tool page to superclass.
+ * BasicMemcheckTest.java: Call super on setUp and tearDown.
+ * DoubleClickTest.java: Likewise.
+ * LaunchConfigTabTest.java: Likewise.
+ * MarkerTest.java: Likewise.
+ * MemcheckLaunchMockPlugin.java: Removed.
+
+2009-03-04 Andrew Overholt <overholt@redhat.com>
+
+ * test.xml: s/autoconf-folder/memcheck-folder.
+
+2009-02-25 Elliott Baron <ebaron@redhat.com>
+
+ * valgrindFiles/*: Saved output from actual valgrind run. Used for testing
+ in environments without Valgrind.
+ * build.properties: Added valgrindFiles.
+ * META-INF/MANIFEST.MF: New dependency.
+ * AbstractMemcheckTest.java: Extracted superclass.
+ * BasicMemcheckTest.java: Use new launching method.
+ * DoubleClickTest.java: Likewise.
+ * LaunchConfigTabTest.java: Likewise.
+ * MarkerTest.java: Likewise.
+
+2009-02-12 Elliott Baron <ebaron@redhat.com>
+
+ * resources/basicTest/test suppfile.supp: New file.
+ * resources/basicTest/testsuppfile.supp: New file.
+ * LaunchConfigTabTest.java: New file.
+ * MemcheckLaunchMockPlugin.java: New file.
+ * MemcheckTestToolPage.java: New file.
+ * META-INF/MANIFEST.MF: Added ui.console import.
+ * resources/basicTest/test.c: Removed useless statement.
+ * AbstractMemcheckTest.java: Refactoring.
+ * AllTests.java: Added LaunchConfigTabTest.
+ * MarkerTest.java (getTopWorkspaceFrame): Changed to getAbsolutePath.
+ * MemcheckTestsPlugin.java: Extend AbstractUIPlugin instead of Plugin.
+
+2009-02-03 Elliott Baron <ebaron@redhat.com>
+
+ * LaunchConfigTabTest: Removed for now.
+ * META-INF/MANIFEST.MF: Require-Bundle for JUnit < 4.0.0
+
+2009-02-03 Andrew Overholt <overholt@redhat.com>
+
+ * META-INF/MANIFEST.MF: Use Require-Bundle instead of Import-Package to
+ ensure we get JUnit 3 and not JUnit4.
+
+2009-02-02 Andrew Overholt <overholt@redhat.com>
+
+ * test.xml: Update. Fix plugin-name.
+
+2009-01-05 Elliott Baron <ebaron@redhat.com>
+
+ * META-INF/MANIFEST.MF: Changed version to 0.1.0. \ No newline at end of file
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/META-INF/MANIFEST.MF b/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..901cb1c2af
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,44 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.eclipse.linuxtools.valgrind.memcheck.tests;singleton:=true
+Bundle-Version: 0.4.0.qualifier
+Bundle-Activator: org.eclipse.linuxtools.internal.valgrind.memcheck.tests.MemcheckTestsPlugin
+Bundle-Vendor: %Bundle-Vendor.0
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.junit;bundle-version="4.7.0"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Bundle-Localization: plugin
+Import-Package: org.eclipse.cdt.core,
+ org.eclipse.cdt.core.model,
+ org.eclipse.cdt.core.resources,
+ org.eclipse.cdt.core.testplugin,
+ org.eclipse.cdt.debug.core,
+ org.eclipse.cdt.debug.ui,
+ org.eclipse.cdt.launch,
+ org.eclipse.core.resources,
+ org.eclipse.debug.core,
+ org.eclipse.debug.core.model,
+ org.eclipse.debug.ui,
+ org.eclipse.debug.ui.console,
+ org.eclipse.debug.ui.sourcelookup,
+ org.eclipse.jface.text,
+ org.eclipse.linuxtools.internal.valgrind.core,
+ org.eclipse.linuxtools.internal.valgrind.launch,
+ org.eclipse.linuxtools.internal.valgrind.memcheck,
+ org.eclipse.linuxtools.internal.valgrind.tests,
+ org.eclipse.linuxtools.internal.valgrind.ui,
+ org.eclipse.linuxtools.profiling.launch,
+ org.eclipse.linuxtools.profiling.tests,
+ org.eclipse.linuxtools.valgrind.core,
+ org.eclipse.linuxtools.valgrind.launch,
+ org.eclipse.linuxtools.valgrind.ui,
+ org.eclipse.ui,
+ org.eclipse.ui.actions,
+ org.eclipse.ui.console,
+ org.eclipse.ui.ide,
+ org.eclipse.ui.texteditor,
+ org.eclipse.ui.wizards.datatransfer
+Export-Package: org.eclipse.linuxtools.internal.valgrind.memcheck.tests
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/plugin.properties b/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/plugin.properties
new file mode 100644
index 0000000000..031f4e7cd3
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/plugin.properties
@@ -0,0 +1,3 @@
+#Properties file for org.eclipse.linuxtools.valgrind.memcheck.tests
+Bundle-Vendor.0 = Eclipse Linux Tools
+Bundle-Name.0 = Memcheck Tests Plug-in (Incubation) \ No newline at end of file
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/resources/basicTest/test.c b/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/resources/basicTest/test.c
new file mode 100644
index 0000000000..b70783fd0a
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/resources/basicTest/test.c
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * 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:
+ * Elliott Baron <ebaron@redhat.com> - initial API and implementation
+ *******************************************************************************/
+#include <stdlib.h>
+
+#define SIZE 10
+int main() {
+ char *waste = (char *)malloc(sizeof(char) * SIZE);
+ waste[0] = waste[SIZE];
+ waste[SIZE] = 0;
+ return 0;
+}
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/resources/linkedTest/src/test.c b/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/resources/linkedTest/src/test.c
new file mode 100644
index 0000000000..b70783fd0a
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/resources/linkedTest/src/test.c
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * 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:
+ * Elliott Baron <ebaron@redhat.com> - initial API and implementation
+ *******************************************************************************/
+#include <stdlib.h>
+
+#define SIZE 10
+int main() {
+ char *waste = (char *)malloc(sizeof(char) * SIZE);
+ waste[0] = waste[SIZE];
+ waste[SIZE] = 0;
+ return 0;
+}
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/resources/multiProcTest/parent.c b/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/resources/multiProcTest/parent.c
new file mode 100644
index 0000000000..2f60eb5db7
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/resources/multiProcTest/parent.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#define SIZE 10
+int main() {
+ if (fork()) {
+ char *waste = (char *)malloc(sizeof(char) * SIZE);
+ }
+ else {
+ execv("../basicTest/Debug/basicTest", NULL);
+ perror("execv");
+ }
+ return 0;
+}
+
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/AllTests.java b/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/AllTests.java
new file mode 100644
index 0000000000..244abcb9c9
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/AllTests.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * 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:
+ * Elliott Baron <ebaron@redhat.com> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.valgrind.memcheck.tests;
+
+import org.eclipse.linuxtools.internal.valgrind.memcheck.MemcheckPlugin;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllTests {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite(
+ "Tests for " + MemcheckPlugin.PLUGIN_ID); //$NON-NLS-1$
+ // $JUnit-BEGIN$
+ suite.addTestSuite(BasicMemcheckTest.class);
+ suite.addTestSuite(DoubleClickTest.class);
+ suite.addTestSuite(LaunchConfigTabTest.class);
+ suite.addTestSuite(MarkerTest.class);
+ suite.addTestSuite(LinkedResourceDoubleClickTest.class);
+ suite.addTestSuite(LinkedResourceMarkerTest.class);
+ suite.addTestSuite(MultiProcessTest.class);
+ suite.addTestSuite(ExpandCollapseTest.class);
+ suite.addTestSuite(ShortcutTest.class);
+ suite.addTestSuite(SignalTest.class);
+ suite.addTestSuite(MinVersionTest.class);
+ suite.addTestSuite(LocationPreferenceTest.class);
+ // $JUnit-END$
+ return suite;
+ }
+
+}
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/DoubleClickTest.java b/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/DoubleClickTest.java
new file mode 100644
index 0000000000..9f15dc91e2
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/DoubleClickTest.java
@@ -0,0 +1,151 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * 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:
+ * Elliott Baron <ebaron@redhat.com> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.valgrind.memcheck.tests;
+
+import java.io.File;
+
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.jface.text.TextSelection;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.TreePath;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.linuxtools.internal.valgrind.core.ValgrindStackFrame;
+import org.eclipse.linuxtools.internal.valgrind.ui.CoreMessagesViewer;
+import org.eclipse.linuxtools.internal.valgrind.ui.ValgrindUIPlugin;
+import org.eclipse.linuxtools.internal.valgrind.ui.ValgrindViewPart;
+import org.eclipse.linuxtools.valgrind.core.IValgrindMessage;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.texteditor.ITextEditor;
+
+public class DoubleClickTest extends AbstractMemcheckTest {
+ private ValgrindStackFrame frame;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ proj = createProjectAndBuild("basicTest"); //$NON-NLS-1$
+ }
+
+ private void doDoubleClick() throws Exception {
+ ValgrindViewPart view = ValgrindUIPlugin.getDefault().getView();
+ CoreMessagesViewer viewer = view.getMessagesViewer();
+
+ // get first leaf
+ IValgrindMessage[] elements = (IValgrindMessage[]) viewer.getTreeViewer().getInput();
+ IValgrindMessage element = elements[0];
+ TreePath path = new TreePath(new Object[] { element });
+ frame = null;
+ while (element.getChildren().length > 0) {
+ element = element.getChildren()[0];
+ path = path.createChildPath(element);
+ if (element instanceof ValgrindStackFrame) {
+ frame = (ValgrindStackFrame) element;
+ }
+ }
+ assertNotNull(frame);
+
+ viewer.getTreeViewer().expandToLevel(frame, TreeViewer.ALL_LEVELS);
+ TreeSelection selection = new TreeSelection(path);
+
+ // do double click
+ IDoubleClickListener listener = viewer.getDoubleClickListener();
+ listener.doubleClick(new DoubleClickEvent(viewer.getTreeViewer(), selection));
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ deleteProject(proj);
+ super.tearDown();
+ }
+
+ public void testDoubleClickFile() throws Exception {
+ ILaunchConfiguration config = createConfiguration(proj.getProject());
+ doLaunch(config, "testDoubleClickFile"); //$NON-NLS-1$
+
+ doDoubleClick();
+
+ IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ IEditorInput input = editor.getEditorInput();
+ if (input instanceof IFileEditorInput) {
+ IFileEditorInput fileInput = (IFileEditorInput) input;
+ File expectedFile = new File(proj.getProject().getLocation().toOSString(), frame.getFile());
+ File actualFile = fileInput.getFile().getLocation().toFile();
+
+ assertEquals(expectedFile.getCanonicalPath(), actualFile.getCanonicalPath());
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testDoubleClickLine() throws Exception {
+ ILaunchConfiguration config = createConfiguration(proj.getProject());
+ doLaunch(config, "testDoubleClickLine"); //$NON-NLS-1$
+
+ doDoubleClick();
+
+ IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ if (editor instanceof ITextEditor) {
+ ITextEditor textEditor = (ITextEditor) editor;
+
+ ISelection selection = textEditor.getSelectionProvider().getSelection();
+ if (selection instanceof TextSelection) {
+ TextSelection textSelection = (TextSelection) selection;
+ int line = textSelection.getStartLine() + 1; // zero-indexed
+
+ assertEquals(frame.getLine(), line);
+ }
+ else {
+ fail();
+ }
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testDoubleClickLaunchRemoved() throws Exception {
+ ILaunchConfiguration config = createConfiguration(proj.getProject());
+ ILaunch launch = doLaunch(config, "testDoubleClickLine"); //$NON-NLS-1$
+
+ // Remove launch - tests #284919
+ DebugPlugin.getDefault().getLaunchManager().removeLaunch(launch);
+
+ doDoubleClick();
+
+ IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ if (editor instanceof ITextEditor) {
+ ITextEditor textEditor = (ITextEditor) editor;
+
+ ISelection selection = textEditor.getSelectionProvider().getSelection();
+ if (selection instanceof TextSelection) {
+ TextSelection textSelection = (TextSelection) selection;
+ int line = textSelection.getStartLine() + 1; // zero-indexed
+
+ assertEquals(frame.getLine(), line);
+ }
+ else {
+ fail();
+ }
+ }
+ else {
+ fail();
+ }
+ }
+}
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/ExpandCollapseTest.java b/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/ExpandCollapseTest.java
new file mode 100644
index 0000000000..22ee9f4b24
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/ExpandCollapseTest.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * 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:
+ * Elliott Baron <ebaron@redhat.com> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.valgrind.memcheck.tests;
+
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.jface.viewers.TreePath;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.linuxtools.internal.valgrind.ui.CoreMessagesViewer;
+import org.eclipse.linuxtools.internal.valgrind.ui.ValgrindUIPlugin;
+import org.eclipse.linuxtools.internal.valgrind.ui.ValgrindViewPart;
+import org.eclipse.linuxtools.valgrind.core.IValgrindMessage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Menu;
+
+public class ExpandCollapseTest extends AbstractMemcheckTest {
+
+ protected CoreMessagesViewer viewer;
+ protected Menu contextMenu;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ proj = createProjectAndBuild("basicTest"); //$NON-NLS-1$
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ deleteProject(proj);
+ super.tearDown();
+ }
+
+ public void testExpand() throws Exception {
+ ILaunchConfiguration config = createConfiguration(proj.getProject());
+ doLaunch(config, "testDefaults"); //$NON-NLS-1$
+
+ ValgrindViewPart view = ValgrindUIPlugin.getDefault().getView();
+ viewer = view.getMessagesViewer();
+ contextMenu = viewer.getTreeViewer().getTree().getMenu();
+
+ // Select first error and expand it
+ IValgrindMessage[] messages = (IValgrindMessage[]) viewer.getTreeViewer().getInput();
+ IValgrindMessage element = messages[0];
+ TreeSelection selection = new TreeSelection(new TreePath(new Object[] { element }));
+ viewer.getTreeViewer().setSelection(selection);
+ contextMenu.notifyListeners(SWT.Show, null);
+ contextMenu.getItem(0).notifyListeners(SWT.Selection, null);
+
+ checkExpanded(element, true);
+ }
+
+ public void testCollapse() throws Exception {
+ // Expand the element first
+ testExpand();
+
+ // Then collapse it
+ IValgrindMessage[] messages = (IValgrindMessage[]) viewer.getTreeViewer().getInput();
+ IValgrindMessage element = messages[0];
+ TreeSelection selection = new TreeSelection(new TreePath(new Object[] { element }));
+ viewer.getTreeViewer().setSelection(selection);
+ contextMenu.notifyListeners(SWT.Show, null);
+ contextMenu.getItem(1).notifyListeners(SWT.Selection, null);
+
+ checkExpanded(element, false);
+ }
+
+ private void checkExpanded(IValgrindMessage element, boolean expanded) {
+ if (element.getChildren().length > 0) {
+ // only applicable to internal nodes
+ if (expanded) {
+ assertTrue(viewer.getTreeViewer().getExpandedState(element));
+ }
+ else {
+ assertFalse(viewer.getTreeViewer().getExpandedState(element));
+ }
+ }
+ for (IValgrindMessage child : element.getChildren()) {
+ checkExpanded(child, expanded);
+ }
+ }
+}
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/LaunchConfigTabTest.java b/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/LaunchConfigTabTest.java
new file mode 100644
index 0000000000..8cda469720
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/LaunchConfigTabTest.java
@@ -0,0 +1,545 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * 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:
+ * Elliott Baron <ebaron@redhat.com> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.valgrind.memcheck.tests;
+
+import java.util.Arrays;
+
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.debug.ui.ILaunchConfigurationTab;
+import org.eclipse.linuxtools.internal.valgrind.launch.ValgrindLaunchPlugin;
+import org.eclipse.linuxtools.internal.valgrind.launch.ValgrindOptionsTab;
+import org.eclipse.linuxtools.internal.valgrind.memcheck.MemcheckLaunchConstants;
+import org.eclipse.linuxtools.internal.valgrind.memcheck.MemcheckPlugin;
+import org.eclipse.linuxtools.internal.valgrind.memcheck.MemcheckToolPage;
+import org.eclipse.linuxtools.internal.valgrind.ui.ValgrindUIPlugin;
+import org.eclipse.linuxtools.internal.valgrind.ui.ValgrindViewPart;
+import org.eclipse.linuxtools.valgrind.core.IValgrindMessage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.osgi.framework.Version;
+
+public class LaunchConfigTabTest extends AbstractMemcheckTest {
+
+ protected ValgrindOptionsTab tab;
+ protected MemcheckToolPage dynamicTab;
+ protected ILaunchConfiguration config;
+ protected Shell testShell;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ proj = createProjectAndBuild("basicTest"); //$NON-NLS-1$
+
+ config = createConfiguration(proj.getProject());
+
+ testShell = new Shell(Display.getDefault());
+ testShell.setLayout(new GridLayout());
+ tab = new ValgrindOptionsTab();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ tab.dispose();
+ testShell.dispose();
+ deleteProject(proj);
+ super.tearDown();
+ }
+
+ private ILaunchConfigurationWorkingCopy initConfig() throws CoreException {
+ ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
+ tab.setDefaults(wc);
+ tab.createControl(testShell);
+ tab.initializeFrom(config);
+ int ix = Arrays.asList(tab.getTools()).indexOf(MemcheckPlugin.TOOL_ID);
+ tab.getToolsCombo().select(ix);
+ ILaunchConfigurationTab dynamicTab = tab.getDynamicTab();
+ this.dynamicTab = (MemcheckToolPage) dynamicTab;
+ return wc;
+ }
+
+ private ILaunch saveAndLaunch(ILaunchConfigurationWorkingCopy wc, String testName)
+ throws Exception {
+ tab.performApply(wc);
+ config = wc.doSave();
+
+ ILaunch launch = doLaunch(config, testName);
+ return launch;
+ }
+
+ public void testDefaults() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ ILaunch launch = saveAndLaunch(wc, "testDefaults"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--tool=memcheck")); //$NON-NLS-1$
+ assertTrue(cmd.contains("-q")); //$NON-NLS-1$
+ assertTrue(cmd.contains("--trace-children=no")); //$NON-NLS-1$
+ assertTrue(cmd.contains("--child-silent-after-fork=yes")); //$NON-NLS-1$
+ assertTrue(cmd.contains("--demangle=yes")); //$NON-NLS-1$
+ assertTrue(cmd.contains("--num-callers=12")); //$NON-NLS-1$
+ assertTrue(cmd.contains("--error-limit=yes")); //$NON-NLS-1$
+ assertTrue(cmd.contains("--show-below-main=no")); //$NON-NLS-1$
+ assertFalse(cmd.contains("--suppressions=")); //$NON-NLS-1$
+ assertTrue(cmd.contains("--max-stackframe=2000000")); //$NON-NLS-1$
+ assertFalse(cmd.contains("--alignment=")); //$NON-NLS-1$
+ assertTrue(cmd.contains("--run-libc-freeres=yes")); //$NON-NLS-1$
+
+ assertTrue(cmd.contains("--leak-check=yes")); //$NON-NLS-1$
+ assertTrue(cmd.contains("--show-reachable=no")); //$NON-NLS-1$
+ assertTrue(cmd.contains("--leak-resolution=low")); //$NON-NLS-1$
+ assertTrue(cmd.contains("--freelist-vol=10000000")); //$NON-NLS-1$
+ assertTrue(cmd.contains("--workaround-gcc296-bugs=no")); //$NON-NLS-1$
+ assertTrue(cmd.contains("--partial-loads-ok=no")); //$NON-NLS-1$
+ assertTrue(cmd.contains("--undef-value-errors=yes")); //$NON-NLS-1$
+
+ // 3.4.0 specific
+ Version ver = ValgrindLaunchPlugin.getDefault().getValgrindVersion();
+ if (ver.compareTo(ValgrindLaunchPlugin.VER_3_4_0) >= 0) {
+ assertTrue(cmd.contains("--track-origins=no")); //$NON-NLS-1$
+ }
+ else {
+ assertFalse(cmd.contains("--track-origins")); //$NON-NLS-1$
+ }
+ assertFalse(cmd.contains("--main-stacksize")); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testWSSuppresions() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ String text = "${workspace_loc:/basicTest/testsuppfile.supp}"; //$NON-NLS-1$
+ tab.getSuppFileList().add(text);
+ ILaunch launch = saveAndLaunch(wc, "testWSSuppresions"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ IPath suppPath = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path("basicTest/testsuppfile.supp")).getLocation(); //$NON-NLS-1$
+ assertTrue(cmd.contains("--suppressions=" + suppPath.toOSString())); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testSuppressions() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ IPath suppPath = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path("basicTest/testsuppfile.supp")).getLocation(); //$NON-NLS-1$
+ tab.getSuppFileList().add(suppPath.toOSString());
+ ILaunch launch = saveAndLaunch(wc, "testSuppressions"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--suppressions=" + suppPath.toOSString())); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testSuppressionsMultiple() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ IPath suppPath = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path("basicTest/testsuppfile.supp")).getLocation(); //$NON-NLS-1$
+ IPath suppPath2 = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path("basicTest/testsuppfile2.supp")).getLocation(); //$NON-NLS-1$
+ tab.getSuppFileList().add(suppPath.toOSString());
+ tab.getSuppFileList().add(suppPath2.toOSString());
+ ILaunch launch = saveAndLaunch(wc, "testSuppressionsMultiple"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--suppressions=" + suppPath.toOSString())); //$NON-NLS-1$
+ assertTrue(cmd.contains("--suppressions=" + suppPath2.toOSString())); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testSuppressionsSpaces() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ IPath suppPath = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path("basicTest/test suppfile.supp")).getLocation(); //$NON-NLS-1$
+ tab.getSuppFileList().add(suppPath.toOSString());
+ ILaunch launch = saveAndLaunch(wc, "testSuppressionsSpaces"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--suppressions=" + suppPath.toOSString())); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testTraceChildren() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ tab.getTraceChildrenButton().setSelection(true);
+ ILaunch launch = saveAndLaunch(wc, "testTraceChildren"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--trace-children=yes")); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testDemangle() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ tab.getDemangleButton().setSelection(false);
+ ILaunch launch = saveAndLaunch(wc, "testDemangle"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--demangle=no")); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testNumCallers() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ tab.getNumCallersSpinner().setSelection(24);
+ ILaunch launch = saveAndLaunch(wc, "testNumCallers"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--num-callers=24")); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testErrorLimit() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ tab.getErrorLimitButton().setSelection(false);
+ ILaunch launch = saveAndLaunch(wc, "testErrorLimit"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--error-limit=no")); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testShowBelowMain() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ tab.getShowBelowMainButton().setSelection(true);
+ ILaunch launch = saveAndLaunch(wc, "testShowBelowMain"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--show-below-main=yes")); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testMaxStackframe() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ tab.getMaxStackFrameSpinner().setSelection(50000000);
+ ILaunch launch = saveAndLaunch(wc, "testMaxStackframe"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--max-stackframe=50000000")); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testRunFreeRes() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ tab.getRunFreeresButton().setSelection(false);
+ ILaunch launch = saveAndLaunch(wc, "testRunFreeRes"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--run-libc-freeres=no")); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testAlignment() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+
+ assertFalse(dynamicTab.getAlignmentSpinner().getEnabled());
+ dynamicTab.getAlignmentButton().setSelection(true);
+ dynamicTab.getAlignmentButton().notifyListeners(SWT.Selection, null);
+ assertTrue(dynamicTab.getAlignmentSpinner().getEnabled());
+
+ dynamicTab.getAlignmentSpinner().setSelection(512);
+ tab.performApply(wc);
+ config = wc.doSave();
+
+ assertTrue(tab.isValid(config));
+
+ ILaunch launch = doLaunch(config, "testAlignment"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--alignment=512")); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testAlignmentBad() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+
+ assertFalse(dynamicTab.getAlignmentSpinner().getEnabled());
+ dynamicTab.getAlignmentButton().setSelection(true);
+ dynamicTab.getAlignmentButton().notifyListeners(SWT.Selection, null);
+ assertTrue(dynamicTab.getAlignmentSpinner().getEnabled());
+
+ dynamicTab.getAlignmentSpinner().setSelection(63);
+ tab.performApply(wc);
+ config = wc.doSave();
+
+ assertFalse(tab.isValid(config));
+ }
+
+ public void testNoLeakCheck() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ dynamicTab.getLeakCheckButton().setSelection(false);
+ ILaunch launch = saveAndLaunch(wc, "testNoLeakCheck"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--leak-check=no")); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testShowReachable() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ dynamicTab.getShowReachableButton().setSelection(true);
+ ILaunch launch = saveAndLaunch(wc, "testShowReachable"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--show-reachable=yes")); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testLeakResolutionMed() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ String[] opts = dynamicTab.getLeakResCombo().getItems();
+ int ix = Arrays.asList(opts).indexOf(MemcheckLaunchConstants.LEAK_RES_MED);
+ dynamicTab.getLeakResCombo().select(ix);
+ ILaunch launch = saveAndLaunch(wc, "testLeakResolutionMed"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--leak-resolution=med")); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testLeakResolutionHigh() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ String[] opts = dynamicTab.getLeakResCombo().getItems();
+ int ix = Arrays.asList(opts).indexOf(MemcheckLaunchConstants.LEAK_RES_HIGH);
+ dynamicTab.getLeakResCombo().select(ix);
+ ILaunch launch = saveAndLaunch(wc, "testLeakResolutionHigh"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--leak-resolution=high")); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testFreeListVol() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ dynamicTab.getFreelistSpinner().setSelection(2000000);
+ ILaunch launch = saveAndLaunch(wc, "testFreeListVol"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--freelist-vol=2000000")); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testWorkaroundGCCBugs() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ dynamicTab.getGccWorkaroundButton().setSelection(true);
+ ILaunch launch = saveAndLaunch(wc, "testWorkaroundGCCBugs"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--workaround-gcc296-bugs=yes")); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testPartialLoads() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ dynamicTab.getPartialLoadsButton().setSelection(true);
+ ILaunch launch = saveAndLaunch(wc, "testPartialLoads"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--partial-loads-ok=yes")); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testUndefValueErrors() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ dynamicTab.getUndefValueButton().setSelection(false);
+ ILaunch launch = saveAndLaunch(wc, "testUndefValueErrors"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--undef-value-errors=no")); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testMainStackSize() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ Version ver = ValgrindLaunchPlugin.getDefault().getValgrindVersion();
+ if (ver.compareTo(ValgrindLaunchPlugin.VER_3_4_0) >= 0) {
+ assertFalse(tab.getMainStackSizeSpinner().isEnabled());
+ tab.getMainStackSizeButton().setSelection(true);
+ tab.getMainStackSizeButton().notifyListeners(SWT.Selection, null);
+ assertTrue(tab.getMainStackSizeSpinner().isEnabled());
+ tab.getMainStackSizeSpinner().setSelection(2048);
+ ILaunch launch = saveAndLaunch(wc, "testMainStackFrame"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--main-stacksize=2048")); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+ else {
+ assertNull(tab.getMainStackSizeButton());
+ assertNull(tab.getMainStackSizeSpinner());
+ }
+ }
+
+ public void testTrackOrigins() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ Version ver = ValgrindLaunchPlugin.getDefault().getValgrindVersion();
+ if (ver.compareTo(ValgrindLaunchPlugin.VER_3_4_0) >= 0) {
+ dynamicTab.getTrackOriginsButton().setSelection(true);
+ ILaunch launch = saveAndLaunch(wc, "testTrackOrigins"); //$NON-NLS-1$
+ IProcess[] p = launch.getProcesses();
+ if (p.length > 0) {
+ String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
+ assertEquals(0, p[0].getExitValue());
+ assertTrue(cmd.contains("--track-origins=yes")); //$NON-NLS-1$
+ }
+ else {
+ fail();
+ }
+ }
+ else {
+ assertNull(dynamicTab.getTrackOriginsButton());
+ }
+ }
+
+ public void testTrackOriginsValidity() throws Exception {
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ Version ver = ValgrindLaunchPlugin.getDefault().getValgrindVersion();
+ if (ver.compareTo(ValgrindLaunchPlugin.VER_3_4_0) >= 0) {
+ dynamicTab.getTrackOriginsButton().setSelection(true);
+ tab.performApply(wc);
+ assertTrue(tab.isValid(wc));
+ dynamicTab.getUndefValueButton().setSelection(false);
+ tab.performApply(wc);
+ assertFalse(tab.isValid(wc));
+ }
+ }
+
+ public void testValgrindError() throws Exception {
+ String notExistentFile = "DOES NOT EXIST"; //$NON-NLS-1$
+ ILaunchConfigurationWorkingCopy wc = initConfig();
+ tab.getSuppFileList().add(notExistentFile);
+ tab.performApply(wc);
+ config = wc.doSave();
+
+ assertFalse(tab.isValid(config));
+
+ doLaunch(config, "testValgrindError"); //$NON-NLS-1$
+
+ ValgrindViewPart view = ValgrindUIPlugin.getDefault().getView();
+ IValgrindMessage[] messages = view.getMessages();
+ assertTrue(messages.length > 0);
+
+ String text = messages[0].getText();
+ assertTrue(text.contains(notExistentFile));
+ }
+}
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/LinkedResourceDoubleClickTest.java b/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/LinkedResourceDoubleClickTest.java
new file mode 100644
index 0000000000..9b15d74b7f
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/LinkedResourceDoubleClickTest.java
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * 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:
+ * Elliott Baron <ebaron@redhat.com> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.valgrind.memcheck.tests;
+
+import java.io.File;
+
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.jface.text.TextSelection;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.TreePath;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.linuxtools.internal.valgrind.core.ValgrindStackFrame;
+import org.eclipse.linuxtools.internal.valgrind.ui.CoreMessagesViewer;
+import org.eclipse.linuxtools.internal.valgrind.ui.ValgrindUIPlugin;
+import org.eclipse.linuxtools.internal.valgrind.ui.ValgrindViewPart;
+import org.eclipse.linuxtools.valgrind.core.IValgrindMessage;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.texteditor.ITextEditor;
+
+public class LinkedResourceDoubleClickTest extends AbstractLinkedResourceMemcheckTest {
+ private ValgrindStackFrame frame;
+
+ public void testLinkedDoubleClickFile() throws Exception {
+ ILaunchConfiguration config = createConfiguration(proj.getProject());
+ doLaunch(config, "testLinkedDoubleClickFile"); //$NON-NLS-1$
+
+ doDoubleClick();
+
+ IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ IEditorInput input = editor.getEditorInput();
+ if (input instanceof IFileEditorInput) {
+ IFileEditorInput fileInput = (IFileEditorInput) input;
+ IFolder srcFolder = proj.getProject().getFolder("src"); //$NON-NLS-1$
+ File expectedFile = new File(srcFolder.getLocation().toOSString(), frame.getFile());
+ File actualFile = fileInput.getFile().getLocation().toFile();
+
+ assertTrue(fileInput.getFile().isLinked(IResource.CHECK_ANCESTORS));
+ assertEquals(expectedFile.getCanonicalPath(), actualFile.getCanonicalPath());
+ }
+ else {
+ fail();
+ }
+ }
+
+ public void testLinkedDoubleClickLine() throws Exception {
+ ILaunchConfiguration config = createConfiguration(proj.getProject());
+ doLaunch(config, "testLinkedDoubleClickLine"); //$NON-NLS-1$
+
+ doDoubleClick();
+
+ IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ if (editor instanceof ITextEditor) {
+ ITextEditor textEditor = (ITextEditor) editor;
+
+ ISelection selection = textEditor.getSelectionProvider().getSelection();
+ if (selection instanceof TextSelection) {
+ TextSelection textSelection = (TextSelection) selection;
+ int line = textSelection.getStartLine() + 1; // zero-indexed
+
+ assertEquals(frame.getLine(), line);
+ }
+ else {
+ fail();
+ }
+ }
+ else {
+ fail();
+ }
+ }
+
+ private void doDoubleClick() throws Exception {
+ ValgrindViewPart view = ValgrindUIPlugin.getDefault().getView();
+ CoreMessagesViewer viewer = view.getMessagesViewer();
+
+ // get first leaf
+ IValgrindMessage[] elements = (IValgrindMessage[]) viewer.getTreeViewer().getInput();
+ IValgrindMessage element = elements[0];
+ TreePath path = new TreePath(new Object[] { element });
+ frame = null;
+ while (element.getChildren().length > 0) {
+ element = element.getChildren()[0];
+ path = path.createChildPath(element);
+ if (element instanceof ValgrindStackFrame) {
+ frame = (ValgrindStackFrame) element;
+ }
+ }
+ assertNotNull(frame);
+
+ viewer.getTreeViewer().expandToLevel(frame, TreeViewer.ALL_LEVELS);
+ TreeSelection selection = new TreeSelection(path);
+
+ // do double click
+ IDoubleClickListener listener = viewer.getDoubleClickListener();
+ listener.doubleClick(new DoubleClickEvent(viewer.getTreeViewer(), selection));
+ }
+}
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/LinkedResourceMarkerTest.java b/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/LinkedResourceMarkerTest.java
new file mode 100644
index 0000000000..62fa2b111c
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/LinkedResourceMarkerTest.java
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * 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:
+ * Elliott Baron <ebaron@redhat.com> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.valgrind.memcheck.tests;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.model.ISourceLocator;
+import org.eclipse.debug.ui.DebugUITools;
+import org.eclipse.linuxtools.internal.valgrind.core.ValgrindError;
+import org.eclipse.linuxtools.internal.valgrind.core.ValgrindStackFrame;
+import org.eclipse.linuxtools.internal.valgrind.launch.ValgrindLaunchPlugin;
+import org.eclipse.linuxtools.internal.valgrind.ui.ValgrindUIPlugin;
+import org.eclipse.linuxtools.internal.valgrind.ui.ValgrindViewPart;
+import org.eclipse.linuxtools.valgrind.core.IValgrindMessage;
+
+public class LinkedResourceMarkerTest extends AbstractLinkedResourceMemcheckTest {
+
+ public void testLinkedMarkers() throws Exception {
+ ILaunchConfiguration config = createConfiguration(proj.getProject());
+ doLaunch(config, "testLinkedMarkers"); //$NON-NLS-1$
+
+ ValgrindViewPart view = ValgrindUIPlugin.getDefault().getView();
+ IValgrindMessage[] errors = view.getMessages();
+
+ ArrayList<IMarker> markers = new ArrayList<IMarker>(Arrays.asList(proj
+ .getProject().findMarkers(ValgrindLaunchPlugin.MARKER_TYPE,
+ true, IResource.DEPTH_INFINITE)));
+ assertEquals(5, markers.size());
+ for (IValgrindMessage error : errors) {
+ findMarker(markers, error);
+ }
+ assertEquals(0, markers.size());
+ }
+
+ private void findMarker(ArrayList<IMarker> markers, IValgrindMessage error)
+ throws Exception, CoreException {
+ ValgrindStackFrame frame = null;
+ IValgrindMessage[] children = error.getChildren();
+ for (int i = 0; i < children.length; i++) {
+ if (frame == null && children[i] instanceof ValgrindStackFrame
+ && isWorkspaceFrame((ValgrindStackFrame) children[i])) {
+ frame = (ValgrindStackFrame) children[i];
+ } else if (children[i] instanceof ValgrindError) {
+ findMarker(markers, children[i]);
+ }
+ }
+
+ int ix = -1;
+ for (int i = 0; i < markers.size(); i++) {
+ IMarker marker = markers.get(i);
+ if (marker.getAttribute(IMarker.MESSAGE).equals(error.getText())
+ && marker.getResource().getName().equals(frame.getFile())
+ && marker.getAttribute(IMarker.LINE_NUMBER).equals(
+ frame.getLine())) {
+ ix = i;
+ }
+ }
+ if (ix < 0) {
+ fail();
+ }
+ markers.remove(ix);
+ }
+
+ private boolean isWorkspaceFrame(ValgrindStackFrame frame) throws Exception {
+ ISourceLocator locator = frame.getLaunch().getSourceLocator();
+ Object result = DebugUITools.lookupSource(frame.getFile(), locator)
+ .getSourceElement();
+ return result != null && result instanceof IResource;
+ }
+}
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/LocationPreferenceTest.java b/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/LocationPreferenceTest.java
new file mode 100644
index 0000000000..3627f73c70
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/LocationPreferenceTest.java
@@ -0,0 +1,34 @@
+package org.eclipse.linuxtools.internal.valgrind.memcheck.tests;
+
+import java.io.IOException;
+
+import junit.framework.TestCase;
+
+import org.eclipse.linuxtools.internal.valgrind.core.ValgrindCommand;
+import org.eclipse.linuxtools.internal.valgrind.core.ValgrindPlugin;
+import org.eclipse.linuxtools.internal.valgrind.core.ValgrindPreferencePage;
+import org.eclipse.linuxtools.internal.valgrind.launch.ValgrindLaunchPlugin;
+
+
+public class LocationPreferenceTest extends TestCase {
+
+ private ValgrindCommand command = new ValgrindCommand() {
+ protected void readIntoBuffer(StringBuffer out, Process p) throws IOException {
+ // Simulate not finding Valgrind in the user's PATH
+ throw new IOException();
+ }
+ };
+
+ /**
+ * Tests Bug #315890 - Valgrind location cannot be overridden unless Valgrind is present in PATH
+ * @throws Exception
+ */
+ public void testManualLocationNoPATH() throws Exception {
+ // Set a preference for a manual location
+ ValgrindPlugin.getDefault().getPreferenceStore().setValue(ValgrindPreferencePage.VALGRIND_PATH, "/path/to/valgrind");
+
+ ValgrindLaunchPlugin.getDefault().setValgrindCommand(command);
+
+ ValgrindLaunchPlugin.getDefault().getValgrindLocation();
+ }
+}
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/MarkerTest.java b/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/MarkerTest.java
new file mode 100644
index 0000000000..df0d68bb3c
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.memcheck.tests/src/org/eclipse/linuxtools/internal/valgrind/memcheck/tests/MarkerTest.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * 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:
+ * Elliott Baron <ebaron@redhat.com> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.valgrind.memcheck.tests;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.model.ISourceLocator;
+import org.eclipse.debug.ui.DebugUITools;
+import org.eclipse.linuxtools.internal.valgrind.core.ValgrindError;
+import org.eclipse.linuxtools.internal.valgrind.core.ValgrindStackFrame;
+import org.eclipse.linuxtools.internal.valgrind.launch.ValgrindLaunchPlugin;
+import org.eclipse.linuxtools.internal.valgrind.ui.ValgrindUIPlugin;
+import org.eclipse.linuxtools.internal.valgrind.ui.ValgrindViewPart;
+import org.eclipse.linuxtools.valgrind.core.IValgrindMessage;
+
+public class MarkerTest extends AbstractMemcheckTest {
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ proj = createProjectAndBuild("basicTest"); //$NON-NLS-1$
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ deleteProject(proj);
+ super.tearDown();
+ }
+
+ public void testMarkers() throws Exception {
+ ILaunchConfiguration config = createConfiguration(proj.getProject());
+ doLaunch(config, "testDefaults"); //$NON-NLS-1$
+
+ ValgrindViewPart view = ValgrindUIPlugin.getDefault().getView();
+ IValgrindMessage[] errors = view.getMessages();
+
+ ArrayList<IMarker> markers = new ArrayList<IMarker>(Arrays.asList(proj
+ .getProject().findMarkers(ValgrindLaunchPlugin.MARKER_TYPE,
+ true, IResource.DEPTH_INFINITE)));
+ assertEquals(5, markers.size());
+ for (IValgrindMessage error : errors) {
+ findMarker(markers, error);
+ }
+ assertEquals(0, markers.size());
+ }
+
+ private void findMarker(ArrayList<IMarker> markers, IValgrindMessage error)
+ throws Exception, CoreException {
+ ValgrindStackFrame frame = null;
+ IValgrindMessage[] children = error.getChildren();
+ for (int i = 0; i < children.length; i++) {
+ if (frame == null && children[i] instanceof ValgrindStackFrame
+ && isWorkspaceFrame((ValgrindStackFrame) children[i])) {
+ frame = (ValgrindStackFrame) children[i];
+ } else if (children[i] instanceof ValgrindError) {
+ findMarker(markers, children[i]);
+ }
+ }
+
+ int ix = -1;
+ for (int i = 0; i < markers.size(); i++) {
+ IMarker marker = markers.get(i);
+ if (marker.getAttribute(IMarker.MESSAGE).equals(error.getText())
+ && marker.getResource().getName().equals(frame.getFile())
+ && marker.getAttribute(IMarker.LINE_NUMBER).equals(
+ frame.getLine())) {
+ ix = i;
+ }
+ }
+ if (ix < 0) {
+ fail();
+ }
+ markers.remove(ix);
+ }
+
+ private boolean isWorkspaceFrame(ValgrindStackFrame frame) throws Exception {
+ ISourceLocator locator = frame.getLaunch().getSourceLocator();
+ Object result = DebugUITools.lookupSource(frame.getFile(), locator)
+ .getSourceElement();
+ return result != null && result instanceof IResource;
+ }
+}
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.memcheck/ChangeLog b/valgrind/org.eclipse.linuxtools.valgrind.memcheck/ChangeLog
new file mode 100644
index 0000000000..de01486091
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.memcheck/ChangeLog
@@ -0,0 +1,118 @@
+2009-09-28 Elliott Baron <ebaron@fedoraproject.org>
+
+ #290597
+ * src/org/eclipse/linuxtools/internal/valgrind/memcheck/MemcheckLaunchConstants.java: Changed alignment option.
+ * src/org/eclipse/linuxtools/internal/valgrind/memcheck/MemcheckLaunchDelegate.java (getCommandArray): Likewise.
+ * src/org/eclipse/linuxtools/internal/valgrind/memcheck/MemcheckToolPage.java: Likewise.
+
+2009-08-11 Elliott Baron <ebaron@redhat.com>
+
+ * src/org/eclipse/linuxtools/valgrind: Removed.
+ * META-INF/MANIFEST.MF: Bump version to 0.3.0.
+
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ Bug #285861
+
+ * plugin.properties: Change Provider to Eclipse.
+
+2009-07-30 Elliott Baron <ebaron@redhat.com>
+
+ * src/org/eclipse/linuxtools/valgrind/memcheck: Removed.
+ * src/org/eclipse/linuxtools/internal/valgrind/memcheck: New package.
+ * .project: Added API analysis.
+ * META-INF/MANIFEST.MF: Export internal package.
+ * plugin.xml: Updated class references.
+
+2009-07-09 Elliott Baron <ebaron@redhat.com>
+
+ * MemcheckToolPage.java: Display version exceptions only in tab's errorMessage.
+
+2009-07-07 Elliott Baron <ebaron@redhat.com>
+
+ * MemcheckLaunchConstants.java: Added option for turning off leak check.
+ * MemcheckLaunchDelegate.java (getCommandArray): Likewise.
+ * MemcheckToolPage.java: Likewise.
+ * messages.properties: Likewise.
+
+2009-06-23 Elliott Baron <ebaron@redhat.com>
+
+ * MemcheckToolPage.java (getGccWorkaroundButton): Added getter.
+ (getShowReachableButton): Likewise.
+ (getLeakResCombo): Likewise.
+ (getUndefValueButton): Likewise.
+ (getAlignmentSpinner): Likewise.
+ (getTrackOriginsButton): Likewise.
+ (getFreelistSpinner): Likewise.
+ (getPartialLoadsButton): Likewise.
+
+2009-05-27 Elliott Baron <ebaron@redhat.com>
+
+ * MemcheckLaunchDelegate.java: Changed for restructuring of findValgrindLocation.
+ * MemcheckToolPage.java: Likewise.
+
+2009-05-26 Elliott Baron <ebaron@redhat.com>
+
+ * MemcheckCommandConstants.java (OPT_TRACKORIGINS): Support for --track-origins.
+ * MemcheckLaunchConstants.java: Likewise.
+ * MemcheckLaunchDelegate.java (getCommandArray): Likewise.
+ * MemcheckToolPage.java: Likewise.
+ * messages.properties: New key.
+
+2009-04-30 Elliott Baron <ebaron@redhat.com>
+
+ * model/AuxErrorTreeElement.java: Removed.
+ * model/ErrorTreeElement.java: Removed.
+ * model/Messages.java: Removed.
+ * model/messages.properties: Removed.
+ * model/RootTreeElement.java: Removed.
+ * model/StackFrameTreeElement.java: Removed.
+ * model/TextTreeElement.java: Removed.
+ * model/ValgrindTreeElement.java: Removed.
+ * ValgrindError.java: Removed.
+ * ValgrindStackFrame.java: Removed.
+ * ValgrindXMLParser.java: Removed.
+ * META-INF/MANIFEST.MF: Removed model package.
+ * plugin.properties: Removed marker name.
+ * plugin.xml: Moved marker extension to launch plugin.
+ * MemcheckLaunchDelegate.java (handleLaunch): Do nothing.
+ (getCommandArray): Remove --xml=yes.
+ * MemcheckPlugin.java (plugin): Remove marker ID.
+ * MemcheckViewPart.java: Nothing required.
+
+2009-04-23 Elliott Baron <ebaron@redhat.com>
+
+ * ValgrindXMLParser.java: Removed unused method.
+
+2009-04-03 Elliott Baron <ebaron@redhat.com>
+
+ * META-INF/MANIFEST.MF: 0.2.0 version.
+
+2009-03-31 Elliott Baron <ebaron@redhat.com>
+
+ * MemcheckViewPart.java (createPartControl): Added expand/collapse to context menu.
+
+2009-03-18 Elliott Baron <ebaron@redhat.com>
+
+ * ValgrindError.java (createMarker): Use findFilesForLocation for linked resource compatibility.
+
+2009-03-12 Elliott Baron <ebaron@redhat.com>
+
+ * MemcheckPlugin.java: Use PluginConstants for referencing LaunchPlugin.
+
+2009-02-25 Elliott Baron <ebaron@redhat.com>
+
+ * MemcheckLaunchDelegate.java (handleLaunch): Renamed.
+
+2009-02-12 Elliott Baron <ebaron@redhat.com>
+
+ * MemcheckCommandConstants.java: New file.
+ * MemcheckLaunchConstants.java: New file.
+ * MemcheckLaunchDelegate.java: Improved output path handling; refactoring.
+ * MemcheckToolPage.java: Check alignment for power of 2; refactoring
+ * messages.properties: New key.
+
+2009-01-05 Elliott Baron <ebaron@redhat.com>
+
+ * META-INF/MANIFEST.MF: Changed version to 0.1.0.
+ * build.properties: Include about.html. \ No newline at end of file
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.memcheck/META-INF/MANIFEST.MF b/valgrind/org.eclipse.linuxtools.valgrind.memcheck/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..88b3900564
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.memcheck/META-INF/MANIFEST.MF
@@ -0,0 +1,29 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.eclipse.linuxtools.valgrind.memcheck;singleton:=true
+Bundle-Version: 0.4.0.qualifier
+Bundle-Activator: org.eclipse.linuxtools.internal.valgrind.memcheck.MemcheckPlugin
+Bundle-Vendor: %Bundle-Vendor.0
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Import-Package: org.eclipse.cdt.debug.core,
+ org.eclipse.cdt.launch,
+ org.eclipse.core.filesystem,
+ org.eclipse.core.resources,
+ org.eclipse.debug.core,
+ org.eclipse.debug.core.model,
+ org.eclipse.debug.ui,
+ org.eclipse.debug.ui.sourcelookup,
+ org.eclipse.jface.text,
+ org.eclipse.linuxtools.internal.valgrind.core,
+ org.eclipse.linuxtools.internal.valgrind.launch,
+ org.eclipse.linuxtools.profiling.ui,
+ org.eclipse.linuxtools.valgrind.launch,
+ org.eclipse.linuxtools.valgrind.ui,
+ org.eclipse.ui.ide,
+ org.eclipse.ui.texteditor
+Bundle-Localization: plugin
+Export-Package: org.eclipse.linuxtools.internal.valgrind.memcheck
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.memcheck/about.html b/valgrind/org.eclipse.linuxtools.valgrind.memcheck/about.html
new file mode 100644
index 0000000000..c258ef55d8
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.memcheck/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2006</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.memcheck/plugin.properties b/valgrind/org.eclipse.linuxtools.valgrind.memcheck/plugin.properties
new file mode 100644
index 0000000000..8b909359d0
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.memcheck/plugin.properties
@@ -0,0 +1,3 @@
+#Properties file for org.eclipse.linuxtools.valgrind.memcheck
+Bundle-Vendor.0 = Eclipse Linux Tools
+Bundle-Name.0 = Memcheck Plug-in (Incubation) \ No newline at end of file
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.memcheck/src/org/eclipse/linuxtools/internal/valgrind/memcheck/MemcheckLaunchConstants.java b/valgrind/org.eclipse.linuxtools.valgrind.memcheck/src/org/eclipse/linuxtools/internal/valgrind/memcheck/MemcheckLaunchConstants.java
new file mode 100644
index 0000000000..b15a29216f
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.memcheck/src/org/eclipse/linuxtools/internal/valgrind/memcheck/MemcheckLaunchConstants.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * 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:
+ * Elliott Baron <ebaron@redhat.com> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.valgrind.memcheck;
+
+public final class MemcheckLaunchConstants {
+ // LaunchConfiguration attributes
+ public static final String ATTR_MEMCHECK_LEAKCHECK = MemcheckPlugin.PLUGIN_ID + ".MEMCHECK_LEAKCHECK"; //$NON-NLS-1$
+ public static final String ATTR_MEMCHECK_LEAKRES = MemcheckPlugin.PLUGIN_ID + ".MEMCHECK_LEAKRES"; //$NON-NLS-1$
+ public static final String ATTR_MEMCHECK_SHOWREACH = MemcheckPlugin.PLUGIN_ID + ".MEMCHECK_SHOWREACH"; //$NON-NLS-1$
+ public static final String ATTR_MEMCHECK_PARTIAL = MemcheckPlugin.PLUGIN_ID + ".MEMCHECK_PARTIAL"; //$NON-NLS-1$
+ public static final String ATTR_MEMCHECK_UNDEF = MemcheckPlugin.PLUGIN_ID + ".MEMCHECK_UNDEF"; //$NON-NLS-1$
+ public static final String ATTR_MEMCHECK_FREELIST = MemcheckPlugin.PLUGIN_ID + ".MEMCHECK_FREELIST"; //$NON-NLS-1$
+ public static final String ATTR_MEMCHECK_GCCWORK = MemcheckPlugin.PLUGIN_ID + ".MEMCHECK_GCCWORK"; //$NON-NLS-1$
+ public static final String ATTR_MEMCHECK_ALIGNMENT_BOOL = MemcheckPlugin.PLUGIN_ID + ".MEMCHECK_ALIGNMENT_BOOL"; //$NON-NLS-1$
+ public static final String ATTR_MEMCHECK_ALIGNMENT_VAL = MemcheckPlugin.PLUGIN_ID + ".MEMCHECK_ALIGNMENT_VAL"; //$NON-NLS-1$
+
+ // VG >= 3.4.0
+ public static final String ATTR_MEMCHECK_TRACKORIGINS = MemcheckPlugin.PLUGIN_ID + ".MEMCHECK_TRACKORIGINS"; //$NON-NLS-1$
+
+ public static final String LEAK_RES_LOW = "low"; //$NON-NLS-1$
+ public static final String LEAK_RES_MED = "med"; //$NON-NLS-1$
+ public static final String LEAK_RES_HIGH = "high"; //$NON-NLS-1$
+
+ public static final boolean DEFAULT_MEMCHECK_LEAKCHECK = true;
+ public static final String DEFAULT_MEMCHECK_LEAKRES = LEAK_RES_LOW;
+ public static final boolean DEFAULT_MEMCHECK_SHOWREACH = false;
+ public static final boolean DEFAULT_MEMCHECK_PARTIAL = false;
+ public static final boolean DEFAULT_MEMCHECK_UNDEF = true;
+ public static final int DEFAULT_MEMCHECK_FREELIST = 10000000;
+ public static final boolean DEFAULT_MEMCHECK_GCCWORK = false;
+ public static final boolean DEFAULT_MEMCHECK_ALIGNMENT_BOOL = false;
+ public static final int DEFAULT_MEMCHECK_ALIGNMENT_VAL = 0;
+
+ // VG >= 3.4.0
+ public static final boolean DEFAULT_MEMCHECK_TRACKORIGINS = false;
+}
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.memcheck/src/org/eclipse/linuxtools/internal/valgrind/memcheck/MemcheckLaunchDelegate.java b/valgrind/org.eclipse.linuxtools.valgrind.memcheck/src/org/eclipse/linuxtools/internal/valgrind/memcheck/MemcheckLaunchDelegate.java
new file mode 100644
index 0000000000..57881e2f89
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.memcheck/src/org/eclipse/linuxtools/internal/valgrind/memcheck/MemcheckLaunchDelegate.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * 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:
+ * Elliott Baron <ebaron@redhat.com> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.valgrind.memcheck;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.linuxtools.internal.valgrind.launch.ValgrindLaunchConfigurationDelegate;
+import org.eclipse.linuxtools.internal.valgrind.launch.ValgrindLaunchPlugin;
+import org.eclipse.linuxtools.valgrind.launch.IValgrindLaunchDelegate;
+import org.osgi.framework.Version;
+
+public class MemcheckLaunchDelegate extends ValgrindLaunchConfigurationDelegate implements IValgrindLaunchDelegate {
+
+ public void handleLaunch(ILaunchConfiguration config, ILaunch launch, IProgressMonitor monitor) throws CoreException {
+ }
+
+ public String[] getCommandArray(ILaunchConfiguration config) throws CoreException {
+ ArrayList<String> opts = new ArrayList<String>();
+
+ opts.add(MemcheckCommandConstants.OPT_LEAKCHECK + EQUALS + (config.getAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_LEAKCHECK, MemcheckLaunchConstants.DEFAULT_MEMCHECK_LEAKCHECK) ? YES : NO));
+ opts.add(MemcheckCommandConstants.OPT_SHOWREACH + EQUALS + (config.getAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_SHOWREACH, MemcheckLaunchConstants.DEFAULT_MEMCHECK_SHOWREACH) ? YES : NO));
+ opts.add(MemcheckCommandConstants.OPT_LEAKRES + EQUALS + config.getAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_LEAKRES, MemcheckLaunchConstants.DEFAULT_MEMCHECK_LEAKRES));
+ opts.add(MemcheckCommandConstants.OPT_FREELIST + EQUALS + config.getAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_FREELIST, MemcheckLaunchConstants.DEFAULT_MEMCHECK_FREELIST));
+ opts.add(MemcheckCommandConstants.OPT_GCCWORK + EQUALS + (config.getAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_GCCWORK, MemcheckLaunchConstants.DEFAULT_MEMCHECK_GCCWORK) ? YES : NO));
+ opts.add(MemcheckCommandConstants.OPT_PARTIAL + EQUALS + (config.getAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_PARTIAL, MemcheckLaunchConstants.DEFAULT_MEMCHECK_PARTIAL) ? YES : NO));
+ opts.add(MemcheckCommandConstants.OPT_UNDEF + EQUALS + (config.getAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_UNDEF, MemcheckLaunchConstants.DEFAULT_MEMCHECK_UNDEF) ? YES : NO));
+ if (config.getAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_ALIGNMENT_BOOL, MemcheckLaunchConstants.DEFAULT_MEMCHECK_ALIGNMENT_BOOL)) {
+ opts.add(MemcheckCommandConstants.OPT_ALIGNMENT + EQUALS + config.getAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_ALIGNMENT_VAL, MemcheckLaunchConstants.DEFAULT_MEMCHECK_ALIGNMENT_VAL));
+ }
+
+ // 3.4.0 specific
+ try {
+ Version ver = ValgrindLaunchPlugin.getDefault().getValgrindVersion();
+ if (ver.compareTo(ValgrindLaunchPlugin.VER_3_4_0) >= 0) {
+ opts.add(MemcheckCommandConstants.OPT_TRACKORIGINS + EQUALS + (config.getAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_TRACKORIGINS, MemcheckLaunchConstants.DEFAULT_MEMCHECK_TRACKORIGINS) ? YES : NO));
+ }
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+
+ return opts.toArray(new String[opts.size()]);
+ }
+}
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.memcheck/src/org/eclipse/linuxtools/internal/valgrind/memcheck/MemcheckToolPage.java b/valgrind/org.eclipse.linuxtools.valgrind.memcheck/src/org/eclipse/linuxtools/internal/valgrind/memcheck/MemcheckToolPage.java
new file mode 100644
index 0000000000..0d76a367b7
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.memcheck/src/org/eclipse/linuxtools/internal/valgrind/memcheck/MemcheckToolPage.java
@@ -0,0 +1,332 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * 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:
+ * Elliott Baron <ebaron@redhat.com> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.valgrind.memcheck;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
+import org.eclipse.linuxtools.internal.valgrind.launch.ValgrindLaunchPlugin;
+import org.eclipse.linuxtools.valgrind.launch.IValgrindToolPage;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Spinner;
+import org.osgi.framework.Version;
+
+public class MemcheckToolPage extends AbstractLaunchConfigurationTab implements IValgrindToolPage {
+ public static final String MEMCHECK = "memcheck"; //$NON-NLS-1$
+ public static final String PLUGIN_ID = MemcheckPlugin.PLUGIN_ID;
+
+ // MEMCHECK controls
+ protected Button leakCheckButton;
+ protected Combo leakResCombo;
+ protected Button showReachableButton;
+ protected Spinner freelistSpinner;
+ protected Button partialLoadsButton;
+ protected Button undefValueButton;
+ protected Button gccWorkaroundButton;
+ protected Button alignmentButton;
+ protected Spinner alignmentSpinner;
+
+ // VG >= 3.4.0
+ protected Button trackOriginsButton;
+
+ protected boolean isInitializing = false;
+ protected CoreException ex = null;
+
+ protected SelectionListener selectListener = new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ updateLaunchConfigurationDialog();
+ }
+ };
+ protected ModifyListener modifyListener = new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ updateLaunchConfigurationDialog();
+ }
+ };
+
+ public void createControl(Composite parent) {
+ Composite top = new Composite(parent, SWT.NONE);
+ GridLayout memcheckLayout = new GridLayout(2, true);
+ top.setLayout(memcheckLayout);
+ top.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ leakCheckButton = new Button(top, SWT.CHECK);
+ leakCheckButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ leakCheckButton.setText(Messages.getString("MemcheckToolPage.leak_check")); //$NON-NLS-1$
+ leakCheckButton.addSelectionListener(selectListener);
+
+ Composite leakResTop = new Composite(top, SWT.NONE);
+ leakResTop.setLayout(new GridLayout(2, false));
+ leakResTop.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ Label leakResLabel = new Label(leakResTop, SWT.NONE);
+ leakResLabel.setText(Messages.getString("MemcheckToolPage.leak_resolution")); //$NON-NLS-1$
+ leakResCombo = new Combo(leakResTop, SWT.READ_ONLY);
+ String[] leakResOpts = { MemcheckLaunchConstants.LEAK_RES_LOW, MemcheckLaunchConstants.LEAK_RES_MED, MemcheckLaunchConstants.LEAK_RES_HIGH };
+ leakResCombo.setItems(leakResOpts);
+ leakResCombo.addSelectionListener(selectListener);
+
+ Composite freelistTop = new Composite(top, SWT.NONE);
+ freelistTop.setLayout(new GridLayout(2, false));
+ freelistTop.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ Label freelistLabel = new Label(freelistTop, SWT.NONE);
+ freelistLabel.setText(Messages.getString("MemcheckToolPage.freelist_size")); //$NON-NLS-1$
+ freelistSpinner = new Spinner(freelistTop, SWT.BORDER);
+ freelistSpinner.setMaximum(Integer.MAX_VALUE);
+ freelistSpinner.addModifyListener(modifyListener);
+
+ showReachableButton = new Button(top, SWT.CHECK);
+ showReachableButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ showReachableButton.setText(Messages.getString("MemcheckToolPage.show_reachable")); //$NON-NLS-1$
+ showReachableButton.addSelectionListener(selectListener);
+
+ partialLoadsButton = new Button(top, SWT.CHECK);
+ partialLoadsButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ partialLoadsButton.setText(Messages.getString("MemcheckToolPage.allow_partial")); //$NON-NLS-1$
+ partialLoadsButton.addSelectionListener(selectListener);
+
+ undefValueButton = new Button(top, SWT.CHECK);
+ undefValueButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ undefValueButton.setText(Messages.getString("MemcheckToolPage.undef_value_errors")); //$NON-NLS-1$
+ undefValueButton.addSelectionListener(selectListener);
+
+ // 3.4.0 specific
+ try {
+ Version ver = ValgrindLaunchPlugin.getDefault().getValgrindVersion();
+ if (ver.compareTo(ValgrindLaunchPlugin.VER_3_4_0) >= 0) {
+ trackOriginsButton = new Button(top, SWT.CHECK);
+ trackOriginsButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ trackOriginsButton.setText(Messages.getString("MemcheckToolPage.Track_origins")); //$NON-NLS-1$
+ trackOriginsButton.addSelectionListener(selectListener);
+ }
+ } catch (CoreException e) {
+ ex = e;
+ }
+
+ gccWorkaroundButton = new Button(top, SWT.CHECK);
+ gccWorkaroundButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ gccWorkaroundButton.setText(Messages.getString("MemcheckToolPage.gcc_296_workarounds")); //$NON-NLS-1$
+ gccWorkaroundButton.addSelectionListener(selectListener);
+
+ Composite alignmentTop = new Composite(top, SWT.NONE);
+ GridLayout alignmentLayout = new GridLayout(2, false);
+ alignmentLayout.marginWidth = alignmentLayout.marginHeight = 0;
+ alignmentTop.setLayout(alignmentLayout);
+ alignmentTop.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ alignmentButton = new Button(alignmentTop, SWT.CHECK);
+ alignmentButton.setText(Messages.getString("MemcheckToolPage.minimum_heap_block")); //$NON-NLS-1$
+ alignmentButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ checkAlignmentEnablement();
+ updateLaunchConfigurationDialog();
+ }
+ });
+ alignmentSpinner = new Spinner(alignmentTop, SWT.BORDER);
+ alignmentSpinner.setMinimum(0);
+ alignmentSpinner.setMaximum(4096);
+ alignmentSpinner.addModifyListener(modifyListener);
+ }
+
+ private void checkAlignmentEnablement() {
+ alignmentSpinner.setEnabled(alignmentButton.getSelection());
+ }
+
+ public String getName() {
+ return Messages.getString("MemcheckToolPage.Memcheck_Options"); //$NON-NLS-1$
+ }
+
+ public void initializeFrom(ILaunchConfiguration configuration) {
+ isInitializing = true;
+ try {
+ leakCheckButton.setSelection(configuration.getAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_LEAKCHECK, MemcheckLaunchConstants.DEFAULT_MEMCHECK_LEAKCHECK));
+ leakResCombo.setText(configuration.getAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_LEAKRES, MemcheckLaunchConstants.DEFAULT_MEMCHECK_LEAKRES));
+ showReachableButton.setSelection(configuration.getAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_SHOWREACH, MemcheckLaunchConstants.DEFAULT_MEMCHECK_SHOWREACH));
+ freelistSpinner.setSelection(configuration.getAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_FREELIST, MemcheckLaunchConstants.DEFAULT_MEMCHECK_FREELIST));
+ partialLoadsButton.setSelection(configuration.getAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_PARTIAL, MemcheckLaunchConstants.DEFAULT_MEMCHECK_PARTIAL));
+ undefValueButton.setSelection(configuration.getAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_UNDEF, MemcheckLaunchConstants.DEFAULT_MEMCHECK_UNDEF));
+ gccWorkaroundButton.setSelection(configuration.getAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_GCCWORK, MemcheckLaunchConstants.DEFAULT_MEMCHECK_GCCWORK));
+ alignmentButton.setSelection(configuration.getAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_ALIGNMENT_BOOL, MemcheckLaunchConstants.DEFAULT_MEMCHECK_ALIGNMENT_BOOL));
+ checkAlignmentEnablement();
+ alignmentSpinner.setSelection(configuration.getAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_ALIGNMENT_VAL, MemcheckLaunchConstants.DEFAULT_MEMCHECK_ALIGNMENT_VAL));
+
+ // 3.4.0 specific
+ Version ver = ValgrindLaunchPlugin.getDefault().getValgrindVersion();
+ if (ver.compareTo(ValgrindLaunchPlugin.VER_3_4_0) >= 0) {
+ trackOriginsButton.setSelection(configuration.getAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_TRACKORIGINS, MemcheckLaunchConstants.DEFAULT_MEMCHECK_TRACKORIGINS));
+ }
+ } catch (CoreException e) {
+ ex = e;
+ }
+ isInitializing = false;
+ }
+
+ public void performApply(ILaunchConfigurationWorkingCopy configuration) {
+ configuration.setAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_LEAKCHECK, leakCheckButton.getSelection());
+ configuration.setAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_LEAKRES, leakResCombo.getText());
+ configuration.setAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_SHOWREACH, showReachableButton.getSelection());
+ configuration.setAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_FREELIST, freelistSpinner.getSelection());
+ configuration.setAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_PARTIAL, partialLoadsButton.getSelection());
+ configuration.setAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_UNDEF, undefValueButton.getSelection());
+ configuration.setAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_GCCWORK, gccWorkaroundButton.getSelection());
+ configuration.setAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_ALIGNMENT_BOOL, alignmentButton.getSelection());
+ configuration.setAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_ALIGNMENT_VAL, alignmentSpinner.getSelection());
+
+ // 3.4.0 specific
+ try {
+ Version ver = ValgrindLaunchPlugin.getDefault().getValgrindVersion();
+ if (ver.compareTo(ValgrindLaunchPlugin.VER_3_4_0) >= 0) {
+ configuration.setAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_TRACKORIGINS, trackOriginsButton.getSelection());
+ }
+ } catch (CoreException e) {
+ ex = e;
+ }
+ }
+
+ @Override
+ public boolean isValid(ILaunchConfiguration launchConfig) {
+ setErrorMessage(null);
+
+ boolean result = false;
+ try {
+ // check alignment
+ int alignment = launchConfig.getAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_ALIGNMENT_VAL, MemcheckLaunchConstants.DEFAULT_MEMCHECK_ALIGNMENT_VAL);
+ result = (alignment & (alignment - 1)) == 0; // is power of two?
+ if (!result) {
+ setErrorMessage(Messages.getString("MemcheckToolPage.Alignment_must_be_power_2")); //$NON-NLS-1$
+ }
+ else {
+ // 3.4.0 specific
+ Version ver = ValgrindLaunchPlugin.getDefault().getValgrindVersion();
+ if (ver.compareTo(ValgrindLaunchPlugin.VER_3_4_0) >= 0) {
+ // check track-origins
+ boolean trackOrigins = launchConfig.getAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_TRACKORIGINS, MemcheckLaunchConstants.DEFAULT_MEMCHECK_TRACKORIGINS);
+ if (trackOrigins) {
+ // undef-value-errors must be selected
+ result = launchConfig.getAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_UNDEF, MemcheckLaunchConstants.DEFAULT_MEMCHECK_UNDEF);
+ if (!result) {
+ setErrorMessage(NLS.bind(Messages.getString("MemcheckToolPage.Track_origins_needs_undef"), Messages.getString("MemcheckToolPage.Track_origins"), Messages.getString("MemcheckToolPage.undef_value_errors"))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+ }
+ }
+ }
+ } catch (CoreException e) {
+ ex = e;
+ }
+
+ if (ex != null) {
+ setErrorMessage(ex.getLocalizedMessage());
+ }
+ return result;
+ }
+
+ public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
+ configuration.setAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_LEAKCHECK, MemcheckLaunchConstants.DEFAULT_MEMCHECK_LEAKCHECK);
+ configuration.setAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_LEAKRES, MemcheckLaunchConstants.DEFAULT_MEMCHECK_LEAKRES);
+ configuration.setAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_SHOWREACH, MemcheckLaunchConstants.DEFAULT_MEMCHECK_SHOWREACH);
+ configuration.setAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_FREELIST, MemcheckLaunchConstants.DEFAULT_MEMCHECK_FREELIST);
+ configuration.setAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_PARTIAL, MemcheckLaunchConstants.DEFAULT_MEMCHECK_PARTIAL);
+ configuration.setAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_UNDEF, MemcheckLaunchConstants.DEFAULT_MEMCHECK_UNDEF);
+ configuration.setAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_GCCWORK, MemcheckLaunchConstants.DEFAULT_MEMCHECK_GCCWORK);
+ configuration.setAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_ALIGNMENT_BOOL, MemcheckLaunchConstants.DEFAULT_MEMCHECK_ALIGNMENT_BOOL);
+ configuration.setAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_ALIGNMENT_VAL, MemcheckLaunchConstants.DEFAULT_MEMCHECK_ALIGNMENT_VAL);
+
+ // 3.4.0 specific
+ try {
+ Version ver = ValgrindLaunchPlugin.getDefault().getValgrindVersion();
+ if (ver.compareTo(ValgrindLaunchPlugin.VER_3_4_0) >= 0) {
+ configuration.setAttribute(MemcheckLaunchConstants.ATTR_MEMCHECK_TRACKORIGINS, MemcheckLaunchConstants.DEFAULT_MEMCHECK_TRACKORIGINS);
+ }
+ } catch (CoreException e) {
+ ex = e;
+ }
+ }
+
+ protected void createHorizontalSpacer(Composite comp, int numlines) {
+ Label lbl = new Label(comp, SWT.NONE);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = numlines;
+ lbl.setLayoutData(gd);
+ }
+
+ @Override
+ protected void updateLaunchConfigurationDialog() {
+ if (!isInitializing) {
+ super.updateLaunchConfigurationDialog();
+ }
+ }
+
+
+ public Button getLeakCheckButton() {
+ return leakCheckButton;
+ }
+
+
+ public Combo getLeakResCombo() {
+ return leakResCombo;
+ }
+
+
+ public Button getShowReachableButton() {
+ return showReachableButton;
+ }
+
+
+ public Spinner getFreelistSpinner() {
+ return freelistSpinner;
+ }
+
+
+ public Button getPartialLoadsButton() {
+ return partialLoadsButton;
+ }
+
+
+ public Button getUndefValueButton() {
+ return undefValueButton;
+ }
+
+
+ public Button getGccWorkaroundButton() {
+ return gccWorkaroundButton;
+ }
+
+
+ public Button getAlignmentButton() {
+ return alignmentButton;
+ }
+
+
+ public Spinner getAlignmentSpinner() {
+ return alignmentSpinner;
+ }
+
+
+ public Button getTrackOriginsButton() {
+ return trackOriginsButton;
+ }
+
+}
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.test-feature/ChangeLog b/valgrind/org.eclipse.linuxtools.valgrind.test-feature/ChangeLog
new file mode 100644
index 0000000000..15be41c941
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.test-feature/ChangeLog
@@ -0,0 +1,70 @@
+2010-05-18 Andrew Overholt <overholt@redhat.com>
+
+ * feature.properties: Fix provider name.
+
+2010-04-26 Andrew Overholt <overholt@redhat.com>
+
+ * feature.properties: Match consistent license text (bug #306627). Update
+ copyright year.
+ * license.html: New file. HTML version of SUA (bug #306627).
+ * build.properties: Include license.html.
+ * feature.xml: Use licenseURL property.
+
+2010-04-12 Andrew Overholt <overholt@redhat.com>
+
+ * feature.properties: Match consistent license text (bug #306627).
+
+2009-08-11 Elliott Baron <ebaron@redhat.com>
+
+ * feature.xml: Bump version to 0.3.0.
+
+2009-07-30 Elliott Baron <ebaron@redhat.com>
+
+ * feature.xml: Recomputed dependencies.
+
+2009-05-28 Elliott Baron <ebaron@redhat.com>
+
+ * feature.properties: Fix featureProvider key.
+
+2009-05-20 Elliott Baron <ebaron@redhat.com>
+
+ * feature.xml: Remove '.feature' from feature ID.
+
+2009-05-19 Andrew Overholt <overholt@redhat.com>
+
+ * feature.properties: Change provider from Eclipse.org to Eclipse.
+
+2009-04-03 Elliott Baron <ebaron@redhat.com>
+
+ * feature.xml: 0.2.0 version.
+
+2009-03-13 Andrew Overholt <overholt@redhat.com>
+
+ * feature.xml: Unpack cachegrind tests plugin so test.xml is present.
+
+2009-03-13 Andrew Overholt <overholt@redhat.com>
+
+ * feature.xml: Add cachegrind tests plugin.
+
+2009-02-12 Elliott Baron <ebaron@redhat.com>
+
+ * feature.xml: Update dependencies, org.junit.
+
+2008-12-17 Andrew Overholt <overholt@redhat.com>
+
+ * feature.xml: Add tests plugin.
+
+2008-12-16 Elliott Baron <ebaron@redhat.com>
+
+ * feature.xml: Added dependencies and Linux requirement. Added massif tests.
+
+2008-12-11 Andrew Overholt <overholt@redhat.com>
+
+ * feature.xml: Unpack memcheck.tests plugin after installation.
+
+2008-12-10 Andrew Overholt <overholt@redhat.com>
+
+ * build.properties: Inital checkin.
+ * feature.xml: Likewise.
+ * feature.properties: Likewise.
+ * epl-v10.html: Likewise. \ No newline at end of file
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.test-feature/build.properties b/valgrind/org.eclipse.linuxtools.valgrind.test-feature/build.properties
new file mode 100644
index 0000000000..765d7ecdb3
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.test-feature/build.properties
@@ -0,0 +1,5 @@
+bin.includes = feature.xml,\
+ feature.properties,\
+ epl-v10.html,\
+ test.xml,\
+ license.html
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.test-feature/feature.properties b/valgrind/org.eclipse.linuxtools.valgrind.test-feature/feature.properties
new file mode 100644
index 0000000000..9a6efd4bce
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.test-feature/feature.properties
@@ -0,0 +1,138 @@
+#*******************************************************************************
+# Copyright (c) 2008 Red Hat, Inc.
+# 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:
+# Red Hat, Inc. - initial API and implementation
+#********************************************************************************
+featureName=Valgrind Tools Integration Automated Tests (Incubation)
+description=Tests for plugins that integrate Valgrind tools with the workbench.
+featureProvider=Eclipse Linux Tools
+copyright=Copyright 2008, 2010 Red Hat, Inc.
+licenseURL=license.html
+license=\
+Eclipse Foundation Software User Agreement\n\
+April 14, 2010\n\
+\n\
+Usage Of Content\n\
+\n\
+THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\
+OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\
+USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\
+AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\
+NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\
+AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\
+AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\
+OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\
+TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\
+OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\
+BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\
+\n\
+Applicable Licenses\n\
+\n\
+Unless otherwise indicated, all Content made available by the\n\
+Eclipse Foundation is provided to you under the terms and conditions of\n\
+the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\
+provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\
+For purposes of the EPL, "Program" will mean the Content.\n\
+\n\
+Content includes, but is not limited to, source code, object code,\n\
+documentation and other files maintained in the Eclipse Foundation source code\n\
+repository ("Repository") in software modules ("Modules") and made available\n\
+as downloadable archives ("Downloads").\n\
+\n\
+ - Content may be structured and packaged into modules to facilitate delivering,\n\
+ extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\
+ plug-in fragments ("Fragments"), and features ("Features").\n\
+ - Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\
+ in a directory named "plugins".\n\
+ - A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\
+ Each Feature may be packaged as a sub-directory in a directory named "features".\n\
+ Within a Feature, files named "feature.xml" may contain a list of the names and version\n\
+ numbers of the Plug-ins and/or Fragments associated with that Feature.\n\
+ - Features may also include other Features ("Included Features"). Within a Feature, files\n\
+ named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\
+\n\
+The terms and conditions governing Plug-ins and Fragments should be\n\
+contained in files named "about.html" ("Abouts"). The terms and\n\
+conditions governing Features and Included Features should be contained\n\
+in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\
+Licenses may be located in any directory of a Download or Module\n\
+including, but not limited to the following locations:\n\
+\n\
+ - The top-level (root) directory\n\
+ - Plug-in and Fragment directories\n\
+ - Inside Plug-ins and Fragments packaged as JARs\n\
+ - Sub-directories of the directory named "src" of certain Plug-ins\n\
+ - Feature directories\n\
+\n\
+Note: if a Feature made available by the Eclipse Foundation is installed using the\n\
+Provisioning Technology (as defined below), you must agree to a license ("Feature \n\
+Update License") during the installation process. If the Feature contains\n\
+Included Features, the Feature Update License should either provide you\n\
+with the terms and conditions governing the Included Features or inform\n\
+you where you can locate them. Feature Update Licenses may be found in\n\
+the "license" property of files named "feature.properties" found within a Feature.\n\
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\
+terms and conditions (or references to such terms and conditions) that\n\
+govern your use of the associated Content in that directory.\n\
+\n\
+THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\
+TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\
+SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\
+\n\
+ - Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\
+ - Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\
+ - Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\
+ - Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)\n\
+ - Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\
+\n\
+IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\
+TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\
+is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\
+govern that particular Content.\n\
+\n\
+\n\Use of Provisioning Technology\n\
+\n\
+The Eclipse Foundation makes available provisioning software, examples of which include,\n\
+but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\
+the purpose of allowing users to install software, documentation, information and/or\n\
+other materials (collectively "Installable Software"). This capability is provided with\n\
+the intent of allowing such users to install, extend and update Eclipse-based products.\n\
+Information about packaging Installable Software is available at\n\
+http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\
+\n\
+You may use Provisioning Technology to allow other parties to install Installable Software.\n\
+You shall be responsible for enabling the applicable license agreements relating to the\n\
+Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\
+in accordance with the Specification. By using Provisioning Technology in such a manner and\n\
+making it available in accordance with the Specification, you further acknowledge your\n\
+agreement to, and the acquisition of all necessary rights to permit the following:\n\
+\n\
+ 1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\
+ the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\
+ extending or updating the functionality of an Eclipse-based product.\n\
+ 2. During the Provisioning Process, the Provisioning Technology may cause third party\n\
+ Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\
+ 3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\
+ govern the use of the Installable Software ("Installable Software Agreement") and such\n\
+ Installable Software Agreement shall be accessed from the Target Machine in accordance\n\
+ with the Specification. Such Installable Software Agreement must inform the user of the\n\
+ terms and conditions that govern the Installable Software and must solicit acceptance by\n\
+ the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\
+ indication of agreement by the user, the provisioning Technology will complete installation\n\
+ of the Installable Software.\n\
+\n\
+Cryptography\n\
+\n\
+Content may contain encryption software. The country in which you are\n\
+currently may have restrictions on the import, possession, and use,\n\
+and/or re-export to another country, of encryption software. BEFORE\n\
+using any encryption software, please check the country's laws,\n\
+regulations and policies concerning the import, possession, or use, and\n\
+re-export of encryption software, to see if this is permitted.\n\
+\n\
+Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.test-feature/feature.xml b/valgrind/org.eclipse.linuxtools.valgrind.test-feature/feature.xml
new file mode 100644
index 0000000000..472e9f6d3a
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.test-feature/feature.xml
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.eclipse.linuxtools.valgrind.test"
+ label="%featureName"
+ version="0.4.0.qualifier"
+ provider-name="%featureProvider">
+
+ <description>
+ %description
+ </description>
+
+ <copyright>
+ %copyright
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <requires>
+ <import plugin="org.eclipse.ui"/>
+ <import plugin="org.eclipse.core.runtime"/>
+ <import plugin="org.junit" version="0.0.0"/>
+ <import plugin="org.eclipse.cdt.core"/>
+ <import plugin="org.eclipse.cdt.core.tests"/>
+ <import plugin="org.eclipse.cdt.debug.core"/>
+ <import plugin="org.eclipse.cdt.debug.ui"/>
+ <import plugin="org.eclipse.cdt.launch"/>
+ <import plugin="org.eclipse.core.resources"/>
+ <import plugin="org.eclipse.debug.core"/>
+ <import plugin="org.eclipse.debug.ui"/>
+ <import plugin="org.eclipse.jface.text"/>
+ <import plugin="org.eclipse.linuxtools.valgrind.core"/>
+ <import plugin="org.eclipse.linuxtools.valgrind.launch"/>
+ <import plugin="org.eclipse.linuxtools.valgrind.memcheck"/>
+ <import plugin="org.eclipse.linuxtools.valgrind.ui"/>
+ <import plugin="org.eclipse.linuxtools.profiling.launch"/>
+ <import plugin="org.eclipse.linuxtools.profiling.tests"/>
+ <import plugin="org.eclipse.ui.ide"/>
+ <import plugin="org.eclipse.ui.console"/>
+ <import plugin="org.eclipse.ui.editors"/>
+ <import plugin="org.eclipse.birt.chart.engine"/>
+ <import plugin="org.eclipse.birt.core"/>
+ <import plugin="org.eclipse.emf.common"/>
+ <import plugin="org.eclipse.emf.ecore"/>
+ <import plugin="org.eclipse.linuxtools.valgrind.massif"/>
+ <import plugin="org.eclipse.cdt.ui"/>
+ <import plugin="org.eclipse.linuxtools.valgrind.cachegrind"/>
+ </requires>
+
+ <plugin
+ id="org.eclipse.linuxtools.valgrind.memcheck.tests"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.eclipse.linuxtools.valgrind.massif.tests"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.eclipse.linuxtools.valgrind.tests"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.eclipse.linuxtools.valgrind.cachegrind.tests"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+</feature>
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.test-feature/license.html b/valgrind/org.eclipse.linuxtools.valgrind.test-feature/license.html
new file mode 100644
index 0000000000..c184ca36a9
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.test-feature/license.html
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Eclipse Foundation Software User Agreement</title>
+</head>
+
+<body lang="EN-US">
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>April 14, 2010</p>
+
+<h3>Usage Of Content</h3>
+
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+ (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+ CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+ OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+ NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+ CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
+ (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+ For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
+ repository (&quot;Repository&quot;) in software modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
+
+<ul>
+ <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
+ <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
+ <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
+ and/or Fragments associated with that Feature.</li>
+ <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
+Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+ <li>The top-level (root) directory</li>
+ <li>Plug-in and Fragment directories</li>
+ <li>Inside Plug-ins and Fragments packaged as JARs</li>
+ <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
+ <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license (&quot;Feature Update License&quot;) during the
+installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
+inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+ <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+ <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+ <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+ <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
+ <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
+
+
+<h3>Use of Provisioning Technology</h3>
+
+<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
+ Update Manager (&quot;Provisioning Technology&quot;) for the purpose of allowing users to install software, documentation, information and/or
+ other materials (collectively &quot;Installable Software&quot;). This capability is provided with the intent of allowing such users to
+ install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
+ href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
+ (&quot;Specification&quot;).</p>
+
+<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
+ applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
+ in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
+ Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
+
+<ol>
+ <li>A series of actions may occur (&quot;Provisioning Process&quot;) in which a user may execute the Provisioning Technology
+ on a machine (&quot;Target Machine&quot;) with the intent of installing, extending or updating the functionality of an Eclipse-based
+ product.</li>
+ <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
+ accessed and copied to the Target Machine.</li>
+ <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
+ Software (&quot;Installable Software Agreement&quot;) and such Installable Software Agreement shall be accessed from the Target
+ Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
+ the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
+ indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
+</ol>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
+ another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
+ possession, or use, and re-export of encryption software, to see if this is permitted.</p>
+
+<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
+</body>
+</html>
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.tests/ChangeLog b/valgrind/org.eclipse.linuxtools.valgrind.tests/ChangeLog
new file mode 100644
index 0000000000..409ed3e61b
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.tests/ChangeLog
@@ -0,0 +1,173 @@
+2009-12-22 Roland Grunberg <rgrunber@redhat.com>
+
+ * META-INF/MANIFEST.MF: Make necessary changes for switch from JUnit 3 to JUnit 4.
+
+2009-08-11 Elliott Baron <ebaron@redhat.com>
+
+ * src/org/eclipse/linuxtools/valgrind: Removed.
+ * META-INF/MANIFEST.MF: Bump version to 0.3.0.
+
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ Bug #285861
+
+ * plugin.properties: Change Provider to Eclipse.
+
+2009-07-30 Elliott Baron <ebaron@redhat.com>
+
+ * src/org/eclipse/linuxtools/valgrind/tests: Removed.
+ * src/org/eclipse/linuxtools/internal/valgrind/tests: New package.
+ * META-INF/MANIFEST.MF: Export internal package.
+ * test.xml: Update class references.
+
+2009-06-25 Elliott Baron <ebaron@redhat.com>
+
+ * ValgrindStubProcess.java: Removed unused code.
+ * ValgrindTestLaunchDelegate.java: Likewise.
+
+2009-06-23 Elliott Baron <ebaron@redhat.com>
+
+ * ValgrindTestExportWizard.java: Removed.
+ * ValgrindTestExportWizardPage.java: Removed.
+ * ValgrindTestLaunchPlugin.java: Removed.
+ * ValgrindTestOptionsTab.java: Removed.
+ * AbstractValgrindTest.java: Set ValgrindStubCommand explicitly.
+ * ValgrindTestLaunchDelegate.java: Remove reference to TestLaunchPlugin.
+
+2009-06-22 Elliott Baron <ebaron@redhat.com>
+
+ * ValgrindTestLaunchPlugin.java (setValgrindLocation): Act as proxy for real plugin.
+ (getValgrindLocation): Likewise.
+ (setValgrindVersion): Likewise.
+ (getValgrindVersion): Likewise.
+
+2009-05-27 Elliott Baron <ebaron@redhat.com>
+
+ * AbstractValgrindTest.java (setUp): Retrieve stub location and version and explicitly
+ set them in real plugin.
+
+2009-05-26 Elliott Baron <ebaron@redhat.com>
+
+ * ValgrindTestOptionsTab.java: Getters for new controls.
+
+2009-04-30 Elliott Baron <ebaron@redhat.com>
+
+ * AbstractValgrindTest.java (getPlugin): New method.
+ * ValgrindStubCommand.java (whichVersion): Just return 3.4.0 version string.
+ * ValgrindTestLaunchPlugin.java (setCurrentLaunchConfiguration): Act as proxy to
+ real launch plugin's instance.
+ (getCurrentLaunchConfiguration): Likewise.
+ (getCurrentLaunch): Likewise.
+ (setCurrentLaunch): Likewise.
+
+2009-04-23 Elliott Baron <ebaron@redhat.com>
+
+ * ValgrindTestLaunchShortcut.java: Stub for testing Launch Shortcut.
+
+2009-04-21 Elliott Baron <ebaron@redhat.com>
+
+ * ResourceChangePrinter.java: New file.
+ * plugin.properties: Removed unused key.
+
+2009-04-03 Elliott Baron <ebaron@redhat.com>
+
+ * ValgrindStubStreamsProxy.java: New file.
+ * META-INF/MANIFEST.MF: 0.2.0 version.
+ * ValgrindStubCommand.java (getProcess): Return null.
+ * ValgrindStubProcess.java: Stub implementation of IProcess.
+ * ValgrindTestLaunchDelegate.java (getValgrindCommand): No longer
+ passed exit code.
+ (createNewProcess): Hook into ValgrindStubProcess.
+ * ValgrindTestLaunchPlugin.java (getValgrindCommand): No longer
+ passed exit code.
+
+2009-04-02 Elliott Baron <ebaron@redhat.com>
+
+ * ValgrindTestLaunchDelegate.java (getValgrindCommand): Reading error code
+ must succeed.
+
+2009-03-25 Elliott Baron <ebaron@redhat.com>
+
+ * ValgrindTestExportWizard.java: New file.
+ * ValgrindTestExportWizardPage.java: New file.
+ * AbstractValgrindTest.java (getPathToFiles): Extracted from doLaunch.
+
+2009-03-19 Elliott Baron <ebaron@redhat.com>
+
+ * AbstractValgrindTest.java (doLaunch): Remove code that sets preferred delegate.
+ * ValgrindTestsPlugin.java: DELEGATE_ID no longer used.
+
+2009-03-18 Elliott Baron <ebaron@redhat.com>
+
+ * AbstractValgrindTest.java (createProjectAndBuild): Refactoring from profiling.tests.
+
+2009-03-10 Elliott Baron <ebaron@redhat.com>
+
+ * plugin.xml: Removed.
+ * ValgrindLaunchMockPlugin.java: Removed.
+ * ValgrindMockCommand.java: Removed.
+ * ValgrindMockProcess.java: Removed.
+ * ValgrindStubCommand.java: Renamed from ValgrindMockCommand.
+ * ValgrindStubProcess.java: Renamed from ValgrindMockProcess.
+ * ValgrindTestLaunchPlugin.java: Renamed from ValgrindLaunchMockPlugin,
+ now singleton. Load/store version number. No longer abstract.
+ * build.properties: plugin.xml removed.
+ * META-INF/MANIFEST.MF: Extension removed. Launch delegate directly.
+ * AbstractValgrindTest.java: Initialize ValgrindTestLaunchPlugin in constructor,
+ create and launch delegate instead of using LaunchManager.
+ * ValgrindTestLaunchDelegate.java: Use singleton ValgrindTestLaunchPlugin.
+ * ValgrindTestOptionsTab.java: Likewise.
+
+2009-02-27 Elliott Baron <ebaron@redhat.com>
+
+ * AbstractValgrindTest.java: Added methods for binding and unbinding workspace
+ and bundle locations. Output generated with template_ prefix.
+ * ValgrindTestLaunchDelegate.java: Added new eclipse.valgrind.tests.generateFiles
+ system property to control the generation of template_ files.
+ * ValgrindTestsPlugin.java: Added new constants.
+
+2009-02-25 Elliott Baron <ebaron@redhat.com>
+
+ * plugin.xml: Contribute launchDelegate.
+ * AbstractValgrindTest.java: New file. Common methods.
+ * ValgrindMockCommand.java: New file. For simulating valgrind run.
+ * ValgrindMockProcess.java: New file. For simulating valgrind run.
+ * ValgrindTestLaunchDelegate.java: New file. For simulating valgrind run.
+ * build.properties: plugin.xml added.
+ * META-INF/MANIFEST.MF: New dependencies.
+ * ValgrindTestsPlugin.java: Added new constants.
+
+2009-02-12 Elliott Baron <ebaron@redhat.com>
+
+ * .classpath: New file.
+ * .settings/org.eclipse.jdt.core.prefs: New file.
+ * ValgrindLaunchMockPlugin.java: New file.
+ * ValgrindTestOptionsTab.java: New file.
+ * ValgrindTestsPlugin.java: New file.
+ * .project: Project -> Java nature.
+ * build.properties: Likewise.
+ * META-INF/MANIFEST.MF: Likewise.
+ * plugin.properties: Likewise.
+
+2009-01-05 Elliott Baron <ebaron@redhat.com>
+
+ * META-INF/MANIFEST.MF: Changed version to 0.1.0.
+
+2008-12-18 Elliott Baron <ebaron@redhat.com>
+
+ * META-INF/MANIFEST.MF: Fixed string externalization.
+ * plugin.properties: Likewise.
+ * build.properties: Likewise.
+
+2008-12-18 Andrew Overholt <overholt@redhat.com>
+
+ * test.xml: Typos.
+ * build.properties: Add test.xml.
+
+2008-12-17 Andrew Overholt <overholt@redhat.com>
+
+ * build.properties: Inital checkin.
+ * test.xml: Likewise.
+ * plugin.properties: Likewise.
+ * about.html: Likewise.
+ * META-INF/MANIFEST.MF: Likewise. \ No newline at end of file
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.tests/META-INF/MANIFEST.MF b/valgrind/org.eclipse.linuxtools.valgrind.tests/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..51b6fbf27b
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,26 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.eclipse.linuxtools.valgrind.tests;singleton:=true
+Bundle-Version: 0.4.0.qualifier
+Bundle-Vendor: %Bundle-Vendor.0
+Bundle-Localization: plugin
+Bundle-ActivationPolicy: lazy
+Bundle-Activator: org.eclipse.linuxtools.internal.valgrind.tests.ValgrindTestsPlugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.junit;bundle-version="4.7.0"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Import-Package: org.eclipse.cdt.core.model,
+ org.eclipse.cdt.debug.core,
+ org.eclipse.cdt.launch,
+ org.eclipse.core.resources,
+ org.eclipse.debug.core,
+ org.eclipse.debug.core.model,
+ org.eclipse.debug.ui,
+ org.eclipse.linuxtools.internal.valgrind.core,
+ org.eclipse.linuxtools.internal.valgrind.launch,
+ org.eclipse.linuxtools.profiling.launch,
+ org.eclipse.linuxtools.profiling.tests,
+ org.eclipse.linuxtools.valgrind.launch
+Export-Package: org.eclipse.linuxtools.internal.valgrind.tests
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.tests/plugin.properties b/valgrind/org.eclipse.linuxtools.valgrind.tests/plugin.properties
new file mode 100644
index 0000000000..ac88e79f86
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.tests/plugin.properties
@@ -0,0 +1,12 @@
+#*******************************************************************************
+# Copyright (c) 2008 Red Hat, Inc.
+# 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:
+# Red Hat, Inc. - initial API and implementation
+#********************************************************************************
+Bundle-Vendor.0 = Eclipse Linux Tools
+Bundle-Name.0 = Valgrind Test Suite (Incubation) \ No newline at end of file
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.ui.editor/META-INF/MANIFEST.MF b/valgrind/org.eclipse.linuxtools.valgrind.ui.editor/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..159b73455a
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.ui.editor/META-INF/MANIFEST.MF
@@ -0,0 +1,25 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.eclipse.linuxtools.valgrind.ui.editor;singleton:=true
+Bundle-Version: 0.4.0.qualifier
+Bundle-Activator: org.eclipse.linuxtools.internal.valgrind.ui.editor.ValgrindEditorPlugin
+Bundle-Vendor: %Bundle-Vendor.0
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.eclipse.ui.ide
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Import-Package: org.eclipse.jface.text,
+ org.eclipse.jface.text.contentassist,
+ org.eclipse.jface.text.presentation,
+ org.eclipse.jface.text.reconciler,
+ org.eclipse.jface.text.rules,
+ org.eclipse.jface.text.source,
+ org.eclipse.jface.text.source.projection,
+ org.eclipse.ui.editors.text,
+ org.eclipse.ui.texteditor,
+ org.eclipse.ui.wizards.newresource
+Export-Package: org.eclipse.linuxtools.internal.valgrind.ui.editor,
+ org.eclipse.linuxtools.internal.valgrind.ui.editor.wizards
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.ui.editor/about.html b/valgrind/org.eclipse.linuxtools.valgrind.ui.editor/about.html
new file mode 100644
index 0000000000..23506a4bae
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.ui.editor/about.html
@@ -0,0 +1,26 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+
+
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>About</title>
+</head><body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2006</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body></html> \ No newline at end of file
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.ui.editor/build.properties b/valgrind/org.eclipse.linuxtools.valgrind.ui.editor/build.properties
new file mode 100644
index 0000000000..eb97ee7308
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.ui.editor/build.properties
@@ -0,0 +1,8 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ OSGI-INF/l10n/bundle.properties,\
+ plugin.xml,\
+ about.html,\
+ icons/
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.ui/ChangeLog b/valgrind/org.eclipse.linuxtools.valgrind.ui/ChangeLog
new file mode 100644
index 0000000000..0805d8736c
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.ui/ChangeLog
@@ -0,0 +1,66 @@
+2010-05-26 Elliott Baron <ebaron@fedoraproject.org>
+
+ Bug #314376
+ * src/org/eclipse/linuxtools/internal/valgrind/ui/CoreMessagesViewer.java: Do not extend TreeViewer,
+ act as wrapper instead.
+ * src/org/eclipse/linuxtools/internal/valgrind/ui/ValgrindViewPart.java (refreshView): Change access to TreeViewer.
+ (showCorePage): Likewise.
+
+2009-08-11 Elliott Baron <ebaron@redhat.com>
+
+ * META-INF/MANIFEST.MF: Bump version to 0.3.0.
+
+2009-08-07 Andrew Overholt <overholt@redhat.com>
+
+ Bug #285861
+
+ * plugin.properties: Change Provider to Eclipse.
+
+2009-07-30 Elliott Baron <ebaron@redhat.com>
+
+ * src/org/eclipse/linuxtools/valgrind/ui: Removed.
+ * src/org/eclipse/linuxtools/internal/valgrind/ui: New package.
+ * .project: Added API analysis.
+ * META-INF/MANIFEST.MF: Export internal package.
+ * plugin.xml: Update class references.
+
+2009-07-28 Elliott Baron <ebaron@redhat.com>
+
+ * META-INF/MANIFEST.MF: New dependencies.
+ * CoreMessagesViewer.java (.doubleClick): Recreate SourceLocator once disposed.
+
+2009-04-30 Elliott Baron <ebaron@redhat.com>
+
+ * CoreMessagesViewer.java: New file.
+ * META-INF/MANIFEST.MF: New deps.
+ * ValgrindViewPart.java: Handle the work previously done in MemcheckViewPart.
+
+2009-04-03 Elliott Baron <ebaron@redhat.com>
+
+ * META-INF/MANIFEST.MF: 0.2.0 version.
+
+2009-03-31 Elliott Baron <ebaron@redhat.com>
+
+ * CollapseAction.java: New file.
+ * ExpandAction.java: New file.
+ * messages.properties: New strings.
+ * ValgrindViewPart.java (createPartControl): Remove margins for dynamic content.
+
+2009-03-17 Elliott Baron <ebaron@redhat.com>
+
+ * ValgrindViewPart.java (createDynamicContent): Call dispose on old dynamicView.
+
+2009-02-27 Elliott Baron <ebaron@redhat.com>
+
+ * ValgrindUIPlugin.java: Added some documentation.
+
+2009-02-12 Elliott Baron <ebaron@redhat.com>
+
+ * schema/org.eclipse.linuxtools.valgrind.ui.valgrindToolViews.exsd: Renamed.
+ * schema/valgrindToolViews.exsd: New file.
+ * ValgrindUIPlugin.java: Refactoring.
+
+2009-01-05 Elliott Baron <ebaron@redhat.com>
+
+ * META-INF/MANIFEST.MF: Changed version to 0.1.0.
+ * build.properties: Include about.html and icons. \ No newline at end of file
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.ui/META-INF/MANIFEST.MF b/valgrind/org.eclipse.linuxtools.valgrind.ui/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..3f4950a9f9
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.ui/META-INF/MANIFEST.MF
@@ -0,0 +1,24 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name.0
+Bundle-SymbolicName: org.eclipse.linuxtools.valgrind.ui;singleton:=true
+Bundle-Version: 0.4.0.qualifier
+Bundle-Activator: org.eclipse.linuxtools.internal.valgrind.ui.ValgrindUIPlugin
+Bundle-Vendor: %Bundle-Vendor.0
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Export-Package: org.eclipse.linuxtools.internal.valgrind.ui,
+ org.eclipse.linuxtools.valgrind.ui
+Bundle-Localization: plugin
+Import-Package: org.eclipse.cdt.debug.ui,
+ org.eclipse.debug.core,
+ org.eclipse.debug.core.model,
+ org.eclipse.debug.core.sourcelookup,
+ org.eclipse.debug.ui,
+ org.eclipse.debug.ui.sourcelookup,
+ org.eclipse.jface.text,
+ org.eclipse.linuxtools.internal.valgrind.core,
+ org.eclipse.linuxtools.profiling.ui,
+ org.eclipse.linuxtools.valgrind.core
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.ui/about.html b/valgrind/org.eclipse.linuxtools.valgrind.ui/about.html
new file mode 100644
index 0000000000..c258ef55d8
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.ui/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2006</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.ui/plugin.properties b/valgrind/org.eclipse.linuxtools.valgrind.ui/plugin.properties
new file mode 100644
index 0000000000..2fff3b4729
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.ui/plugin.properties
@@ -0,0 +1,5 @@
+#Properties file for org.eclipse.linuxtools.valgrind.ui
+view.name.0 = Valgrind
+Bundle-Vendor.0 = Eclipse Linux Tools
+Bundle-Name.0 = Valgrind UI Plug-in (Incubation)
+extension-point.name.0 = valgrindToolViews \ No newline at end of file
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.ui/src/org/eclipse/linuxtools/internal/valgrind/ui/CoreMessagesViewer.java b/valgrind/org.eclipse.linuxtools.valgrind.ui/src/org/eclipse/linuxtools/internal/valgrind/ui/CoreMessagesViewer.java
new file mode 100644
index 0000000000..83d8bbee57
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.ui/src/org/eclipse/linuxtools/internal/valgrind/ui/CoreMessagesViewer.java
@@ -0,0 +1,200 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * 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:
+ * Elliott Baron <ebaron@redhat.com> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.valgrind.ui;
+
+import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.model.IPersistableSourceLocator;
+import org.eclipse.debug.core.model.ISourceLocator;
+import org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector;
+import org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant;
+import org.eclipse.debug.ui.DebugUITools;
+import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.debug.ui.sourcelookup.ISourceLookupResult;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.ITreeSelection;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.linuxtools.internal.valgrind.core.ValgrindStackFrame;
+import org.eclipse.linuxtools.profiling.ui.ProfileUIUtils;
+import org.eclipse.linuxtools.valgrind.core.IValgrindMessage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+
+public class CoreMessagesViewer {
+ public IDoubleClickListener doubleClickListener;
+ public ITreeContentProvider contentProvider;
+ public IAction expandAction;
+ public IAction collapseAction;
+
+ private TreeViewer viewer;
+
+ public CoreMessagesViewer(Composite parent, int style) {
+ viewer = new TreeViewer(parent, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | style);
+ viewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
+ contentProvider = new ITreeContentProvider() {
+
+ public Object[] getChildren(Object parentElement) {
+ if (parentElement instanceof Object[]) {
+ return (Object[]) parentElement;
+ }
+ return ((IValgrindMessage) parentElement).getChildren();
+ }
+
+ public Object getParent(Object element) {
+ return ((IValgrindMessage) element).getParent();
+ }
+
+ public boolean hasChildren(Object element) {
+ return getChildren(element).length > 0;
+ }
+
+ public Object[] getElements(Object inputElement) {
+ return getChildren(inputElement);
+ }
+
+ public void dispose() {}
+
+ public void inputChanged(Viewer viewer, Object oldInput,
+ Object newInput) {}
+
+ };
+ viewer.setContentProvider(contentProvider);
+
+ viewer.setLabelProvider(new LabelProvider() {
+ @Override
+ public String getText(Object element) {
+ return ((IValgrindMessage) element).getText();
+ }
+
+ @Override
+ public Image getImage(Object element) {
+ Image image;
+ if (element instanceof ValgrindStackFrame) {
+ image = DebugUITools.getImage(IDebugUIConstants.IMG_OBJS_STACKFRAME);
+ }
+ else {
+ image = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
+ }
+ return image;
+ }
+
+ });
+
+ doubleClickListener = new IDoubleClickListener() {
+
+ public void doubleClick(DoubleClickEvent event) {
+ Object element = ((TreeSelection) event.getSelection()).getFirstElement();
+ if (element instanceof ValgrindStackFrame) {
+ ValgrindStackFrame frame = (ValgrindStackFrame) element;
+ ILaunch launch = frame.getLaunch();
+ ISourceLocator locator = launch.getSourceLocator();
+ if (locator instanceof AbstractSourceLookupDirector) {
+ AbstractSourceLookupDirector director = (AbstractSourceLookupDirector) locator;
+ ISourceLookupParticipant[] participants = director.getParticipants();
+ if (participants.length == 0) {
+ // source locator likely disposed, try recreating it
+ IPersistableSourceLocator sourceLocator;
+ ILaunchConfiguration config = launch.getLaunchConfiguration();
+ if (config != null) {
+ try {
+ String id = config.getAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, (String) null);
+ if (id == null) {
+ sourceLocator = CDebugUIPlugin.createDefaultSourceLocator();
+ sourceLocator.initializeDefaults(config);
+ } else {
+ sourceLocator = DebugPlugin.getDefault().getLaunchManager().newSourceLocator(id);
+ String memento = config.getAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, (String) null);
+ if (memento == null) {
+ sourceLocator.initializeDefaults(config);
+ } else {
+ sourceLocator.initializeFromMemento(memento);
+ }
+ }
+
+ // replace old source locator
+ locator = sourceLocator;
+ launch.setSourceLocator(sourceLocator);
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+ ISourceLookupResult result = DebugUITools.lookupSource(frame.getFile(), locator);
+
+ try {
+ ProfileUIUtils.openEditorAndSelect(result, frame.getLine());
+ } catch (PartInitException e) {
+ e.printStackTrace();
+ } catch (BadLocationException e) {
+ e.printStackTrace();
+ }
+ }
+ else {
+ if (viewer.getExpandedState(element)) {
+ viewer.collapseToLevel(element, TreeViewer.ALL_LEVELS);
+ }
+ else {
+ viewer.expandToLevel(element, 1);
+ }
+ }
+ }
+ };
+ viewer.addDoubleClickListener(doubleClickListener);
+
+ expandAction = new ExpandAction(viewer);
+ collapseAction = new CollapseAction(viewer);
+
+ MenuManager manager = new MenuManager();
+ manager.addMenuListener(new IMenuListener() {
+ public void menuAboutToShow(IMenuManager manager) {
+ ITreeSelection selection = (ITreeSelection) viewer.getSelection();
+ Object element = selection.getFirstElement();
+ if (contentProvider.hasChildren(element)) {
+ manager.add(expandAction);
+ manager.add(collapseAction);
+ }
+ }
+ });
+
+ manager.setRemoveAllWhenShown(true);
+ Menu contextMenu = manager.createContextMenu(viewer.getTree());
+ viewer.getControl().setMenu(contextMenu);
+ }
+
+ public IDoubleClickListener getDoubleClickListener() {
+ return doubleClickListener;
+ }
+
+ public TreeViewer getTreeViewer() {
+ return viewer;
+ }
+} \ No newline at end of file
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.ui/src/org/eclipse/linuxtools/internal/valgrind/ui/ValgrindViewPart.java b/valgrind/org.eclipse.linuxtools.valgrind.ui/src/org/eclipse/linuxtools/internal/valgrind/ui/ValgrindViewPart.java
new file mode 100644
index 0000000000..559d504343
--- /dev/null
+++ b/valgrind/org.eclipse.linuxtools.valgrind.ui/src/org/eclipse/linuxtools/internal/valgrind/ui/ValgrindViewPart.java
@@ -0,0 +1,191 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * 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:
+ * Elliott Baron <ebaron@redhat.com> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.internal.valgrind.ui;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.linuxtools.valgrind.core.IValgrindMessage;
+import org.eclipse.linuxtools.valgrind.ui.IValgrindToolView;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.part.PageBook;
+import org.eclipse.ui.part.ViewPart;
+
+public class ValgrindViewPart extends ViewPart {
+
+ protected PageBook pageBook;
+ protected Composite dynamicViewHolder;
+ protected IValgrindToolView dynamicView;
+ protected ActionContributionItem[] dynamicActions;
+ protected IValgrindMessage[] messages;
+ protected CoreMessagesViewer messagesViewer;
+ protected Action showCoreAction;
+ protected Action showToolAction;
+ protected boolean hasDynamicContent = false;
+
+ @Override
+ public void createPartControl(Composite parent) {
+ setContentDescription(Messages.getString("ValgrindViewPart.No_Valgrind_output")); //$NON-NLS-1$
+
+ pageBook = new PageBook(parent, SWT.NONE);
+ pageBook.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ messagesViewer = new CoreMessagesViewer(pageBook, SWT.NONE);
+
+ dynamicViewHolder = new Composite(pageBook, SWT.NONE);
+ GridLayout dynamicViewLayout = new GridLayout();
+ dynamicViewLayout.marginWidth = dynamicViewLayout.marginHeight = 0;
+ dynamicViewHolder.setLayout(dynamicViewLayout);
+ dynamicViewHolder.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ showCoreAction = new Action(Messages.getString("ValgrindViewPart.Show_Core_Action"), IAction.AS_RADIO_BUTTON) { //$NON-NLS-1$
+ @Override
+ public void run() {
+ showCorePage();
+ }
+ };
+ showToolAction = new Action(Messages.getString("ValgrindViewPart.Show_Tool_Action"), IAction.AS_RADIO_BUTTON) { //$NON-NLS-1$
+ @Override
+ public void run() {
+ showToolPage();
+ }
+ };
+
+ ValgrindUIPlugin.getDefault().setView(this);
+ }
+
+ public IValgrindToolView createDynamicContent(String description, String toolID) throws CoreException {
+ setContentDescription(description);
+
+ // remove tool specific toolbar controls
+ IToolBarManager toolbar = getViewSite().getActionBars().getToolBarManager();
+ if (dynamicActions != null) {
+ for (ActionContributionItem item : dynamicActions) {
+ toolbar.remove(item);
+ }
+ }
+
+ // remove old view controls
+ if (dynamicView != null) {
+ dynamicView.dispose();
+ }
+ for (Control child : dynamicViewHolder.getChildren()) {
+ if (!child.isDisposed()) {
+ child.dispose();
+ }
+ }
+
+ if (toolID != null) {
+ dynamicView = ValgrindUIPlugin.getDefault().getToolView(toolID);
+ dynamicView.createPartControl(dynamicViewHolder);
+
+ // create toolbar items
+ IAction[] actions = dynamicView.getToolbarActions();
+ if (actions != null) {
+ dynamicActions = new ActionContributionItem[actions.length];
+ for (int i = 0; i < actions.length; i++) {
+ dynamicActions[i] = new ActionContributionItem(actions[i]);
+ toolbar.appendToGroup(ValgrindUIPlugin.TOOLBAR_LOC_GROUP_ID, dynamicActions[i]);
+ }
+ }
+ }
+ else {
+ dynamicView = null;
+ }
+
+ // remove old menu items
+ IMenuManager menu = getViewSite().getActionBars().getMenuManager();
+ menu.removeAll();
+ // was content was created?
+ hasDynamicContent = dynamicViewHolder.getChildren().length > 0;
+ if (hasDynamicContent) {
+ menu.add(showCoreAction);
+ menu.add(showToolAction);
+ }
+
+ menu.update(true);
+ toolbar.update(true);
+ dynamicViewHolder.layout(true);
+
+ return dynamicView;
+ }
+
+ public void setMessages(IValgrindMessage[] messages) {
+ this.messages = messages;
+ }
+
+ public IValgrindMessage[] getMessages() {
+ return messages;
+ }
+
+ @Override
+ public void setFocus() {
+ if (dynamicView != null) {
+ dynamicView.setFocus();
+ }
+ }
+
+ public void refreshView() {
+ if (messages != null) {
+ messagesViewer.getTreeViewer().setInput(messages);
+
+ // decide which page to show
+ if (hasDynamicContent && messages.length == 0) {
+ // no valgrind messages to show
+ showCoreAction.setEnabled(false);
+ showToolPage();
+ }
+ else {
+ showCoreAction.setEnabled(true);
+ showCorePage();
+ }
+ }
+ if (dynamicView != null) {
+ dynamicView.refreshView();
+ }
+ }
+
+ @Override
+ public void dispose() {
+ if (dynamicView != null) {
+ dynamicView.dispose();
+ }
+ super.dispose();
+ }
+
+ public IValgrindToolView getDynamicView() {
+ return dynamicView;
+ }
+
+ public CoreMessagesViewer getMessagesViewer() {
+ return messagesViewer;
+ }
+
+ private void showCorePage() {
+ pageBook.showPage(messagesViewer.getTreeViewer().getControl());
+ showCoreAction.setChecked(true);
+ showToolAction.setChecked(false);
+ }
+
+ private void showToolPage() {
+ pageBook.showPage(dynamicViewHolder);
+ showToolAction.setChecked(true);
+ showCoreAction.setChecked(false);
+ }
+
+}

Back to the top