Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
MontyCarter committed Aug 14, 2014
2 parents 0a5e6b5 + 73b1987 commit 638ef87
Show file tree
Hide file tree
Showing 21 changed files with 157 additions and 55 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SMACK'D
SMACKd
==============

An Eclipse plugin for visually debugging SMACK.
Expand Down
8 changes: 6 additions & 2 deletions org.smackers.smack.feature/category.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<site>
<feature url="features/org.smackers.smack.feature_2.0.0.jar" id="org.smackers.smack.feature" version="2.0.0">
<feature url="features/org.smackers.smack.feature_2.0.1.jar" id="org.smackers.smack.feature" version="2.0.1">
<category name="smackd"/>
</feature>
<category-def name="smackd" label="SMACK&apos;D"/>
<category-def name="smackd" label="SMACKd Verification Tools">
<description>
A suite of tools for verifying C/C++ programs.
</description>
</category-def>
</site>
38 changes: 27 additions & 11 deletions org.smackers.smack.feature/feature.xml
Original file line number Diff line number Diff line change
@@ -1,36 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="org.smackers.smack.feature"
label="SMACK&apos;D"
version="2.0.0"
label="SMACKd"
version="2.0.1"
provider-name="smackers">

<description url="http://smackers.github.io/smackd">
SMACK&apos;D is an Eclipse plugin for visually debugging software
SMACKd is an Eclipse plugin for visually debugging software
analyzed by SMACK.
</description>

<copyright url="http://www.example.com/copyright">
[Enter Copyright Description here.]
</copyright>
<license url="">
The MIT License

<license url="http://www.example.com/license">
[Enter License Description here.]
Copyright (c) 2008-2014 Zvonimir Rakamaric (zvonimir@cs.utah.edu),
Michael Emmi (michael.emmi@gmail.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the &quot;Software&quot;), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
</license>

<url>
<update label="SMACK&apos;D" url="http://smackers.github.io/smackd"/>
<update label="SMACKd" url="http://smackers.github.io/smackd"/>
</url>

<requires>
<import feature="org.eclipse.cdt"/>
<import feature="org.eclipse.cdt"/>
</requires>

<plugin
id="org.smackers.smack"
download-size="0"
install-size="0"
version="2.0.0"/>
version="2.0.1"/>

</feature>
7 changes: 4 additions & 3 deletions org.smackers.smack/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: SMACK'D
Bundle-Name: SMACKd
Bundle-SymbolicName: org.smackers.smack;singleton:=true
Bundle-Version: 2.0.0
Bundle-Version: 2.0.1
Bundle-Activator: org.smackers.smack.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
Expand All @@ -13,7 +13,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.cdt,
org.eclipse.core.filesystem;bundle-version="1.4.0",
org.eclipse.cdt.ui,
org.eclipse.ui.workbench
org.eclipse.ui.workbench,
org.eclipse.ui.editors
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .,
Expand Down
46 changes: 21 additions & 25 deletions org.smackers.smack/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@
<extension
point="org.eclipse.ui.commands">
<category
name="SMACK"
name="SMACKd"
id="org.smackers.smack.commands.smackCategory">
</category>
<command
name="Get Smack&apos;d Verify"
name="Verify"
categoryId="org.smackers.smack.commands.smackCategory"
id="org.smackers.smack.commands.runSmackVerifyCommand">
</command>
<command
categoryId="org.smackers.smack.commands.smackCategory"
id="org.smackers.smack.commands.runRemoteSmackVerifyCommand"
name="Get Remote Smack&apos;d Verify">
name="Remote Verify">
</command>
<command
categoryId="org.smackers.smack.commands.smackCategory"
id="org.smackers.smack.commands.runSmackReachCommand"
name="Get Smack&apos;d Reach">
name="Reach">
</command>
<command
categoryId="org.smackers.smack.commands.smackCategory"
Expand Down Expand Up @@ -90,7 +90,7 @@
locationURI="menu:org.eclipse.ui.main.menu?after=additions">
<menu
id="org.smackers.smack.menus.smackMenu"
label="Smack&apos;d"
label="SMACKd"
mnemonic="M">
<command
commandId="org.smackers.smack.commands.runSmackVerifyCommand"
Expand Down Expand Up @@ -158,15 +158,13 @@
commandId="org.smackers.smack.commands.runSmackVerifyCommand"
icon="icons/SmackdLogo16.png"
mnemonic="S"
style="push"
tooltip="Get Smack&apos;d Verify">
style="push">
</command>
<command
commandId="org.smackers.smack.commands.runRemoteSmackVerifyCommand"
icon="icons/SmackdLogo16.png"
mnemonic="R"
style="push"
tooltip="Get Remote Smack&apos;d Verify">
style="push">
</command>
<separator
name="org.smackers.smack.separator3"
Expand All @@ -175,8 +173,7 @@
<command
commandId="org.smackers.smack.commands.clearVerifyMarkersCommand"
icon="icons/delete_obj.gif"
style="push"
tooltip="Clear Verify Markers">
style="push">
</command>
</menuContribution>
<menuContribution
Expand Down Expand Up @@ -205,8 +202,7 @@
<command
commandId="org.smackers.smack.commands.clearReachMarkersCommand"
icon="icons/delete_obj.gif"
style="push"
tooltip="Clear Reach Markers">
style="push">
</command>
</menuContribution>
</extension>
Expand All @@ -218,18 +214,18 @@
class="org.smackers.smack.views.SmackVerifyView"
icon="icons/SmackdLogo16.png"
id="org.smackers.smack.views.SmackVerifyView"
name="Smack&apos;d Verify">
name="SMACKd Verify">
</view>
<view
category="org.smackers.smack.views.smackdCategory"
class="org.smackers.smack.views.SmackReachView"
icon="icons/SmackdLogo16.png"
id="org.smackers.smack.views.SmackReachView"
name="Smack&apos;d Reach">
name="SMACKd Reach">
</view>
<category
id="org.smackers.smack.views.smackdCategory"
name="Smack&apos;d">
name="SMACKd">
</category>
<!-- icon="icons/sample.gif" Goes in "view" node of this extension node-->
</extension>
Expand All @@ -256,7 +252,7 @@
<page
class="org.smackers.smack.preferences.SmackPreferences"
id="org.smackers.smack.preferences.SmackPreferences"
name="Smack&apos;d">
name="SMACKd">
</page>
<page
category="org.smackers.smack.preferences.SmackPreferences"
Expand Down Expand Up @@ -285,7 +281,7 @@
name="Call Order"/>
<markerContentGenerator
id="org.smackers.smack.markers.SmackdVerifyMarkerGenerator"
name="Smack&apos;d Verify Marker Generator">
name="SMACKd Verify Marker Generator">
<markerTypeReference
id="org.smackers.smack.markers.smackAssertionFailedMarker"/>
<markerTypeReference
Expand All @@ -312,7 +308,7 @@
</markerContentGenerator>
<markerContentGenerator
id="org.smackers.smack.markers.SmackdReachMarkerGenerator"
name="Smack&apos;d Reach Marker Generator">
name="SMACKd Reach Marker Generator">
<markerTypeReference
id="org.smackers.smack.markers.smackUnreachableMarker">
</markerTypeReference>
Expand Down Expand Up @@ -356,14 +352,14 @@
point="org.eclipse.ui.editors.annotationTypes">
<type
markerType="org.smackers.smack.markers.smackAssertionFailedMarker"
name="org.smackers.smack.markers.smackAssertionFailedMarker">
name="org.smackers.smack.markers.smackAssertionFailedAnnotation">
</type>
</extension>

<extension
point="org.eclipse.ui.editors.markerAnnotationSpecification">
<specification
annotationType="org.smackers.smack.markers.smackAssertionFailedMarker"
annotationType="org.smackers.smack.markers.smackAssertionFailedAnnotation"
colorPreferenceKey="org.smackers.smack.markers.smackAssertionFailedMarker.color"
colorPreferenceValue="250,150,140"
contributesToHeader="false"
Expand Down Expand Up @@ -395,14 +391,14 @@
point="org.eclipse.ui.editors.annotationTypes">
<type
markerType="org.smackers.smack.markers.smackAssertionTraceMarker"
name="org.smackers.smack.markers.smackAssertionTraceMarker">
name="org.smackers.smack.markers.smackAssertionTraceAnnotation">
</type>
</extension>

<extension
point="org.eclipse.ui.editors.markerAnnotationSpecification">
<specification
annotationType="org.smackers.smack.markers.smackAssertionTraceMarker"
annotationType="org.smackers.smack.markers.smackAssertionTraceAnnotation"
colorPreferenceKey="org.smackers.smack.markers.smackAssertionTraceMarker.color"
colorPreferenceValue="192,255,192"
contributesToHeader="false"
Expand Down Expand Up @@ -435,13 +431,13 @@
point="org.eclipse.ui.editors.annotationTypes">
<type
markerType="org.smackers.smack.markers.smackUnreachableMarker"
name="org.smackers.smack.markers.smackUnreachableMarker">
name="org.smackers.smack.markers.smackUnreachableAnnotation">
</type>
</extension>
<extension
point="org.eclipse.ui.editors.markerAnnotationSpecification">
<specification
annotationType="org.smackers.smack.markers.smackUnreachableMarker"
annotationType="org.smackers.smack.markers.smackUnreachableAnnotation"
colorPreferenceKey="org.smackers.smack.markers.smackUnreachableMarker.color"
colorPreferenceValue="221,186,255"
contributesToHeader="false"
Expand Down
14 changes: 14 additions & 0 deletions org.smackers.smack/src/org/smackers/smack/Activator.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.smackers.smack;

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.internal.ide.IDEInternalPreferences;
import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
import org.smackers.smack.util.Logger;
Expand All @@ -19,6 +21,8 @@ public class Activator extends AbstractUIPlugin {
// The logger
private Logger logger;

private boolean oldMarkerLimitSetting;

/**
* The constructor
*/
Expand All @@ -33,13 +37,23 @@ public Activator() {
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
oldMarkerLimitSetting = IDEWorkbenchPlugin.getDefault().getPreferenceStore()
.getBoolean(IDEInternalPreferences.USE_MARKER_LIMITS);
if(oldMarkerLimitSetting) {
IDEWorkbenchPlugin.getDefault().getPreferenceStore().setValue(
IDEInternalPreferences.USE_MARKER_LIMITS, false);
}
}

/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
if(oldMarkerLimitSetting) {
IDEWorkbenchPlugin.getDefault().getPreferenceStore().setValue(
IDEInternalPreferences.USE_MARKER_LIMITS, true);
}
plugin = null;
super.stop(context);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public ChangeMarkerViewHandler() {
}


@SuppressWarnings({ "restriction"})
public Object execute(ExecutionEvent event) throws ExecutionException {
String eventCommandId = event.getCommand().getId();
SmackView sendingSmackView = (SmackView)getView(event);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class SmackPreferences
public SmackPreferences() {
super(GRID);
setPreferenceStore(Activator.getDefault().getPreferenceStore());
setDescription("SMACK'D Options");
setDescription("SMACKd Options");
}

/**
Expand Down
12 changes: 11 additions & 1 deletion org.smackers.smack/src/org/smackers/smack/util/SmackJob.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@

public abstract class SmackJob extends Job {

private IProgressMonitor monitor;

//Marker types
protected static final String markerFail = "org.smackers.smack.markers.smackAssertionFailedMarker";
protected static final String markerTrace = "org.smackers.smack.markers.smackAssertionTraceMarker";
Expand Down Expand Up @@ -100,6 +102,8 @@ public SmackJob(String name, String errorTitle, String normalMarkerId) {
@Override
protected IStatus run(IProgressMonitor monitor) {

this.monitor = monitor;

final IProject project = file.getProject();
//Clear Verify markers
int depth = IResource.DEPTH_INFINITE;
Expand Down Expand Up @@ -243,11 +247,17 @@ private String collectLocalProcOutput(Process p) throws ExecutionException {
//If we don't wait till bri has output, the call to bri.read()
// blocks, and deadlocks the threads.
while(!bri.ready()) {
if(monitor.isCanceled()) {
//monitor.
//p.
p.destroy();
throw new ExecutionException("Job cancelled");
}
Thread.sleep(100L);
}

int c;
while ((c = bri.read()) != -1) {
while ((c = bri.read()) != -1 ) {
result.append((char)c);
}
} catch (IOException | InterruptedException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
public class SmackJobReach extends SmackJob {

public SmackJobReach(IFile file) {
super("Getting Smack'd Reach", "Smack'd Reach Failed!", SmackJob.markerReach);
super("Getting SMACKd Reach", "SMACKd Reach Failed!", SmackJob.markerReach);
setFile(file);

//Prepare process
Expand All @@ -31,7 +31,7 @@ public SmackJobReach(IFile file) {

setMarkerIdsToClear(Arrays.asList(SmackJob.markerReach));

setSuccessTitle("Smack'd Reach Success!");
setSuccessTitle("SMACKd Reach Success!");
setSuccessMsg("No unreachable code was detected");
}

Expand Down
Loading

0 comments on commit 638ef87

Please sign in to comment.