Skip to content

Commit

Permalink
First Draft
Browse files Browse the repository at this point in the history
  • Loading branch information
niconistal committed Jan 28, 2013
1 parent a2f6d39 commit 62faba8
Show file tree
Hide file tree
Showing 4,732 changed files with 409,716 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
Binary file added .DS_Store
Binary file not shown.
7 changes: 7 additions & 0 deletions org.isistan.flabot.debugger/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>
30 changes: 30 additions & 0 deletions org.isistan.flabot.debugger/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.isistan.flabot.debugger</name>
<comment></comment>
<projects>
<project>org.isistan.flabot</project>
<project>org.isistan.flabot.engine</project>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
24 changes: 24 additions & 0 deletions org.isistan.flabot.debugger/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: FLABot Debugger Plug-in
Bundle-SymbolicName: org.isistan.flabot.debugger;singleton:=true
Bundle-Version: 0.1.1
Bundle-ClassPath: lib/debugger.jar
Bundle-Activator: org.isistan.flabot.debugger.DebuggerPlugin
Bundle-Vendor: www.exa.unicen.edu.ar/isistan/
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.jdt.debug,
org.eclipse.core.resources,
org.eclipse.jdt.core,
org.isistan.flabot,
org.isistan.flabot.engine,
org.isistan.flabot.javamodel,
org.isistan.flabot.util,
org.isistan.flabot.javamodel.jdt,
org.isistan.flabot.mapping,
org.eclipse.debug.core,
org.eclipse.emf.common,
org.eclipse.emf.ecore
Eclipse-AutoStart: true
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
org.isistan.flabot.debugger.InstallBreakpointsAction.errorOcurredWhileInstallinBreakpoint=Error occurred while installing a breakpoint for the responsibility node {0} in behavior {1}: [{2}] {3}
org.isistan.flabot.debugger.InstallBreakpointsAction.impossibleToInstallBreakpoint=Impossible to install breakpoint
org.isistan.flabot.debugger.InstallBreakpointsAction.noMappingDefined=No mapping defined for responsibility {0}.
8 changes: 8 additions & 0 deletions org.isistan.flabot.debugger/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
bin.includes = META-INF/,\
plugin.xml,\
lib/debugger.jar,\
resource/,\
bin/
jars.compile.order = lib/debugger.jar
source.lib/debugger.jar = src/
output.lib/debugger.jar = bin/
3 changes: 3 additions & 0 deletions org.isistan.flabot.debugger/org.eclipse.jdt.ui.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#Tue Jan 24 17:07:56 ART 2006
eclipse.preferences.version=1
org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates/>
15 changes: 15 additions & 0 deletions org.isistan.flabot.debugger/plugin.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin>
<extension
id="org.isistan.flabot.debugger.installBreakpointsAction"
name="Flabot Debugger Install breakpoints action"
point="org.isistan.flabot.engine.failureLocatedAction">
<action
class="org.isistan.flabot.debugger.InstallBreakpointsAction"
description="Install breakpoints for the mapped behaviors"
icon="resource/icon/failureLocatedActionIcon.gif"
name="Flabot Debugger Install Breakpoints"/>
</extension>

</plugin>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/**
* $Id: BreakpointsInstaller.java,v 1.8 2006/04/05 22:03:24 dacostae Exp $
* $Author: dacostae $
*/
package org.isistan.flabot.debugger;


import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.model.IBreakpoint;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.debug.core.IJavaMethodBreakpoint;
import org.eclipse.jdt.debug.core.JDIDebugModel;
import org.eclipse.jdt.internal.debug.core.breakpoints.JavaMethodBreakpoint;
import org.isistan.flabot.javamodel.JBehavior;
import org.isistan.flabot.javamodel.JSourceLocation;
import org.isistan.flabot.javamodel.jdt.JavaModelJDTUtil;

/**
* The breakpoints installer creates eclipse breakpoints
*
* @author da Costa Cambio
*
*/
public class BreakpointsInstaller {
/**
* Creates an entry/exit behavior breakpoint in the given behavior.
*
* @param behavior
* @return
* @throws JavaModelException
* @throws CoreException
*/
public IJavaMethodBreakpoint install(JBehavior behavior, boolean register) throws JavaModelException, CoreException {
IResource resource=JavaModelJDTUtil.getResource(behavior);
String typeName=behavior.getDeclaringClass().getName();
String behaviorName=behavior.getName();
String signature=behavior.getJNISignature();

JSourceLocation sourceLocation = behavior.getSourceLocation();
int charStart=sourceLocation.getOffset();
int charEnd=sourceLocation.getEndOffset();

return JDIDebugModel.createMethodBreakpoint(resource, typeName, behaviorName, signature, true, true, false, -1, charStart, charEnd, 0, register, null);

}

public IJavaMethodBreakpoint[] get(JBehavior behavior) {
IBreakpoint[] breakpoints =
DebugPlugin.getDefault().getBreakpointManager().getBreakpoints();
String typeName=behavior.getDeclaringClass().getName();
String behaviorName=behavior.getName();
String behaviorSignature=behavior.getJNISignature();
List<IJavaMethodBreakpoint> matchingBreakpoints=
new LinkedList<IJavaMethodBreakpoint>();
for (IBreakpoint breakpoint : breakpoints) {
if(breakpoint instanceof IJavaMethodBreakpoint) {
IJavaMethodBreakpoint jmbreakpoint =
(IJavaMethodBreakpoint) breakpoint;
try {
String brTypeName=jmbreakpoint.getTypeName();
String brBehaviorName=jmbreakpoint.getMethodName();
String brBehaviorSignature=jmbreakpoint.getMethodSignature();
if(typeName.equals(brTypeName)
&& behaviorName.equals(brBehaviorName)
&& behaviorSignature.equals(brBehaviorSignature)) {
matchingBreakpoints.add(jmbreakpoint);
}
} catch (CoreException e) {
DebuggerPlugin.getDefault().getLogger().error(
"Error getting breakpoints: {}", e);
}
}
}
return matchingBreakpoints.toArray(
new IJavaMethodBreakpoint[matchingBreakpoints.size()]);
}


public void register(IJavaMethodBreakpoint breakpoint) throws CoreException {
DebugPlugin.getDefault().getBreakpointManager().addBreakpoint(breakpoint);
}

public void remove(IJavaMethodBreakpoint breakpoint) throws CoreException {
breakpoint.delete();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
package org.isistan.flabot.debugger;

import org.eclipse.ui.plugin.*;
import org.eclipse.jface.resource.ImageDescriptor;
import org.isistan.flabot.FlabotPlugin;
import org.isistan.flabot.util.log.DefaultLogStatusCodes;
import org.isistan.flabot.util.log.EclipsePlatformLogger;
import org.isistan.flabot.util.log.LogStatusCodes;
import org.osgi.framework.BundleContext;
import org.slf4j.Logger;

/**
* The main plugin class to be used in the desktop.
*/
public class DebuggerPlugin extends AbstractUIPlugin {

/**
* This plugin's id
*/
public static final String SYMBOLIC_NAME = "org.isistan.debugger";


//The shared instance.
private static DebuggerPlugin plugin;


private Logger logger;

/**
* The constructor.
*/
public DebuggerPlugin() {
plugin = this;
}

/**
* This method is called upon plug-in activation
*/
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
}

/**
* This method is called when the plug-in is stopped
*/
@Override
public void stop(BundleContext context) throws Exception {
super.stop(context);
plugin = null;
}

/**
* Returns the shared instance.
*/
public static DebuggerPlugin getDefault() {
return plugin;
}

/**
* Returns an image descriptor for the image file at the given
* plug-in relative path.
*
* @param path the path
* @return the image descriptor
*/
public static ImageDescriptor getImageDescriptor(String path) {
return AbstractUIPlugin.imageDescriptorFromPlugin("org.isistan.flabot.debugger", path);
}

/**
* Returns the plugin's logger
* @return
*/
public Logger getLogger() {
if (logger == null) {
logger = new EclipsePlatformLogger(this, FlabotPlugin.SYMBOLIC_NAME, getLogStatusCodes());
}
return logger;
}

/**
* Returns the plugin's LogStatusCodes
* @return
*/
public LogStatusCodes getLogStatusCodes() {
return DefaultLogStatusCodes.getInstance();
}
}
Loading

0 comments on commit 62faba8

Please sign in to comment.