org.eclipse.linuxtools.oprofile.launch.exe_1.3.18.201310312000

16:46:07.472 INFO  jd.cli.Main - Decompiling org.eclipse.linuxtools.oprofile.launch.exe_1.3.18.201310312000.jar
package org.tizen.oprofile.launch;

import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;

public class Activator
  extends Plugin
{
  private static Activator plugin;
  
  public void start(BundleContext paramBundleContext)
    throws Exception
  {
    super.start(paramBundleContext);
    plugin = this;
  }
  
  public void stop(BundleContext paramBundleContext)
    throws Exception
  {
    plugin = null;
    super.stop(paramBundleContext);
  }
  
  public static Activator getDefault()
  {
    return plugin;
  }
}

/* Location:
 * Qualified Name:     org.tizen.oprofile.launch.Activator
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.oprofile.launch;

import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.ui.DebugUITools;
import org.tizen.common.gom.launch.GomLaunchData;

class NormalOprofileLaunchShortcut$1
  implements Runnable
{
  NormalOprofileLaunchShortcut$1(NormalOprofileLaunchShortcut paramNormalOprofileLaunchShortcut, ILaunchConfiguration paramILaunchConfiguration, GomLaunchData paramGomLaunchData) {}
  
  public void run()
  {
    DebugUITools.launch(val$configuration, val$data.getMode());
  }
}

/* Location:
 * Qualified Name:     org.tizen.oprofile.launch.NormalOprofileLaunchShortcut.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.oprofile.launch;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.linuxtools.oprofile.launch.OprofileLaunchMessages;
import org.eclipse.linuxtools.oprofile.launch.configuration.LaunchOptions;
import org.eclipse.linuxtools.profiling.launch.ProfileLaunchPlugin;
import org.eclipse.linuxtools.profiling.launch.ProfileLaunchShortcut;
import org.eclipse.ui.IEditorPart;
import org.tizen.common.gom.launch.GomLaunchData;
import org.tizen.common.gom.launch.IGomSmartLaunchShortcut;
import org.tizen.common.util.SWTUtil;

public class NormalOprofileLaunchShortcut
  extends ProfileLaunchShortcut
  implements IGomSmartLaunchShortcut
{
  public void launch(IEditorPart paramIEditorPart, String paramString)
  {
    int i = ProfileLaunchPlugin.checkTarget();
    if (i == 0) {
      ProfileLaunchShortcut.showErrorDialog(OprofileLaunchMessages.getString("common.cannotrun"), OprofileLaunchMessages.getString("common.notarget"), null);
    } else {
      super.launch(paramIEditorPart, paramString);
    }
  }
  
  public void launch(ISelection paramISelection, String paramString)
  {
    int i = ProfileLaunchPlugin.checkTarget();
    if (i == 0) {
      ProfileLaunchShortcut.showErrorDialog(OprofileLaunchMessages.getString("common.cannotrun"), OprofileLaunchMessages.getString("common.notarget"), null);
    } else {
      super.launch(paramISelection, paramString);
    }
  }
  
  protected ILaunchConfigurationType getLaunchConfigType()
  {
    return getLaunchManager().getLaunchConfigurationType("org.eclipse.linuxtools.oprofile.launch.oprofile");
  }
  
  protected void setDefaultProfileAttributes(ILaunchConfigurationWorkingCopy paramILaunchConfigurationWorkingCopy)
    throws CoreException
  {
    LaunchOptions localLaunchOptions = new LaunchOptions();
    localLaunchOptions.saveConfiguration(paramILaunchConfigurationWorkingCopy);
    paramILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.linuxtools.oprofile.launch.oprofile.USE_DEFAULT_EVENT", true);
    paramILaunchConfigurationWorkingCopy.setAttribute("org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND", true);
  }
  
  public void smartLaunch(final GomLaunchData paramGomLaunchData)
  {
    final ILaunchConfiguration localILaunchConfiguration = createConfiguration(paramGomLaunchData.getProject(), paramGomLaunchData.getMode());
    SWTUtil.syncExec(new Runnable()
    {
      public void run()
      {
        DebugUITools.launch(localILaunchConfiguration, paramGomLaunchData.getMode());
      }
    });
  }
}

/* Location:
 * Qualified Name:     org.tizen.oprofile.launch.NormalOprofileLaunchShortcut
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.oprofile.launch;

import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;

class TizenOprofileLaunchDelegate$1
  implements Runnable
{
  TizenOprofileLaunchDelegate$1(TizenOprofileLaunchDelegate paramTizenOprofileLaunchDelegate) {}
  
  public void run()
  {
    IWorkbenchWindow localIWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    MessageBox localMessageBox = new MessageBox(localIWorkbenchWindow.getShell(), 40);
    localMessageBox.setMessage("Operation canceled by user.");
    localMessageBox.open();
  }
}

/* Location:
 * Qualified Name:     org.tizen.oprofile.launch.TizenOprofileLaunchDelegate.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.oprofile.launch;

import org.eclipse.linuxtools.oprofile.ui.OprofileUiPlugin;
import org.eclipse.linuxtools.oprofile.ui.view.OprofileView;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;

class TizenOprofileLaunchDelegate$2
  implements Runnable
{
  TizenOprofileLaunchDelegate$2(TizenOprofileLaunchDelegate paramTizenOprofileLaunchDelegate) {}
  
  public void run()
  {
    OprofileView localOprofileView = OprofileUiPlugin.getDefault().getOprofileView();
    if (localOprofileView != null)
    {
      localOprofileView.refreshView();
    }
    else
    {
      try
      {
        PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("org.eclipse.linuxtools.oprofile.ui.OProfileView");
      }
      catch (PartInitException localPartInitException)
      {
        localPartInitException.printStackTrace();
      }
      OprofileUiPlugin.getDefault().getOprofileView().refreshView();
    }
  }
}

/* Location:
 * Qualified Name:     org.tizen.oprofile.launch.TizenOprofileLaunchDelegate.2
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.oprofile.launch;

import org.eclipse.linuxtools.oprofile.ui.OprofileUiPlugin;
import org.eclipse.linuxtools.oprofile.ui.view.OprofileView;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;

class TizenOprofileLaunchDelegate$LaunchTerminationWatcher$1
  implements Runnable
{
  TizenOprofileLaunchDelegate$LaunchTerminationWatcher$1(TizenOprofileLaunchDelegate.LaunchTerminationWatcher paramLaunchTerminationWatcher) {}
  
  public void run()
  {
    OprofileView localOprofileView = OprofileUiPlugin.getDefault().getOprofileView();
    if (localOprofileView != null)
    {
      localOprofileView.refreshView();
    }
    else
    {
      try
      {
        PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("org.eclipse.linuxtools.oprofile.ui.OProfileView");
      }
      catch (PartInitException localPartInitException)
      {
        localPartInitException.printStackTrace();
      }
      OprofileUiPlugin.getDefault().getOprofileView().refreshView();
    }
  }
}

/* Location:
 * Qualified Name:     org.tizen.oprofile.launch.TizenOprofileLaunchDelegate.LaunchTerminationWatcher.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.oprofile.launch;

import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchesListener2;
import org.eclipse.linuxtools.oprofile.core.IOpcontrolProvider;
import org.eclipse.linuxtools.oprofile.core.OpcontrolException;
import org.eclipse.linuxtools.oprofile.core.OprofileCorePlugin;
import org.eclipse.linuxtools.oprofile.ui.OprofileUiPlugin;
import org.eclipse.linuxtools.oprofile.ui.view.OprofileView;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;

class TizenOprofileLaunchDelegate$LaunchTerminationWatcher
  implements ILaunchesListener2
{
  private ILaunch launch;
  
  public TizenOprofileLaunchDelegate$LaunchTerminationWatcher(TizenOprofileLaunchDelegate paramTizenOprofileLaunchDelegate, ILaunch paramILaunch)
  {
    launch = paramILaunch;
  }
  
  public void launchesTerminated(ILaunch[] paramArrayOfILaunch)
  {
    try
    {
      ILaunch[] arrayOfILaunch;
      int j = (arrayOfILaunch = paramArrayOfILaunch).length;
      for (int i = 0; i < j; i++)
      {
        ILaunch localILaunch = arrayOfILaunch[i];
        if (localILaunch.equals(launch))
        {
          OprofileCorePlugin.getDefault().getOpcontrolProvider().dumpSamples();
          OprofileCorePlugin.getDefault().getOpcontrolProvider().shutdownDaemon();
          Display.getDefault().syncExec(new Runnable()
          {
            public void run()
            {
              OprofileView localOprofileView = OprofileUiPlugin.getDefault().getOprofileView();
              if (localOprofileView != null)
              {
                localOprofileView.refreshView();
              }
              else
              {
                try
                {
                  PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("org.eclipse.linuxtools.oprofile.ui.OProfileView");
                }
                catch (PartInitException localPartInitException)
                {
                  localPartInitException.printStackTrace();
                }
                OprofileUiPlugin.getDefault().getOprofileView().refreshView();
              }
            }
          });
        }
      }
    }
    catch (OpcontrolException localOpcontrolException)
    {
      OprofileCorePlugin.showErrorDialog("opcontrolProvider", localOpcontrolException);
    }
  }
  
  public void launchesAdded(ILaunch[] paramArrayOfILaunch) {}
  
  public void launchesChanged(ILaunch[] paramArrayOfILaunch) {}
  
  public void launchesRemoved(ILaunch[] paramArrayOfILaunch) {}
}

/* Location:
 * Qualified Name:     org.tizen.oprofile.launch.TizenOprofileLaunchDelegate.LaunchTerminationWatcher
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.oprofile.launch;

import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import org.eclipse.cdt.debug.core.CDebugUtils;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchesListener2;
import org.eclipse.linuxtools.oprofile.core.IOpcontrolProvider;
import org.eclipse.linuxtools.oprofile.core.OpcontrolException;
import org.eclipse.linuxtools.oprofile.core.OprofileCorePlugin;
import org.eclipse.linuxtools.oprofile.core.daemon.OprofileDaemonEvent;
import org.eclipse.linuxtools.oprofile.launch.configuration.LaunchOptions;
import org.eclipse.linuxtools.oprofile.launch.configuration.OprofileCounter;
import org.eclipse.linuxtools.oprofile.ui.OprofileUiPlugin;
import org.eclipse.linuxtools.oprofile.ui.view.OprofileView;
import org.eclipse.linuxtools.profiling.launch.ProfileLaunchPlugin;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.tizen.common.TizenPlatformConstants;
import org.tizen.nativecommon.ProjectUtil;
import org.tizen.nativecommon.launch.IProjectLaunchCommand;
import org.tizen.nativecommon.launch.TizenLaunchDelegate;
import org.tizen.nativecommon.launch.TizenLaunchMessages;
import org.tizen.oprofile.core.CommandManager;

public class TizenOprofileLaunchDelegate
  extends TizenLaunchDelegate
{
  protected static final String MAKE_DIRECTORY_CMD = "mkdir -p ";
  protected static final String CHANGE_DIRECTORY_CMD = "cd ";
  protected static final String PACKAGE_NAME = "oprofile";
  protected static final String PACKAGE_FILENAME_ARM = "oprofile_armel.deb";
  protected static final String BADA_EXT = ".exe";
  protected static final String LAUNCHPAD_DAEMON = "/usr/bin/launchpad_preloading_preinitializing_daemon";
  protected static final String LAUNCHPAD_LAUNCHER = "launch_app ";
  protected static final String LAUNCHPAD_SYNCMODE = " __LAUNCH_APP_MODE__ SYNC";
  protected static String appName = null;
  
  public static String getAppName()
  {
    return appName;
  }
  
  public static void setAppName(String paramString)
  {
    appName = paramString;
  }
  
  private String getPackageName(ILaunchConfiguration paramILaunchConfiguration)
    throws CoreException
  {
    IProject localIProject = ProjectUtil.getProject(paramILaunchConfiguration);
    IProjectLaunchCommand localIProjectLaunchCommand = ProjectUtil.getProjectManifest(localIProject);
    return localIProjectLaunchCommand.getPackageName();
  }
  
  private String getExecutableName(ILaunchConfiguration paramILaunchConfiguration)
    throws CoreException
  {
    String str = ProjectUtil.getExecutableName(paramILaunchConfiguration);
    if (str.endsWith(".exe")) {
      str = str.substring(0, str.length() - ".exe".length());
    }
    return str;
  }
  
  /* Error */
  public void launch(ILaunchConfiguration paramILaunchConfiguration, String paramString, ILaunch paramILaunch, IProgressMonitor paramIProgressMonitor)
    throws CoreException
  {
    // Byte code:
    //   0: aload 4
    //   2: ifnonnull +12 -> 14
    //   5: new 83	org/eclipse/core/runtime/NullProgressMonitor
    //   8: dup
    //   9: invokespecial 85	org/eclipse/core/runtime/NullProgressMonitor:<init>	()V
    //   12: astore 4
    //   14: invokestatic 86	org/eclipse/linuxtools/profiling/launch/ProfileLaunchPlugin:isProfiling	()Z
    //   17: ifeq +25 -> 42
    //   20: aload 4
    //   22: invokeinterface 92 1 0
    //   27: ldc 97
    //   29: invokestatic 99	org/eclipse/linuxtools/oprofile/launch/OprofileLaunchMessages:getString	(Ljava/lang/String;)Ljava/lang/String;
    //   32: ldc 105
    //   34: invokestatic 99	org/eclipse/linuxtools/oprofile/launch/OprofileLaunchMessages:getString	(Ljava/lang/String;)Ljava/lang/String;
    //   37: aconst_null
    //   38: invokestatic 107	org/eclipse/linuxtools/profiling/launch/ProfileLaunchShortcut:showErrorDialog	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Exception;)V
    //   41: return
    //   42: invokestatic 113	org/eclipse/linuxtools/profiling/launch/ProfileLaunchPlugin:checkTarget	()I
    //   45: istore 5
    //   47: iload 5
    //   49: ifne +25 -> 74
    //   52: aload 4
    //   54: invokeinterface 92 1 0
    //   59: ldc 97
    //   61: invokestatic 99	org/eclipse/linuxtools/oprofile/launch/OprofileLaunchMessages:getString	(Ljava/lang/String;)Ljava/lang/String;
    //   64: ldc 116
    //   66: invokestatic 99	org/eclipse/linuxtools/oprofile/launch/OprofileLaunchMessages:getString	(Ljava/lang/String;)Ljava/lang/String;
    //   69: aconst_null
    //   70: invokestatic 107	org/eclipse/linuxtools/profiling/launch/ProfileLaunchShortcut:showErrorDialog	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Exception;)V
    //   73: return
    //   74: invokestatic 118	org/eclipse/linuxtools/profiling/launch/ProfileLaunchPlugin:startProfiling	()V
    //   77: aload_1
    //   78: invokestatic 49	org/tizen/nativecommon/ProjectUtil:getProject	(Lorg/eclipse/debug/core/ILaunchConfiguration;)Lorg/eclipse/core/resources/IProject;
    //   81: invokestatic 121	org/tizen/nativecommon/ProjectUtil:getXmlStore	(Lorg/eclipse/core/resources/IProject;)Lorg/tizen/nativecommon/IXMLStore;
    //   84: astore 6
    //   86: aload 6
    //   88: invokeinterface 125 1 0
    //   93: ifeq +10 -> 103
    //   96: aload_0
    //   97: ldc -126
    //   99: aconst_null
    //   100: invokevirtual 132	org/tizen/oprofile/launch/TizenOprofileLaunchDelegate:newCoreException	(Ljava/lang/String;Ljava/lang/Throwable;)V
    //   103: aload 4
    //   105: getstatic 136	org/tizen/nativecommon/launch/TizenLaunchMessages:LAUNCH_APPLICATION	Ljava/lang/String;
    //   108: bipush 30
    //   110: invokeinterface 141 3 0
    //   115: aload_0
    //   116: invokevirtual 145	org/tizen/oprofile/launch/TizenOprofileLaunchDelegate:activateProgressView	()V
    //   119: aload_0
    //   120: aload_1
    //   121: invokevirtual 148	org/tizen/oprofile/launch/TizenOprofileLaunchDelegate:verifyCProjectConfigurationSettings	(Lorg/eclipse/debug/core/ILaunchConfiguration;)V
    //   124: aload_0
    //   125: aload_1
    //   126: invokestatic 49	org/tizen/nativecommon/ProjectUtil:getProject	(Lorg/eclipse/debug/core/ILaunchConfiguration;)Lorg/eclipse/core/resources/IProject;
    //   129: new 152	org/eclipse/core/runtime/SubProgressMonitor
    //   132: dup
    //   133: aload 4
    //   135: bipush 9
    //   137: invokespecial 154	org/eclipse/core/runtime/SubProgressMonitor:<init>	(Lorg/eclipse/core/runtime/IProgressMonitor;I)V
    //   140: invokevirtual 157	org/tizen/oprofile/launch/TizenOprofileLaunchDelegate:verifyDeviceReachability	(Lorg/eclipse/core/resources/IProject;Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   143: aload_0
    //   144: aload_1
    //   145: aload_2
    //   146: new 152	org/eclipse/core/runtime/SubProgressMonitor
    //   149: dup
    //   150: aload 4
    //   152: bipush 11
    //   154: invokespecial 154	org/eclipse/core/runtime/SubProgressMonitor:<init>	(Lorg/eclipse/core/runtime/IProgressMonitor;I)V
    //   157: invokevirtual 161	org/tizen/oprofile/launch/TizenOprofileLaunchDelegate:verifyBuildConfiguration	(Lorg/eclipse/debug/core/ILaunchConfiguration;Ljava/lang/String;Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   160: aload_0
    //   161: aload_1
    //   162: invokevirtual 165	org/tizen/oprofile/launch/TizenOprofileLaunchDelegate:setConsole	(Lorg/eclipse/debug/core/ILaunchConfiguration;)V
    //   165: aload_0
    //   166: new 168	org/tizen/nativecommon/launch/TizenLaunchCommand
    //   169: dup
    //   170: aload_0
    //   171: getfield 170	org/tizen/oprofile/launch/TizenOprofileLaunchDelegate:currentDevice	Lorg/tizen/sdblib/IDevice;
    //   174: aload_0
    //   175: getfield 174	org/tizen/oprofile/launch/TizenOprofileLaunchDelegate:launchConsole	Lorg/tizen/nativecommon/launch/TizenLaunchConsole;
    //   178: invokespecial 178	org/tizen/nativecommon/launch/TizenLaunchCommand:<init>	(Lorg/tizen/sdblib/IDevice;Lorg/tizen/common/ui/view/console/ConsoleManager;)V
    //   181: putfield 181	org/tizen/oprofile/launch/TizenOprofileLaunchDelegate:tizenCommand	Lorg/tizen/nativecommon/launch/TizenLaunchCommand;
    //   184: aload_0
    //   185: getfield 174	org/tizen/oprofile/launch/TizenOprofileLaunchDelegate:launchConsole	Lorg/tizen/nativecommon/launch/TizenLaunchConsole;
    //   188: invokevirtual 185	org/tizen/nativecommon/launch/TizenLaunchConsole:show	()V
    //   191: invokestatic 190	org/eclipse/linuxtools/oprofile/core/Oprofile:getOpInfo	()Lorg/eclipse/linuxtools/oprofile/core/daemon/OpInfo;
    //   194: pop
    //   195: aload_2
    //   196: ldc -60
    //   198: invokevirtual 198	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   201: ifeq +38 -> 239
    //   204: aload_0
    //   205: aload_1
    //   206: new 152	org/eclipse/core/runtime/SubProgressMonitor
    //   209: dup
    //   210: aload 4
    //   212: bipush 9
    //   214: invokespecial 154	org/eclipse/core/runtime/SubProgressMonitor:<init>	(Lorg/eclipse/core/runtime/IProgressMonitor;I)V
    //   217: invokevirtual 202	org/tizen/oprofile/launch/TizenOprofileLaunchDelegate:deployApplication	(Lorg/eclipse/debug/core/ILaunchConfiguration;Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   220: aload 4
    //   222: iconst_1
    //   223: invokeinterface 206 2 0
    //   228: aload_0
    //   229: aload_3
    //   230: aload_1
    //   231: aload 4
    //   233: invokevirtual 210	org/tizen/oprofile/launch/TizenOprofileLaunchDelegate:launchApplicationWithOprofile	(Lorg/eclipse/debug/core/ILaunch;Lorg/eclipse/debug/core/ILaunchConfiguration;Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   236: goto +29 -> 265
    //   239: aload_0
    //   240: getstatic 214	org/tizen/nativecommon/launch/TizenLaunchMessages:CANNOT_LAUNCH	Ljava/lang/String;
    //   243: aconst_null
    //   244: invokevirtual 132	org/tizen/oprofile/launch/TizenOprofileLaunchDelegate:newCoreException	(Ljava/lang/String;Ljava/lang/Throwable;)V
    //   247: goto +18 -> 265
    //   250: astore 7
    //   252: aload 4
    //   254: invokeinterface 92 1 0
    //   259: invokestatic 217	org/eclipse/linuxtools/profiling/launch/ProfileLaunchPlugin:stopProfiling	()V
    //   262: aload 7
    //   264: athrow
    //   265: aload 4
    //   267: invokeinterface 92 1 0
    //   272: invokestatic 217	org/eclipse/linuxtools/profiling/launch/ProfileLaunchPlugin:stopProfiling	()V
    //   275: return
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	276	0	this	TizenOprofileLaunchDelegate
    //   0	276	1	paramILaunchConfiguration	ILaunchConfiguration
    //   0	276	2	paramString	String
    //   0	276	3	paramILaunch	ILaunch
    //   0	276	4	paramIProgressMonitor	IProgressMonitor
    //   45	3	5	i	int
    //   84	3	6	localIXMLStore	org.tizen.nativecommon.IXMLStore
    //   250	13	7	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   74	250	250	finally
  }
  
  protected void launchApplicationWithOprofile(ILaunch paramILaunch, ILaunchConfiguration paramILaunchConfiguration, IProgressMonitor paramIProgressMonitor)
    throws CoreException
  {
    try
    {
      checkProfilingTool(paramIProgressMonitor);
      String str1 = getDebugLaunchCommand(paramILaunchConfiguration);
      if (paramIProgressMonitor.isCanceled()) {
        throw new OperationCanceledException();
      }
      if (str1.endsWith(".exe")) {
        str1 = str1.substring(0, str1.length() - ".exe".length());
      }
      String str2 = "oprofile lsapp " + str1;
      String[] arrayOfString = CommandManager.runHostCommandReturningResultArray(str2);
      if (!CommandManager.isRunSuccessfuly(arrayOfString)) {
        newCoreException(TizenLaunchMessages.CANNOT_LAUNCH, new Exception("Executable does not exist on a valid path. You must install your application before running it."));
      }
      if (paramIProgressMonitor.isCanceled()) {
        throw new OperationCanceledException();
      }
      paramIProgressMonitor.worked(2);
      preProcedure(paramILaunchConfiguration, paramILaunch, paramIProgressMonitor, str1);
      if (paramIProgressMonitor.isCanceled()) {
        throw new OperationCanceledException();
      }
      try
      {
        appName = str1;
        str2 = "launch_app " + getPackageName(paramILaunchConfiguration) + "." + getExecutableName(paramILaunchConfiguration) + " __LAUNCH_APP_MODE__ SYNC";
      }
      catch (CoreException localCoreException2)
      {
        newCoreException(localCoreException2.getMessage(), localCoreException2.getCause());
      }
      runApplication(paramILaunchConfiguration, paramILaunch, str2);
      if (paramIProgressMonitor.isCanceled()) {
        throw new OperationCanceledException();
      }
      postProcedure(paramILaunchConfiguration, paramILaunch, paramIProgressMonitor, str1);
      if (paramIProgressMonitor.isCanceled()) {
        throw new OperationCanceledException();
      }
    }
    catch (CoreException localCoreException1)
    {
      newCoreException(localCoreException1.getMessage(), localCoreException1.getCause());
    }
    catch (OperationCanceledException localOperationCanceledException)
    {
      Display.getDefault().syncExec(new Runnable()
      {
        public void run()
        {
          IWorkbenchWindow localIWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
          MessageBox localMessageBox = new MessageBox(localIWorkbenchWindow.getShell(), 40);
          localMessageBox.setMessage("Operation canceled by user.");
          localMessageBox.open();
        }
      });
    }
    catch (Exception localException)
    {
      newCoreException(TizenLaunchMessages.CANNOT_LAUNCH, localException);
    }
    finally
    {
      paramIProgressMonitor.done();
      ProfileLaunchPlugin.stopProfiling();
    }
    paramIProgressMonitor.done();
    ProfileLaunchPlugin.stopProfiling();
  }
  
  private void runApplication(ILaunchConfiguration paramILaunchConfiguration, ILaunch paramILaunch, String paramString)
    throws CoreException
  {
    String str = paramString;
    Process localProcess = CommandManager.runApplication(str);
    IPath localIPath = null;
    try
    {
      localIPath = CDebugUtils.verifyProgramPath(paramILaunchConfiguration);
      DebugPlugin.newProcess(paramILaunch, localProcess, localIPath.toFile().getName());
      BufferedReader localBufferedReader = new BufferedReader(new InputStreamReader(localProcess.getInputStream()));
      while (localBufferedReader.readLine() != null) {}
      localBufferedReader.close();
    }
    catch (CoreException localCoreException)
    {
      localCoreException.printStackTrace();
    }
    catch (IOException localIOException)
    {
      localIOException.printStackTrace();
    }
  }
  
  private void preProcedure(ILaunchConfiguration paramILaunchConfiguration, ILaunch paramILaunch, IProgressMonitor paramIProgressMonitor, String paramString)
    throws CoreException
  {
    LaunchOptions localLaunchOptions = new LaunchOptions();
    localLaunchOptions.loadConfiguration(paramILaunchConfiguration);
    localLaunchOptions.setBinaryImage("/usr/bin/launchpad_preloading_preinitializing_daemon");
    String str = null;
    OprofileDaemonEvent[] arrayOfOprofileDaemonEvent = (OprofileDaemonEvent[])null;
    Object localObject;
    if (!paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.oprofile.launch.oprofile.USE_DEFAULT_EVENT", false))
    {
      localObject = OprofileCounter.getCounters(paramILaunchConfiguration);
      ArrayList localArrayList = new ArrayList();
      for (int i = 0; i < localObject.length; i++) {
        if (localObject[i].getEnabled()) {
          localArrayList.add(localObject[i].getDaemonEvent());
        }
      }
      arrayOfOprofileDaemonEvent = new OprofileDaemonEvent[localArrayList.size()];
      localArrayList.toArray(arrayOfOprofileDaemonEvent);
    }
    else
    {
      localObject = paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.oprofile.launch.oprofile.SELECTED_DEFAULT_SETTING", "");
      str = DefaultSettingConstants.getSettingValue((String)localObject);
    }
    try
    {
      OprofileCorePlugin.getDefault().getOpcontrolProvider().shutdownDaemon();
      OprofileCorePlugin.getDefault().getOpcontrolProvider().reset();
      OprofileCorePlugin.getDefault().getOpcontrolProvider().setupDaemon(localLaunchOptions.getOprofileDaemonOptions(), arrayOfOprofileDaemonEvent, str);
      OprofileCorePlugin.getDefault().getOpcontrolProvider().startCollection();
    }
    catch (OpcontrolException localOpcontrolException)
    {
      OprofileCorePlugin.showErrorDialog("opcontrolProvider", localOpcontrolException);
      return;
    }
  }
  
  private void postProcedure(ILaunchConfiguration paramILaunchConfiguration, ILaunch paramILaunch, IProgressMonitor paramIProgressMonitor, String paramString)
    throws CoreException
  {
    String str = "oprofile killapp " + getExecutableName(paramILaunchConfiguration);
    CommandManager.runShell(str);
    OprofileCorePlugin.getDefault().getOpcontrolProvider().dumpSamples();
    OprofileCorePlugin.getDefault().getOpcontrolProvider().shutdownDaemon();
    Display.getDefault().syncExec(new Runnable()
    {
      public void run()
      {
        OprofileView localOprofileView = OprofileUiPlugin.getDefault().getOprofileView();
        if (localOprofileView != null)
        {
          localOprofileView.refreshView();
        }
        else
        {
          try
          {
            PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("org.eclipse.linuxtools.oprofile.ui.OProfileView");
          }
          catch (PartInitException localPartInitException)
          {
            localPartInitException.printStackTrace();
          }
          OprofileUiPlugin.getDefault().getOprofileView().refreshView();
        }
      }
    });
  }
  
  public static void checkProfilingTool(IProgressMonitor paramIProgressMonitor)
    throws CoreException
  {
    String str1 = "/usr/bin/opcontrol";
    String str2 = "ls " + str1 + "; echo cmd_ret:$?;";
    String[] arrayOfString = CommandManager.runCommandReturningResultArray(str2);
    if (!CommandManager.isRunSuccessfuly(arrayOfString))
    {
      Status localStatus = new Status(4, "org.tizen.nativecommon", TizenLaunchMessages.CANNOT_LAUNCH, new Exception("No oprofile in this target (" + TizenPlatformConstants.TOOLS_TARGET_PATH + "/oprofile/usr/bin/opcontrol)."));
      throw new CoreException(localStatus);
    }
  }
  
  class LaunchTerminationWatcher
    implements ILaunchesListener2
  {
    private ILaunch launch;
    
    public LaunchTerminationWatcher(ILaunch paramILaunch)
    {
      launch = paramILaunch;
    }
    
    public void launchesTerminated(ILaunch[] paramArrayOfILaunch)
    {
      try
      {
        ILaunch[] arrayOfILaunch;
        int j = (arrayOfILaunch = paramArrayOfILaunch).length;
        for (int i = 0; i < j; i++)
        {
          ILaunch localILaunch = arrayOfILaunch[i];
          if (localILaunch.equals(launch))
          {
            OprofileCorePlugin.getDefault().getOpcontrolProvider().dumpSamples();
            OprofileCorePlugin.getDefault().getOpcontrolProvider().shutdownDaemon();
            Display.getDefault().syncExec(new Runnable()
            {
              public void run()
              {
                OprofileView localOprofileView = OprofileUiPlugin.getDefault().getOprofileView();
                if (localOprofileView != null)
                {
                  localOprofileView.refreshView();
                }
                else
                {
                  try
                  {
                    PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("org.eclipse.linuxtools.oprofile.ui.OProfileView");
                  }
                  catch (PartInitException localPartInitException)
                  {
                    localPartInitException.printStackTrace();
                  }
                  OprofileUiPlugin.getDefault().getOprofileView().refreshView();
                }
              }
            });
          }
        }
      }
      catch (OpcontrolException localOpcontrolException)
      {
        OprofileCorePlugin.showErrorDialog("opcontrolProvider", localOpcontrolException);
      }
    }
    
    public void launchesAdded(ILaunch[] paramArrayOfILaunch) {}
    
    public void launchesChanged(ILaunch[] paramArrayOfILaunch) {}
    
    public void launchesRemoved(ILaunch[] paramArrayOfILaunch) {}
  }
}

/* Location:
 * Qualified Name:     org.tizen.oprofile.launch.TizenOprofileLaunchDelegate
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.oprofile.launch.configuration;

import java.util.ArrayList;
import java.util.Arrays;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
import org.eclipse.debug.ui.ILaunchConfigurationDialog;
import org.eclipse.debug.ui.ILaunchConfigurationTab;
import org.eclipse.linuxtools.oprofile.launch.configuration.OprofileEventConfigTab;
import org.eclipse.linuxtools.profiling.launch.ProfileConfigurationMainTab;
import org.eclipse.linuxtools.profiling.launch.ProfileLaunchConfigurationTabGroup;
import org.tizen.oprofile.launch.TizenOprofileLaunchDelegate;

public class NormalOprofileLaunchConfigurationTabGroup
  extends ProfileLaunchConfigurationTabGroup
{
  public void createTabs(ILaunchConfigurationDialog paramILaunchConfigurationDialog, String paramString)
  {
    ArrayList localArrayList = new ArrayList();
    localArrayList.add(new ProfileConfigurationMainTab());
    localArrayList.addAll(Arrays.asList(getProfileTabs()));
    setTabs((ILaunchConfigurationTab[])localArrayList.toArray(new AbstractLaunchConfigurationTab[localArrayList.size()]));
  }
  
  public AbstractLaunchConfigurationTab[] getProfileTabs()
  {
    try
    {
      NullProgressMonitor localNullProgressMonitor = new NullProgressMonitor();
      TizenOprofileLaunchDelegate.checkProfilingTool(localNullProgressMonitor);
    }
    catch (CoreException localCoreException)
    {
      localCoreException.printStackTrace();
    }
    return new AbstractLaunchConfigurationTab[] { new OprofileEventConfigTab() };
  }
}

/* Location:
 * Qualified Name:     org.tizen.oprofile.launch.configuration.NormalOprofileLaunchConfigurationTabGroup
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
1

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd