org.eclipse.linuxtools.valgrind.massif_1.3.18.201310312000

16:46:11.306 INFO  jd.cli.Main - Decompiling org.eclipse.linuxtools.valgrind.massif_1.3.18.201310312000.jar
package org.eclipse.linuxtools.valgrind.massif;

import java.util.ArrayList;
import java.util.List;

public class MassifHeapTreeNode
{
  protected MassifHeapTreeNode parent;
  protected String text;
  protected String filename;
  protected int line;
  protected List<MassifHeapTreeNode> children;
  
  public MassifHeapTreeNode(MassifHeapTreeNode paramMassifHeapTreeNode, String paramString)
  {
    parent = paramMassifHeapTreeNode;
    text = paramString;
    children = new ArrayList();
  }
  
  public void addChild(MassifHeapTreeNode paramMassifHeapTreeNode)
  {
    children.add(paramMassifHeapTreeNode);
  }
  
  public MassifHeapTreeNode getParent()
  {
    return parent;
  }
  
  public MassifHeapTreeNode[] getChildren()
  {
    return (MassifHeapTreeNode[])children.toArray(new MassifHeapTreeNode[children.size()]);
  }
  
  public String getText()
  {
    return text;
  }
  
  protected void setText(String paramString)
  {
    text = paramString;
  }
  
  public String getFilename()
  {
    return filename;
  }
  
  protected void setFilename(String paramString)
  {
    filename = paramString;
  }
  
  public int getLine()
  {
    return line;
  }
  
  protected void setLine(int paramInt)
  {
    line = paramInt;
  }
  
  public String toString()
  {
    return text;
  }
  
  public boolean hasSourceFile()
  {
    return filename != null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.valgrind.massif.MassifHeapTreeNode
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.valgrind.massif;

import java.io.File;
import java.io.FileFilter;

class MassifLaunchDelegate$1
  implements FileFilter
{
  public boolean accept(File paramFile)
  {
    return paramFile.getName().endsWith("xml");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.valgrind.massif.MassifLaunchDelegate.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.valgrind.massif;

import java.io.File;
import java.io.FileFilter;

class MassifLaunchDelegate$2
  implements FileFilter
{
  public boolean accept(File paramFile)
  {
    return paramFile.getName().startsWith("valgrind_");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.valgrind.massif.MassifLaunchDelegate.2
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.valgrind.massif;

import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
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.valgrind.core.ValgrindCommand;
import org.eclipse.linuxtools.valgrind.launch.CommandManager;
import org.eclipse.linuxtools.valgrind.launch.IValgrindLaunchDelegate;
import org.eclipse.linuxtools.valgrind.ui.IValgrindToolView;
import org.eclipse.linuxtools.valgrind.ui.ValgrindUIPlugin;
import org.eclipse.linuxtools.valgrind.ui.ValgrindViewPart;
import org.tizen.nativecommon.launch.TizenLaunchDelegate;

public class MassifLaunchDelegate
  extends TizenLaunchDelegate
  implements IValgrindLaunchDelegate
{
  protected static final String EMPTY_STRING = "";
  protected static final String NO = "no";
  protected static final String YES = "yes";
  protected static final String EQUALS = "=";
  protected static final String LOG_PREFIX = "valgrind_";
  protected static final String LOG_FILE = "valgrind_%p.xml";
  protected static final FileFilter LOG_FILTER = new FileFilter()
  {
    public boolean accept(File paramAnonymousFile)
    {
      return paramAnonymousFile.getName().endsWith("xml");
    }
  };
  protected static final String OUT_PREFIX = "valgrind_";
  protected static final FileFilter MASSIF_FILTER = new FileFilter()
  {
    public boolean accept(File paramAnonymousFile)
    {
      return paramAnonymousFile.getName().startsWith("valgrind_");
    }
  };
  public static final String OPT_MASSIF_OUTFILE = "--massif-out-file";
  public static final String OPT_HEAP = "--heap";
  public static final String OPT_HEAPADMIN = "--heap-admin";
  public static final String OPT_STACKS = "--stacks";
  public static final String OPT_DEPTH = "--depth";
  public static final String OPT_ALLOCFN = "--alloc-fn";
  public static final String OPT_THRESHOLD = "--threshold";
  public static final String OPT_PEAKINACCURACY = "--peak-inaccuracy";
  public static final String OPT_TIMEUNIT = "--time-unit";
  public static final String OPT_DETAILEDFREQ = "--detailed-freq";
  public static final String OPT_MAXSNAPSHOTS = "--max-snapshots";
  public static final String OPT_ALIGNMENT = "--alignment";
  protected MassifOutput output;
  
  public void launch(ValgrindCommand paramValgrindCommand, ILaunchConfiguration paramILaunchConfiguration, ILaunch paramILaunch, IProgressMonitor paramIProgressMonitor)
    throws Exception
  {
    MassifPlugin.getDefault().setConfig(paramILaunchConfiguration);
    MassifPlugin.getDefault().setSourceLocator(paramILaunch.getSourceLocator());
    try
    {
      String str1 = ValgrindUIPlugin.getDefault().getStateLocation().toOSString();
      String str2 = "/tmp/valgrind_result.xml";
      String str3 = str1 + File.separator + "valgrind_result.xml";
      File localFile = new File(str3);
      if (localFile.exists()) {
        localFile.delete();
      }
      CommandManager.pull(str2, str3);
      parseOutput(str3);
    }
    catch (IOException localIOException)
    {
      localIOException.printStackTrace();
      abort(Messages.getString("MassifLaunchDelegate.Error_parsing_output"), localIOException, 150);
    }
  }
  
  protected void parseOutput(String paramString)
    throws IOException
  {
    output = new MassifOutput();
    MassifParser localMassifParser = new MassifParser(paramString);
    output.putSnapshots(localMassifParser.getPid(), localMassifParser.getSnapshots());
    ValgrindViewPart localValgrindViewPart = ValgrindUIPlugin.getDefault().getView();
    IValgrindToolView localIValgrindToolView = localValgrindViewPart.getDynamicView();
    if ((localIValgrindToolView instanceof MassifViewPart))
    {
      ((MassifViewPart)localIValgrindToolView).setOutput(output);
      ((MassifViewPart)localIValgrindToolView).setPid(output.getPids()[0]);
    }
  }
  
  public String[] getCommandArray(ValgrindCommand paramValgrindCommand, ILaunchConfiguration paramILaunchConfiguration)
    throws CoreException
  {
    ArrayList localArrayList = new ArrayList();
    localArrayList.add("--massif-out-file=/tmp/valgrind_result.xml");
    localArrayList.add("--heap=" + (paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.valgrind.massif.MASSIF_HEAP", true) ? "yes" : "no"));
    localArrayList.add("--heap-admin=" + paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.valgrind.massif.MASSIF_HEAPADMIN", 8));
    localArrayList.add("--stacks=" + (paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.valgrind.massif.MASSIF_STACKS", false) ? "yes" : "no"));
    localArrayList.add("--depth=" + paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.valgrind.massif.MASSIF_DEPTH", 30));
    List localList = paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.valgrind.massif.MASSIF_ALLOCFN", Collections.EMPTY_LIST);
    Iterator localIterator = localList.iterator();
    while (localIterator.hasNext())
    {
      String str = (String)localIterator.next();
      localArrayList.add("--alloc-fn=" + str);
    }
    localArrayList.add("--threshold=" + paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.valgrind.massif.MASSIF_THRESHOLD", 10) / 10.0D);
    localArrayList.add("--peak-inaccuracy=" + paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.valgrind.massif.MASSIF_PEAKINACCURACY", 10) / 10.0D);
    localArrayList.add("--time-unit=" + paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.valgrind.massif.MASSIF_TIMEUNIT", "i"));
    localArrayList.add("--detailed-freq=" + paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.valgrind.massif.MASSIF_DETAILEDFREQ", 10));
    localArrayList.add("--max-snapshots=" + paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.valgrind.massif.MASSIF_MAXSNAPSHOTS", 100));
    localArrayList.add("--alignment=" + paramILaunchConfiguration.getAttribute("org.eclipse.linuxtools.valgrind.massif.MASSIF_ALIGNMENT", 8));
    return (String[])localArrayList.toArray(new String[localArrayList.size()]);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.valgrind.massif.MassifLaunchDelegate
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.valgrind.massif;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class MassifOutput
{
  protected Map<Integer, MassifSnapshot[]> pidMap = new HashMap();
  
  public void putSnapshots(Integer paramInteger, MassifSnapshot[] paramArrayOfMassifSnapshot)
  {
    pidMap.put(paramInteger, paramArrayOfMassifSnapshot);
  }
  
  public MassifSnapshot[] getSnapshots(Integer paramInteger)
  {
    return (MassifSnapshot[])pidMap.get(paramInteger);
  }
  
  public Integer[] getPids()
  {
    return (Integer[])pidMap.keySet().toArray(new Integer[pidMap.size()]);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.valgrind.massif.MassifOutput
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.valgrind.massif;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.ArrayList;
import org.eclipse.linuxtools.valgrind.core.AbstractValgrindTextParser;
import org.eclipse.osgi.util.NLS;

public class MassifParser
  extends AbstractValgrindTextParser
{
  private static final String CMD = "cmd";
  private static final String TIME_UNIT = "time_unit";
  private static final String SNAPSHOT = "snapshot";
  private static final String TIME = "time";
  private static final String MEM_HEAP_B = "mem_heap_B";
  private static final String MEM_HEAP_EXTRA_B = "mem_heap_extra_B";
  private static final String MEM_STACKS_B = "mem_stacks_B";
  private static final String HEAP_TREE = "heap_tree";
  private static final String INSTRUCTIONS = "i";
  private static final String MILLISECONDS = "ms";
  private static final String BYTES = "B";
  private static final String PEAK = "peak";
  private static final String DETAILED = "detailed";
  private static final String EMPTY = "empty";
  private static final String COLON = ":";
  private static final String SPACE = " ";
  private static final String EQUALS = "=";
  protected Integer pid;
  protected MassifSnapshot[] snapshots;
  
  public MassifParser(String paramString)
    throws IOException
  {
    ArrayList localArrayList = new ArrayList();
    BufferedReader localBufferedReader = new BufferedReader(new FileReader(paramString));
    Object localObject = null;
    String str2 = null;
    MassifSnapshot.TimeUnit localTimeUnit = null;
    int i = 0;
    String str3 = "000";
    if (isNumber(str3)) {
      pid = new Integer(str3);
    }
    String str1;
    while ((str1 = localBufferedReader.readLine()) != null) {
      if (str1.startsWith("cmd:"))
      {
        str2 = parseStrValue(str1, ": ");
      }
      else if (str1.startsWith("time_unit:"))
      {
        localTimeUnit = parseTimeUnit(str1);
      }
      else if (str1.startsWith("snapshot"))
      {
        if (localObject != null)
        {
          localArrayList.add(localObject);
          i++;
        }
        localObject = new MassifSnapshot(i);
        ((MassifSnapshot)localObject).setCmd(str2);
        ((MassifSnapshot)localObject).setUnit(localTimeUnit);
      }
      else if (str1.startsWith("time="))
      {
        ((MassifSnapshot)localObject).setTime(parseLongValue(str1, "=").longValue());
      }
      else if (str1.startsWith("mem_heap_B="))
      {
        ((MassifSnapshot)localObject).setHeapBytes(parseLongValue(str1, "=").longValue());
      }
      else if (str1.startsWith("mem_heap_extra_B="))
      {
        ((MassifSnapshot)localObject).setHeapExtra(parseLongValue(str1, "=").longValue());
      }
      else if (str1.startsWith("mem_stacks_B="))
      {
        ((MassifSnapshot)localObject).setStacks(parseLongValue(str1, "=").longValue());
      }
      else if (str1.startsWith("heap_tree="))
      {
        MassifSnapshot.SnapshotType localSnapshotType = parseSnapshotType(str1);
        ((MassifSnapshot)localObject).setType(localSnapshotType);
        if ((localSnapshotType.equals(MassifSnapshot.SnapshotType.DETAILED)) || (localSnapshotType.equals(MassifSnapshot.SnapshotType.PEAK)))
        {
          MassifHeapTreeNode localMassifHeapTreeNode = parseTree((MassifSnapshot)localObject, null, localBufferedReader);
          localMassifHeapTreeNode.setText(NLS.bind(Messages.getString("MassifParser.Snapshot_n"), Integer.valueOf(i), localMassifHeapTreeNode.getText()));
          ((MassifSnapshot)localObject).setRoot(localMassifHeapTreeNode);
        }
      }
    }
    if (localObject != null) {
      localArrayList.add(localObject);
    }
    snapshots = ((MassifSnapshot[])localArrayList.toArray(new MassifSnapshot[localArrayList.size()]));
  }
  
  private MassifHeapTreeNode parseTree(MassifSnapshot paramMassifSnapshot, MassifHeapTreeNode paramMassifHeapTreeNode, BufferedReader paramBufferedReader)
    throws IOException
  {
    String str = paramBufferedReader.readLine();
    if (str == null) {
      throw new IOException(Messages.getString("MassifParser.Unexpected_EOF"));
    }
    str = str.trim();
    String[] arrayOfString = str.split(" ");
    Integer localInteger = parseNumChildren(arrayOfString[0]);
    if (localInteger == null) {
      fail(str);
    }
    StringBuffer localStringBuffer = new StringBuffer();
    Long localLong = parseNumBytes(arrayOfString[1]);
    if (localLong == null) {
      fail(str);
    }
    double d;
    if (localLong.intValue() == 0) {
      d = 0.0D;
    } else {
      d = localLong.doubleValue() / paramMassifSnapshot.getTotal() * 100.0D;
    }
    DecimalFormatSymbols localDecimalFormatSymbols = new DecimalFormatSymbols();
    localDecimalFormatSymbols.setDecimalSeparator('.');
    localStringBuffer.append(Double.valueOf(new DecimalFormat("##.##", localDecimalFormatSymbols).format(d)) + "%");
    localStringBuffer.append(" (");
    localStringBuffer.append(new DecimalFormat("#,##0").format(localLong.longValue()) + "B");
    localStringBuffer.append(")");
    for (int i = 2; i < arrayOfString.length; i++)
    {
      localStringBuffer.append(" ");
      localStringBuffer.append(arrayOfString[i]);
    }
    MassifHeapTreeNode localMassifHeapTreeNode = new MassifHeapTreeNode(paramMassifHeapTreeNode, localStringBuffer.toString());
    parseSourceFile(localMassifHeapTreeNode, str);
    for (int j = 0; j < localInteger.intValue(); j++) {
      localMassifHeapTreeNode.addChild(parseTree(paramMassifSnapshot, localMassifHeapTreeNode, paramBufferedReader));
    }
    return localMassifHeapTreeNode;
  }
  
  private void parseSourceFile(MassifHeapTreeNode paramMassifHeapTreeNode, String paramString)
  {
    int i = paramString.indexOf("(");
    if (i >= 0)
    {
      String str1 = paramString.substring(i, paramString.length());
      str1 = str1.substring(1, str1.length() - 1);
      if (((i = str1.lastIndexOf(":")) >= 0) && (i < str1.length()))
      {
        String str2 = str1.substring(i + 1);
        if (isNumber(str2))
        {
          int j = Integer.parseInt(str2);
          String str3 = str1.substring(0, i);
          paramMassifHeapTreeNode.setFilename(str3);
          paramMassifHeapTreeNode.setLine(j);
        }
      }
    }
  }
  
  private Long parseNumBytes(String paramString)
  {
    Long localLong = null;
    if (isNumber(paramString)) {
      localLong = Long.valueOf(Long.parseLong(paramString));
    }
    return localLong;
  }
  
  private Integer parseNumChildren(String paramString)
  {
    Integer localInteger = null;
    if (paramString.length() >= 3)
    {
      String str = paramString.substring(1, paramString.length() - 1);
      if (isNumber(str)) {
        localInteger = Integer.valueOf(Integer.parseInt(str));
      }
    }
    return localInteger;
  }
  
  public Integer getPid()
  {
    return pid;
  }
  
  public MassifSnapshot[] getSnapshots()
  {
    return snapshots;
  }
  
  protected MassifSnapshot.SnapshotType parseSnapshotType(String paramString)
    throws IOException
  {
    MassifSnapshot.SnapshotType localSnapshotType = null;
    String[] arrayOfString = paramString.split("=");
    if (arrayOfString.length > 1)
    {
      String str = arrayOfString[1];
      if (str.equals("empty")) {
        localSnapshotType = MassifSnapshot.SnapshotType.EMPTY;
      } else if (str.equals("detailed")) {
        localSnapshotType = MassifSnapshot.SnapshotType.DETAILED;
      } else if (str.equals("peak")) {
        localSnapshotType = MassifSnapshot.SnapshotType.PEAK;
      }
    }
    if (localSnapshotType == null) {
      fail(paramString);
    }
    return localSnapshotType;
  }
  
  protected MassifSnapshot.TimeUnit parseTimeUnit(String paramString)
    throws IOException
  {
    MassifSnapshot.TimeUnit localTimeUnit = null;
    String[] arrayOfString = paramString.split(": ");
    if (arrayOfString.length > 1)
    {
      String str = arrayOfString[1];
      if (str.equals("i")) {
        localTimeUnit = MassifSnapshot.TimeUnit.INSTRUCTIONS;
      } else if (str.equals("ms")) {
        localTimeUnit = MassifSnapshot.TimeUnit.MILLISECONDS;
      } else if (str.equals("B")) {
        localTimeUnit = MassifSnapshot.TimeUnit.BYTES;
      }
    }
    if (localTimeUnit == null) {
      fail(paramString);
    }
    return localTimeUnit;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.valgrind.massif.MassifParser
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.valgrind.massif;

import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;

class MassifPidMenuAction$1$1
  implements Runnable
{
  MassifPidMenuAction$1$1(MassifPidMenuAction.1 param1) {}
  
  public void run()
  {
    access$0this$1).view.refreshView();
    MenuItem[] arrayOfMenuItem = access$0this$1).menu.getItems();
    for (int i = 0; i < arrayOfMenuItem.length; i++) {
      arrayOfMenuItem[i].setSelection(false);
    }
    this$1.setChecked(true);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.valgrind.massif.MassifPidMenuAction.1.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.valgrind.massif;

import org.eclipse.jface.action.Action;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;

class MassifPidMenuAction$1
  extends Action
{
  MassifPidMenuAction$1(MassifPidMenuAction paramMassifPidMenuAction, String paramString, int paramInt, Integer paramInteger)
  {
    super(paramString, paramInt);
  }
  
  public void run()
  {
    this$0.view.setPid(val$pid);
    Display.getDefault().syncExec(new Runnable()
    {
      public void run()
      {
        this$0.view.refreshView();
        MenuItem[] arrayOfMenuItem = this$0.menu.getItems();
        for (int i = 0; i < arrayOfMenuItem.length; i++) {
          arrayOfMenuItem[i].setSelection(false);
        }
        setChecked(true);
      }
    });
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.valgrind.massif.MassifPidMenuAction.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.valgrind.massif;

import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IMenuCreator;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;

public class MassifPidMenuAction
  extends Action
  implements IMenuCreator
{
  protected Menu menu;
  protected MassifViewPart view;
  protected Integer[] pids;
  
  public MassifPidMenuAction(MassifViewPart paramMassifViewPart)
  {
    super(Messages.getString("MassifPidMenuAction.Select_Process_ID"), 4);
    view = paramMassifViewPart;
    setToolTipText(Messages.getString("MassifPidMenuAction.Select_Process_ID"));
    setImageDescriptor(DebugUITools.getImageDescriptor("IMG_OBJS_THREAD_RUNNING"));
    setMenuCreator(this);
  }
  
  public void dispose()
  {
    if (menu != null) {
      menu.dispose();
    }
  }
  
  public Menu getMenu(Control paramControl)
  {
    if ((menu == null) && (pids != null))
    {
      menu = new Menu(paramControl);
      for (int i = 0; i < pids.length; i++)
      {
        final Integer localInteger = pids[i];
        ActionContributionItem localActionContributionItem = new ActionContributionItem(new Action("PID " + String.valueOf(pids[i]), 8)
        {
          public void run()
          {
            view.setPid(localInteger);
            Display.getDefault().syncExec(new Runnable()
            {
              public void run()
              {
                view.refreshView();
                MenuItem[] arrayOfMenuItem = menu.getItems();
                for (int i = 0; i < arrayOfMenuItem.length; i++) {
                  arrayOfMenuItem[i].setSelection(false);
                }
                setChecked(true);
              }
            });
          }
        });
        localActionContributionItem.fill(menu, -1);
      }
      menu.getItem(0).setSelection(true);
    }
    return menu;
  }
  
  public Menu getMenu(Menu paramMenu)
  {
    return null;
  }
  
  public void setPids(Integer[] paramArrayOfInteger)
  {
    pids = paramArrayOfInteger;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.valgrind.massif.MassifPidMenuAction
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.valgrind.massif;

import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.model.ISourceLocator;
import org.eclipse.swt.graphics.FontMetrics;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

public class MassifPlugin
  extends AbstractUIPlugin
{
  public static final String PLUGIN_ID = "org.eclipse.linuxtools.valgrind.massif";
  public static final String EDITOR_ID = "org.eclipse.linuxtools.valgrind.massif.chartEditor";
  private static MassifPlugin plugin;
  protected ILaunchConfiguration config;
  protected ISourceLocator locator;
  public static final String TOOL_ID = "org.eclipse.linuxtools.valgrind.launch.massif";
  
  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 FontMetrics getFontMetrics(Control paramControl)
  {
    GC localGC = new GC(paramControl);
    localGC.setFont(paramControl.getFont());
    FontMetrics localFontMetrics = localGC.getFontMetrics();
    localGC.dispose();
    return localFontMetrics;
  }
  
  public ISourceLocator getSourceLocator()
  {
    return locator;
  }
  
  protected void setSourceLocator(ISourceLocator paramISourceLocator)
  {
    locator = paramISourceLocator;
  }
  
  public ILaunchConfiguration getConfig()
  {
    return config;
  }
  
  public void setConfig(ILaunchConfiguration paramILaunchConfiguration)
  {
    config = paramILaunchConfiguration;
  }
  
  public static MassifPlugin getDefault()
  {
    return plugin;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.valgrind.massif.MassifPlugin
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.valgrind.massif;

public enum MassifSnapshot$SnapshotType
{
  EMPTY,  DETAILED,  PEAK;
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.valgrind.massif.MassifSnapshot.SnapshotType
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.valgrind.massif;

public enum MassifSnapshot$TimeUnit
{
  INSTRUCTIONS,  MILLISECONDS,  BYTES;
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.valgrind.massif.MassifSnapshot.TimeUnit
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.valgrind.massif;

public class MassifSnapshot
{
  protected long number;
  protected long time;
  protected long heapBytes;
  protected long heapExtra;
  protected long stacks;
  protected String cmd;
  protected TimeUnit unit;
  protected SnapshotType type;
  protected MassifHeapTreeNode root;
  
  public MassifSnapshot(int paramInt)
  {
    number = paramInt;
  }
  
  public long getNumber()
  {
    return number;
  }
  
  public long getHeapBytes()
  {
    return heapBytes;
  }
  
  public long getHeapExtra()
  {
    return heapExtra;
  }
  
  public long getStacks()
  {
    return stacks;
  }
  
  public long getTime()
  {
    return time;
  }
  
  public long getTotal()
  {
    return heapBytes + heapExtra + stacks;
  }
  
  public SnapshotType getType()
  {
    return type;
  }
  
  public String getCmd()
  {
    return cmd;
  }
  
  public TimeUnit getUnit()
  {
    return unit;
  }
  
  public MassifHeapTreeNode getRoot()
  {
    return root;
  }
  
  public boolean isDetailed()
  {
    return !type.equals(SnapshotType.EMPTY);
  }
  
  protected void setTime(long paramLong)
  {
    time = paramLong;
  }
  
  protected void setHeapBytes(long paramLong)
  {
    heapBytes = paramLong;
  }
  
  protected void setHeapExtra(long paramLong)
  {
    heapExtra = paramLong;
  }
  
  protected void setStacks(long paramLong)
  {
    stacks = paramLong;
  }
  
  protected void setType(SnapshotType paramSnapshotType)
  {
    type = paramSnapshotType;
  }
  
  protected void setCmd(String paramString)
  {
    cmd = paramString;
  }
  
  protected void setUnit(TimeUnit paramTimeUnit)
  {
    unit = paramTimeUnit;
  }
  
  protected void setRoot(MassifHeapTreeNode paramMassifHeapTreeNode)
  {
    root = paramMassifHeapTreeNode;
  }
  
  public static enum SnapshotType
  {
    EMPTY,  DETAILED,  PEAK;
  }
  
  public static enum TimeUnit
  {
    INSTRUCTIONS,  MILLISECONDS,  BYTES;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.valgrind.massif.MassifSnapshot
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.valgrind.massif;

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;

class MassifToolPage$1
  extends SelectionAdapter
{
  MassifToolPage$1(MassifToolPage paramMassifToolPage) {}
  
  public void widgetSelected(SelectionEvent paramSelectionEvent)
  {
    this$0.updateLaunchConfigurationDialog();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.valgrind.massif.MassifToolPage.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.valgrind.massif;

import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;

class MassifToolPage$2
  implements ModifyListener
{
  MassifToolPage$2(MassifToolPage paramMassifToolPage) {}
  
  public void modifyText(ModifyEvent paramModifyEvent)
  {
    this$0.updateLaunchConfigurationDialog();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.valgrind.massif.MassifToolPage.2
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.valgrind.massif;

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;

class MassifToolPage$3
  extends SelectionAdapter
{
  MassifToolPage$3(MassifToolPage paramMassifToolPage) {}
  
  public void widgetSelected(SelectionEvent paramSelectionEvent)
  {
    this$0.handleNewButtonPressed();
    this$0.updateLaunchConfigurationDialog();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.valgrind.massif.MassifToolPage.3
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.valgrind.massif;

import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;

class MassifToolPage$4
  extends SelectionAdapter
{
  MassifToolPage$4(MassifToolPage paramMassifToolPage) {}
  
  public void widgetSelected(SelectionEvent paramSelectionEvent)
  {
    this$0.handleRemoveButtonPressed();
    this$0.updateLaunchConfigurationDialog();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.valgrind.massif.MassifToolPage.4
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.linuxtools.valgrind.massif;

import java.util.Arrays;
import java.util.Collections;
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.linuxtools.valgrind.launch.IValgrindToolPage;
import org.eclipse.swt.custom.ScrolledComposite;
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.Spinner;

public class MassifToolPage
  extends AbstractLaunchConfigurationTab
  implements IValgrindToolPage
{
  public static final String MASSIF = "massif";
  public static final String PLUGIN_ID = "org.eclipse.linuxtools.valgrind.massif";
  public static final String TIME_I = "i";
  public static final String TIME_MS = "ms";
  public static final String TIME_B = "B";
  protected Button heapButton;
  protected Spinner heapAdminSpinner;
  protected Button stacksButton;
  protected Spinner depthSpinner;
  protected org.eclipse.swt.widgets.List allocFnList;
  protected Spinner thresholdSpinner;
  protected Spinner peakInaccuracySpinner;
  protected Combo timeUnitCombo;
  protected Spinner detailedFreqSpinner;
  protected Spinner maxSnapshotsSpinner;
  protected PowerOfTwoSpinner alignmentSpinner;
  protected Button removeButton;
  public static final String ATTR_MASSIF_OUTFILE = "org.eclipse.linuxtools.valgrind.massif.MASSIF_OUTFILE";
  public static final String ATTR_MASSIF_HEAP = "org.eclipse.linuxtools.valgrind.massif.MASSIF_HEAP";
  public static final String ATTR_MASSIF_HEAPADMIN = "org.eclipse.linuxtools.valgrind.massif.MASSIF_HEAPADMIN";
  public static final String ATTR_MASSIF_STACKS = "org.eclipse.linuxtools.valgrind.massif.MASSIF_STACKS";
  public static final String ATTR_MASSIF_DEPTH = "org.eclipse.linuxtools.valgrind.massif.MASSIF_DEPTH";
  public static final String ATTR_MASSIF_ALLOCFN = "org.eclipse.linuxtools.valgrind.massif.MASSIF_ALLOCFN";
  public static final String ATTR_MASSIF_THRESHOLD = "org.eclipse.linuxtools.valgrind.massif.MASSIF_THRESHOLD";
  public static final String ATTR_MASSIF_PEAKINACCURACY = "org.eclipse.linuxtools.valgrind.massif.MASSIF_PEAKINACCURACY";
  public static final String ATTR_MASSIF_TIMEUNIT = "org.eclipse.linuxtools.valgrind.massif.MASSIF_TIMEUNIT";
  public static final String ATTR_MASSIF_DETAILEDFREQ = "org.eclipse.linuxtools.valgrind.massif.MASSIF_DETAILEDFREQ";
  public static final String ATTR_MASSIF_MAXSNAPSHOTS = "org.eclipse.linuxtools.valgrind.massif.MASSIF_MAXSNAPSHOTS";
  public static final String ATTR_MASSIF_ALIGNMENT = "org.eclipse.linuxtools.valgrind.massif.MASSIF_ALIGNMENT";
  protected boolean isInitializing = false;
  protected SelectionListener selectListener = new SelectionAdapter()
  {
    public void widgetSelected(SelectionEvent paramAnonymousSelectionEvent)
    {
      updateLaunchConfigurationDialog();
    }
  };
  protected ModifyListener modifyListener = new ModifyListener()
  {
    public void modifyText(ModifyEvent paramAnonymousModifyEvent)
    {
      updateLaunchConfigurationDialog();
    }
  };
  
  public void createControl(Composite paramComposite)
  {
    ScrolledComposite localScrolledComposite = new ScrolledComposite(paramComposite, 768);
    localScrolledComposite.setLayoutData(new GridData(1808));
    localScrolledComposite.setExpandHorizontal(true);
    localScrolledComposite.setExpandVertical(true);
    Composite localComposite1 = new Composite(localScrolledComposite, 0);
    GridLayout localGridLayout = new GridLayout(2, true);
    horizontalSpacing = 10;
    localComposite1.setLayout(localGridLayout);
    localComposite1.setLayoutData(new GridData(1808));
    Composite localComposite2 = new Composite(localComposite1, 0);
    localComposite2.setLayout(new GridLayout(2, false));
    heapButton = new Button(localComposite2, 32);
    heapButton.setText(Messages.getString("MassifToolPage.profile_heap"));
    heapButton.addSelectionListener(selectListener);
    Composite localComposite3 = new Composite(localComposite1, 0);
    localComposite3.setLayout(new GridLayout(2, false));
    Label localLabel1 = new Label(localComposite3, 0);
    localLabel1.setText(Messages.getString("MassifToolPage.administrative_bytes"));
    heapAdminSpinner = new Spinner(localComposite3, 2048);
    heapAdminSpinner.addModifyListener(modifyListener);
    Composite localComposite4 = new Composite(localComposite1, 0);
    localComposite4.setLayout(new GridLayout(2, false));
    stacksButton = new Button(localComposite4, 32);
    stacksButton.setText(Messages.getString("MassifToolPage.profile_stack"));
    stacksButton.addSelectionListener(selectListener);
    Composite localComposite5 = new Composite(localComposite1, 0);
    localComposite5.setLayout(new GridLayout(2, false));
    Label localLabel2 = new Label(localComposite5, 0);
    localLabel2.setText(Messages.getString("MassifToolPage.allocation_tree_depth"));
    depthSpinner = new Spinner(localComposite5, 2048);
    depthSpinner.addModifyListener(modifyListener);
    Composite localComposite6 = new Composite(localComposite1, 0);
    localComposite6.setLayout(new GridLayout(3, false));
    Label localLabel3 = new Label(localComposite6, 0);
    localLabel3.setText(Messages.getString("MassifToolPage.heap_allocation_threshold"));
    thresholdSpinner = new Spinner(localComposite6, 2048);
    thresholdSpinner.setDigits(1);
    thresholdSpinner.setMaximum(1000);
    thresholdSpinner.addModifyListener(modifyListener);
    Label localLabel4 = new Label(localComposite6, 0);
    localLabel4.setText("%");
    Composite localComposite7 = new Composite(localComposite1, 0);
    localComposite7.setLayout(new GridLayout(3, false));
    Label localLabel5 = new Label(localComposite7, 0);
    localLabel5.setText(Messages.getString("MassifToolPage.allocation_peak_inaccuracy"));
    peakInaccuracySpinner = new Spinner(localComposite7, 2048);
    peakInaccuracySpinner.setDigits(1);
    peakInaccuracySpinner.setMaximum(1000);
    peakInaccuracySpinner.addModifyListener(modifyListener);
    Label localLabel6 = new Label(localComposite7, 0);
    localLabel6.setText("%");
    Composite localComposite8 = new Composite(localComposite1, 0);
    localComposite8.setLayout(new GridLayout(2, false));
    Label localLabel7 = new Label(localComposite8, 0);
    localLabel7.setText(Messages.getString("MassifToolPage.time_unit"));
    timeUnitCombo = new Combo(localComposite8, 8);
    String[] arrayOfString = { Messages.getString("MassifToolPage.instructions"), Messages.getString("MassifToolPage.milliseconds"), Messages.getString("MassifToolPage.bytes") };
    timeUnitCombo.setItems(arrayOfString);
    timeUnitCombo.addSelectionListener(selectListener);
    Composite localComposite9 = new Composite(localComposite1, 0);
    localComposite9.setLayout(new GridLayout(2, false));
    Label localLabel8 = new Label(localComposite9, 0);
    localLabel8.setText(Messages.getString("MassifToolPage.detailed_snapshot_freq"));
    detailedFreqSpinner = new Spinner(localComposite9, 2048);
    detailedFreqSpinner.setMaximum(Integer.MAX_VALUE);
    detailedFreqSpinner.addModifyListener(modifyListener);
    Composite localComposite10 = new Composite(localComposite1, 0);
    localComposite10.setLayout(new GridLayout(2, false));
    Label localLabel9 = new Label(localComposite10, 0);
    localLabel9.setText(Messages.getString("MassifToolPage.max_snapshots"));
    maxSnapshotsSpinner = new Spinner(localComposite10, 2048);
    maxSnapshotsSpinner.setMaximum(Integer.MAX_VALUE);
    maxSnapshotsSpinner.addModifyListener(modifyListener);
    Composite localComposite11 = new Composite(localComposite1, 0);
    localComposite11.setLayout(new GridLayout(2, false));
    Label localLabel10 = new Label(localComposite11, 0);
    localLabel10.setText(Messages.getString("MassifToolPage.minimum_heap_block"));
    alignmentSpinner = new PowerOfTwoSpinner(localComposite11, 2048);
    alignmentSpinner.setMinimum(8);
    alignmentSpinner.setMaximum(4096);
    alignmentSpinner.addModifyListener(modifyListener);
    Composite localComposite12 = new Composite(localComposite1, 0);
    localComposite12.setLayout(new GridLayout(3, false));
    localComposite12.setLayoutData(new GridData(1, 1, false, false, 2, 1));
    Label localLabel11 = new Label(localComposite12, 0);
    localLabel11.setText(Messages.getString("MassifToolPage.allocation_functions"));
    localLabel11.setLayoutData(new GridData(1, 1, false, false));
    createAllocFnControls(localComposite12);
    localScrolledComposite.setContent(localComposite1);
    localScrolledComposite.setMinSize(localComposite1.computeSize(-1, -1));
  }
  
  private void createAllocFnControls(Composite paramComposite)
  {
    allocFnList = new org.eclipse.swt.widgets.List(paramComposite, 2818);
    FontMetrics localFontMetrics = MassifPlugin.getFontMetrics(allocFnList);
    allocFnList.setLayoutData(new GridData(Dialog.convertWidthInCharsToPixels(localFontMetrics, 50), Dialog.convertHeightInCharsToPixels(localFontMetrics, 5)));
    Composite localComposite = new Composite(paramComposite, 0);
    GridLayout localGridLayout = new GridLayout();
    marginWidth = (marginHeight = 0);
    localComposite.setLayout(localGridLayout);
    localComposite.setLayoutData(new GridData(1, 1, false, false));
    Button localButton = new Button(localComposite, 8);
    localButton.setText(Messages.getString("MassifToolPage.New"));
    localButton.setLayoutData(new GridData(768));
    localButton.addSelectionListener(new SelectionAdapter()
    {
      public void widgetSelected(SelectionEvent paramAnonymousSelectionEvent)
      {
        handleNewButtonPressed();
        updateLaunchConfigurationDialog();
      }
    });
    removeButton = new Button(localComposite, 8);
    removeButton.setText(Messages.getString("MassifToolPage.Remove"));
    removeButton.setLayoutData(new GridData(768));
    removeButton.addSelectionListener(new SelectionAdapter()
    {
      public void widgetSelected(SelectionEvent paramAnonymousSelectionEvent)
      {
        handleRemoveButtonPressed();
        updateLaunchConfigurationDialog();
      }
    });
    removeButton.setEnabled(fals
1 2 3 4

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