org.eclipse.linuxtools.valgrind.core_1.3.18.201310312000

16:46:09.919 INFO  jd.cli.Main - Decompiling org.eclipse.linuxtools.valgrind.core_1.3.18.201310312000.jar
package org.eclipse.linuxtools.valgrind.core;

import java.io.IOException;
import org.eclipse.osgi.util.NLS;

public class AbstractValgrindTextParser
{
  protected Long parseLongValue(String paramString1, String paramString2)
    throws IOException
  {
    Long localLong = null;
    String[] arrayOfString = paramString1.split(paramString2);
    if ((arrayOfString.length > 1) && (isNumber(arrayOfString[1]))) {
      localLong = Long.valueOf(Long.parseLong(arrayOfString[1]));
    } else {
      fail(paramString1);
    }
    return localLong;
  }
  
  protected String parseStrValue(String paramString1, String paramString2)
    throws IOException
  {
    String str = null;
    String[] arrayOfString = paramString1.split(paramString2);
    if (arrayOfString.length > 1) {
      str = arrayOfString[1];
    } else {
      fail(paramString1);
    }
    return str;
  }
  
  protected void fail(String paramString)
    throws IOException
  {
    throw new IOException(NLS.bind(Messages.getString("AbstractValgrindTextParser.Parsing_output_failed"), paramString));
  }
  
  protected boolean isNumber(String paramString)
  {
    boolean bool = true;
    char[] arrayOfChar = paramString.toCharArray();
    for (int i = 0; i < arrayOfChar.length; i++) {
      if (!Character.isDigit(arrayOfChar[i])) {
        bool = false;
      }
    }
    return bool;
  }
}

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

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;

public class ConsoleWriterThread
  extends Thread
{
  InputStreamReader in;
  OutputStream out;
  
  public ConsoleWriterThread(InputStream paramInputStream, OutputStream paramOutputStream)
  {
    out = paramOutputStream;
    in = new InputStreamReader(paramInputStream);
  }
  
  public void run()
  {
    try
    {
      int i;
      while ((i = in.read()) != -1) {
        out.write(i);
      }
    }
    catch (IOException localIOException)
    {
      localIOException.printStackTrace();
    }
  }
}

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

import java.util.MissingResourceException;
import java.util.ResourceBundle;

public class Messages
{
  private static final String BUNDLE_NAME = "org.eclipse.linuxtools.valgrind.core.messages";
  private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle("org.eclipse.linuxtools.valgrind.core.messages");
  
  public static String getString(String paramString)
  {
    try
    {
      return RESOURCE_BUNDLE.getString(paramString);
    }
    catch (MissingResourceException localMissingResourceException) {}
    return '!' + paramString + '!';
  }
}

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

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import org.eclipse.osgi.util.NLS;

public class StreamReaderThread
  extends Thread
{
  StringBuffer out;
  InputStreamReader in;
  
  public StreamReaderThread(InputStream paramInputStream, StringBuffer paramStringBuffer)
  {
    out = paramStringBuffer;
    in = new InputStreamReader(paramInputStream);
  }
  
  public void run()
  {
    try
    {
      int i;
      while ((i = in.read()) != -1) {
        out.append((char)i);
      }
    }
    catch (IOException localIOException)
    {
      out.append("\n" + NLS.bind(Messages.getString("StreamReaderThread.Read_error"), localIOException.getMessage()));
    }
  }
}

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

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import org.eclipse.cdt.utils.pty.PTY;
import org.eclipse.cdt.utils.spawner.ProcessFactory;
import org.eclipse.osgi.util.NLS;

public class ValgrindCommand
{
  protected static final String WHICH_CMD = "which";
  protected static final String VALGRIND_CMD = "valgrind";
  public static final String OPT_TOOL = "--tool";
  public static final String OPT_XML = "--xml";
  public static final String OPT_LOGFILE = "--log-file";
  public static final String OPT_XMLFILE = "--xml-file";
  public static final String OPT_TRACECHILD = "--trace-children";
  public static final String OPT_CHILDSILENT = "--child-silent-after-fork";
  public static final String OPT_TRACKFDS = "--track-fds";
  public static final String OPT_TIMESTAMP = "--time-stamp";
  public static final String OPT_FREERES = "--run-libc-freeres";
  public static final String OPT_DEMANGLE = "--demangle";
  public static final String OPT_NUMCALLERS = "--num-callers";
  public static final String OPT_ERRLIMIT = "--error-limit";
  public static final String OPT_BELOWMAIN = "--show-below-main";
  public static final String OPT_MAXFRAME = "--max-stackframe";
  public static final String OPT_SUPPFILE = "--suppressions";
  public static final String OPROFILE_SCRIPT = "oprofile";
  protected File datadir;
  protected Process process;
  protected String[] args;
  
  public ValgrindCommand(File paramFile)
    throws IOException
  {
    datadir = paramFile;
  }
  
  public static String whichValgrind()
    throws IOException
  {
    StringBuffer localStringBuffer = new StringBuffer();
    Process localProcess = Runtime.getRuntime().exec("which valgrind");
    try
    {
      int i;
      InputStream localInputStream;
      if ((i = localProcess.waitFor() == 0 ? 1 : 0) != 0) {
        localInputStream = localProcess.getInputStream();
      } else {
        localInputStream = localProcess.getErrorStream();
      }
      int j;
      while ((j = localInputStream.read()) != -1) {
        localStringBuffer.append((char)j);
      }
      if (i == 0) {
        throw new IOException(localStringBuffer.toString());
      }
    }
    catch (InterruptedException localInterruptedException)
    {
      localInterruptedException.printStackTrace();
    }
    return localStringBuffer.toString().trim();
  }
  
  public void execute(String[] paramArrayOfString1, String[] paramArrayOfString2, File paramFile, boolean paramBoolean)
    throws IOException
  {
    args = paramArrayOfString1;
    try
    {
      createDatadir();
      if (paramFile == null) {
        process = ProcessFactory.getFactory().exec(paramArrayOfString1, paramArrayOfString2);
      } else if ((PTY.isSupported()) && (paramBoolean)) {
        process = ProcessFactory.getFactory().exec(paramArrayOfString1, paramArrayOfString2, paramFile, new PTY());
      } else {
        process = ProcessFactory.getFactory().exec(paramArrayOfString1, paramArrayOfString2, paramFile);
      }
    }
    catch (IOException localIOException)
    {
      if (process != null) {
        process.destroy();
      }
      throw localIOException;
    }
  }
  
  public File getDatadir()
  {
    return datadir;
  }
  
  protected void createDatadir()
    throws IOException
  {
    if (datadir.exists()) {
      deleteFiles();
    } else if (!datadir.mkdir()) {
      throw new IOException(NLS.bind(Messages.getString("ValgrindCommand.Couldnt_create"), datadir.getAbsolutePath()));
    }
  }
  
  protected void deleteFiles()
    throws IOException
  {
    File[] arrayOfFile;
    int j = (arrayOfFile = datadir.listFiles()).length;
    for (int i = 0; i < j; i++)
    {
      File localFile = arrayOfFile[i];
      if (!localFile.delete()) {
        throw new IOException(NLS.bind(Messages.getString("ValgrindCommand.Couldnt_delete"), localFile.getCanonicalPath()));
      }
    }
  }
  
  public Process getProcess()
  {
    return process;
  }
  
  public String getCommandLine()
  {
    StringBuffer localStringBuffer = new StringBuffer();
    String[] arrayOfString;
    int j = (arrayOfString = args).length;
    for (int i = 0; i < j; i++)
    {
      String str = arrayOfString[i];
      localStringBuffer.append(str + " ");
    }
    return localStringBuffer.toString().trim();
  }
}

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

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

public class ValgrindPlugin
  extends Plugin
{
  public static final String PLUGIN_ID = "org.eclipse.linuxtools.valgrind.core";
  private static ValgrindPlugin 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 ValgrindPlugin getDefault()
  {
    return plugin;
  }
}

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

public final class LaunchConfigurationConstants
{
  private static final String PLUGIN_ID = "org.eclipse.linuxtools.valgrind.launch";
  public static final String ATTR_TOOL = "org.eclipse.linuxtools.valgrind.launch.TOOL";
  public static final String ATTR_GENERAL_TRACECHILD = "org.eclipse.linuxtools.valgrind.launch.GENERAL_TRACECHILD";
  public static final String ATTR_GENERAL_CHILDSILENT = "org.eclipse.linuxtools.valgrind.launch.GENERAL_CHILDSILENT";
  public static final String ATTR_GENERAL_FREERES = "org.eclipse.linuxtools.valgrind.launch.GENERAL_FREERES";
  public static final String ATTR_GENERAL_DEMANGLE = "org.eclipse.linuxtools.valgrind.launch.GENERAL_DEMANGLE";
  public static final String ATTR_GENERAL_NUMCALLERS = "org.eclipse.linuxtools.valgrind.launch.GENERAL_NUMCALLERS";
  public static final String ATTR_GENERAL_ERRLIMIT = "org.eclipse.linuxtools.valgrind.launch.GENERAL_ERRLIMIT";
  public static final String ATTR_GENERAL_BELOWMAIN = "org.eclipse.linuxtools.valgrind.launch.GENERAL_BELOWMAIN";
  public static final String ATTR_GENERAL_MAXFRAME = "org.eclipse.linuxtools.valgrind.launch.GENERAL_MAXFRAME";
  public static final String ATTR_GENERAL_SUPPFILE = "org.eclipse.linuxtools.valgrind.launch.GENERAL_SUPPFILE";
}

/* Location:
 * Qualified Name:     org.eclipse.linuxtools.valgrind.core.utils.LaunchConfigurationConstants
 * 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