org.tizen.nativecpp.csviewer_1.0.0.201311042022

16:50:16.074 INFO  jd.cli.Main - Decompiling org.tizen.nativecpp.csviewer_1.0.0.201311042022.jar
package org.tizen.nativecpp.csviewer;

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

public class Activator
  extends AbstractUIPlugin
{
  public static final String PLUGIN_ID = "org.tizen.nativecpp.csviewer";
  private static Activator plugin;
  
  public void start(BundleContext context)
    throws Exception
  {
    super.start(context);
    plugin = this;
  }
  
  public void stop(BundleContext context)
    throws Exception
  {
    plugin = null;
    super.stop(context);
  }
  
  public static Activator getDefault()
  {
    return plugin;
  }
  
  public static ImageDescriptor getImageDescriptor(String path)
  {
    return imageDescriptorFromPlugin("org.tizen.nativecpp.csviewer", path);
  }
}

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

import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.tizen.common.util.ViewUtil;
import org.tizen.common.util.log.Logger;
import org.tizen.nativecpp.csviewer.view.CallStackView;

class CrashReportServiceListener$ViewRunnable
  implements Runnable
{
  String id;
  String csPath;
  
  public CrashReportServiceListener$ViewRunnable(CrashReportServiceListener paramCrashReportServiceListener, String id, String csPath)
  {
    this.id = id;
    this.csPath = csPath;
  }
  
  public void run()
  {
    IWorkbenchWindow window = ViewUtil.getWorkbenchWindow();
    if (window == null) {
      return;
    }
    try
    {
      CallStackView viewPart = (CallStackView)window.getActivePage().showView(id);
      if (viewPart != null) {
        viewPart.startCallStackView(csPath);
      } else {
        Logger.error("Cannot find cs view", new Object[0]);
      }
    }
    catch (PartInitException e)
    {
      Logger.error("Failed to show cs view :", e);
    }
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.csviewer.CrashReportServiceListener.ViewRunnable
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.csviewer;

import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.tizen.common.util.SWTUtil;
import org.tizen.common.util.ViewUtil;
import org.tizen.common.util.log.Logger;
import org.tizen.nativecommon.ProjectUtil;
import org.tizen.nativecpp.csviewer.view.CallStackView;
import org.tizen.sdblib.ICrashReportServiceListener;
import org.tizen.sdblib.IDevice;

public class CrashReportServiceListener
  implements ICrashReportServiceListener
{
  private static String CS_VIEW_ID = "org.tizen.nativecpp.csviewer.view.CallStackView";
  
  public void fileCreated(IDevice device, String remoteCSPath)
  {
    if ((device != null) && (remoteCSPath != null)) {
      try
      {
        String strFilePath = ProjectUtil.pullCSFile(device, remoteCSPath);
        if (strFilePath != null) {
          showView(CS_VIEW_ID, strFilePath);
        }
      }
      catch (Exception e)
      {
        Logger.error("Failed to pull cs file :", e);
      }
    }
  }
  
  private void showView(String viewId, String csPath)
  {
    ViewRunnable runnable = new ViewRunnable(viewId, csPath);
    SWTUtil.asyncExec(runnable);
  }
  
  private class ViewRunnable
    implements Runnable
  {
    String id;
    String csPath;
    
    public ViewRunnable(String id, String csPath)
    {
      this.id = id;
      this.csPath = csPath;
    }
    
    public void run()
    {
      IWorkbenchWindow window = ViewUtil.getWorkbenchWindow();
      if (window == null) {
        return;
      }
      try
      {
        CallStackView viewPart = (CallStackView)window.getActivePage().showView(id);
        if (viewPart != null) {
          viewPart.startCallStackView(csPath);
        } else {
          Logger.error("Cannot find cs view", new Object[0]);
        }
      }
      catch (PartInitException e)
      {
        Logger.error("Failed to show cs view :", e);
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.csviewer.CrashReportServiceListener
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.csviewer.action;

import java.io.File;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.ui.IViewActionDelegate;
import org.eclipse.ui.IViewPart;
import org.tizen.nativecpp.csviewer.control.CSFileReader;
import org.tizen.nativecpp.csviewer.model.CSVO;
import org.tizen.nativecpp.csviewer.view.CallStackView;

public class OpenCSFileActionDelegate
  implements IViewActionDelegate
{
  private static final String ID_ACTION_OPEN = "org.tizen.nativecpp.csviewer.action.OpenCSFile";
  private CallStackView csView;
  
  public void run(IAction action)
  {
    String strID = action.getId();
    if (strID.equals("org.tizen.nativecpp.csviewer.action.OpenCSFile"))
    {
      FileDialog dialog = new FileDialog(Display.getCurrent().getActiveShell(), 4096);
      dialog.setText("Select Call Stack File");
      
      File file = ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile();
      dialog.setFilterPath(file.getAbsolutePath());
      dialog.setFilterExtensions(new String[] { "*.cs" });
      dialog.setFilterIndex(0);
      
      String csFilePath = dialog.open();
      if (csFilePath != null)
      {
        CSFileReader csFileReader = new CSFileReader(csFilePath);
        csFileReader.demanglingFile();
        CSVO result = csFileReader.parse();
        if (result != null) {
          csView.initCrashInformation(result);
        }
      }
    }
  }
  
  public void selectionChanged(IAction action, ISelection selection) {}
  
  public void init(IViewPart view)
  {
    csView = ((CallStackView)view);
  }
}

/* Location:
 * Qualified Name:     org.tizen.nativecpp.csviewer.action.OpenCSFileActionDelegate
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.nativecpp.csviewer.control;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import org.tizen.common.core.application.InstallPathConfig;
import org.tizen.nativecpp.csviewer.model.CSVO;
import org.tizen.nativecpp.csviewer.model.CallStackVO;
import org.tizen.nativecpp.csviewer.model.DebugMessageVO;
import org.tizen.nativecpp.csviewer.model.HeaderVO;
import org.tizen.nativecpp.csviewer.model.MemoryMapVO;
import org.tizen.nativecpp.csviewer.model.RegisterVO;

public class CSFileReader
{
  private File csFile;
  private static final int MODE_DEFAULT = 0;
  private static final int MODE_HEADER = 1;
  private static final int MODE_HEADER_CRASH = 2;
  private static final int MODE_HEADER_SIGNAL = 3;
  private static final int MODE_HEADER_REGISTER_INFO = 4;
  private static final int MODE_HEADER_MEMORY = 5;
  private static final int MODE_HEADER_PACKAGE = 6;
  private static final int MODE_CALL_STACK_INFO = 12;
  private static final int MODE_MEMORY_MAP = 13;
  private static final int MODE_DEBUG_MESSAGE = 14;
  
  public CSFileReader(String csFilePath)
  {
    csFile = new File(csFilePath);
  }
  
  public void demanglingFile()
  {
    try
    {
      String sdkRoot = InstallPathConfig.getSDKPath();
      if ((sdkRoot != null) && (!sdkRoot.isEmpty()))
      {
        StringBuffer sb = new StringBuffer();
        StringBuffer sbFile = new StringBuffer();
        if (isWindows())
        {
          sb.append("tools");
          sb.append(File.separator);
          sb.append("mingw");
          sb.append(File.separator);
          sb.append("msys");
          sb.append(File.separator);
          sb.append("1.0");
          sb.append(File.separator);
          sb.append("bin");
          sb.append(File.separator);
          sb.append("cat.exe");
          sb.append(" ");
        }
        else if ((isLinux()) || (isMacOS()))
        {
          sb.append("cat ");
        }
        else
        {
          return;
        }
        sbFile.append("\"");
        sbFile.append(csFile.getCanonicalFile().getCanonicalPath());
        sbFile.append("\"");
        String strInputFile = sbFile.toString();
        
        sb.append(strInputFile);
        String strCommandCat = sb.toString();
        
        sb.delete(0, sb.length());
        sb.append("tools");
        sb.append(File.separator);
        sb.append("i386-linux-gnueabi-gcc-4.5");
        sb.append(File.separator);
        sb.append("bin");
        sb.append(File.separator);
        if (isWindows()) {
          sb.append("i386-linux-gnueabi-c++filt.exe");
        } else if ((isLinux()) || (isMacOS())) {
          sb.append("i386-linux-gnueabi-c++filt");
        } else {
          return;
        }
        sb.append(" > ");
        
        sbFile.delete(0, sbFile.length());
        sbFile.append("\"");
        sbFile.append(csFile.getParentFile().getCanonicalPath());
        sbFile.append(File.separator);
        sbFile.append("copy_");
        sbFile.append(csFile.getName());
        sbFile.append("\"");
        String strOutputFile = sbFile.toString();
        
        sb.append(strOutputFile);
        String strCommandFilt = sb.toString();
        
        sb.delete(0, sb.length());
        sb.append(strCommandCat);
        sb.append(" | ");
        sb.append(strCommandFilt);
        
        ProcessBuilder processBuilder = new ProcessBuilder(new String[0]);
        processBuilder.command(getCommand(sb.toString()));
        processBuilder.directory(new File(sdkRoot));
        Process process = processBuilder.start();
        if (process.waitFor() == 0) {
          process.destroy();
        }
        strInputFile = strInputFile.substring(1, strInputFile.length() - 1);
        File fileInput = new File(strInputFile);
        fileInput.setWritable(true);
        fileInput.delete();
        
        strOutputFile = strOutputFile.substring(1, strOutputFile.length() - 1);
        File fileOutput = new File(strOutputFile);
        fileOutput.setWritable(true);
        fileOutput.renameTo(new File(strInputFile));
      }
    }
    catch (IOException e)
    {
      e.printStackTrace();
    }
    catch (InterruptedException e)
    {
      e.printStackTrace();
    }
  }
  
  private String[] getCommand(String strCmd)
  {
    if (isWindows()) {
      return new String[] { "cmd", "/c", strCmd };
    }
    if ((isLinux()) || (isMacOS())) {
      return new String[] { "/bin/sh", "-c", strCmd };
    }
    return null;
  }
  
  private String strSignalNumber = null;
  private int mode = 0;
  
  /* Error */
  public CSVO parse()
  {
    // Byte code:
    //   0: aconst_null
    //   1: astore_1
    //   2: aload_0
    //   3: getfield 65	org/tizen/nativecpp/csviewer/control/CSFileReader:csFile	Ljava/io/File;
    //   6: ifnull +615 -> 621
    //   9: aconst_null
    //   10: astore_2
    //   11: aconst_null
    //   12: astore_3
    //   13: aconst_null
    //   14: astore 4
    //   16: aload_0
    //   17: iconst_0
    //   18: putfield 41	org/tizen/nativecpp/csviewer/control/CSFileReader:mode	I
    //   21: new 236	org/tizen/nativecpp/csviewer/model/CSVO
    //   24: dup
    //   25: invokespecial 238	org/tizen/nativecpp/csviewer/model/CSVO:<init>	()V
    //   28: astore_1
    //   29: new 239	java/io/FileReader
    //   32: dup
    //   33: aload_0
    //   34: getfield 65	org/tizen/nativecpp/csviewer/control/CSFileReader:csFile	Ljava/io/File;
    //   37: invokespecial 241	java/io/FileReader:<init>	(Ljava/io/File;)V
    //   40: astore_3
    //   41: new 244	java/io/BufferedReader
    //   44: dup
    //   45: aload_3
    //   46: invokespecial 246	java/io/BufferedReader:<init>	(Ljava/io/Reader;)V
    //   49: astore 4
    //   51: goto +382 -> 433
    //   54: aload_2
    //   55: invokevirtual 249	java/lang/String:trim	()Ljava/lang/String;
    //   58: astore_2
    //   59: aload_0
    //   60: getfield 41	org/tizen/nativecpp/csviewer/control/CSFileReader:mode	I
    //   63: tableswitch	default:+370->433, 0:+73->136, 1:+220->283, 2:+237->300, 3:+254->317, 4:+271->334, 5:+305->368, 6:+288->351, 7:+370->433, 8:+370->433, 9:+370->433, 10:+370->433, 11:+370->433, 12:+322->385, 13:+339->402, 14:+356->419
    //   136: aload_2
    //   137: ldc -4
    //   139: invokevirtual 254	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   142: ifeq +11 -> 153
    //   145: aload_0
    //   146: iconst_1
    //   147: putfield 41	org/tizen/nativecpp/csviewer/control/CSFileReader:mode	I
    //   150: goto +283 -> 433
    //   153: aload_2
    //   154: ldc_w 258
    //   157: invokevirtual 254	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   160: ifeq +11 -> 171
    //   163: aload_0
    //   164: iconst_2
    //   165: putfield 41	org/tizen/nativecpp/csviewer/control/CSFileReader:mode	I
    //   168: goto +265 -> 433
    //   171: aload_2
    //   172: ldc_w 260
    //   175: invokevirtual 254	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   178: ifeq +12 -> 190
    //   181: aload_0
    //   182: bipush 6
    //   184: putfield 41	org/tizen/nativecpp/csviewer/control/CSFileReader:mode	I
    //   187: goto +246 -> 433
    //   190: aload_2
    //   191: ldc_w 262
    //   194: invokevirtual 264	java/lang/String:startsWith	(Ljava/lang/String;)Z
    //   197: ifeq +11 -> 208
    //   200: aload_0
    //   201: iconst_4
    //   202: putfield 41	org/tizen/nativecpp/csviewer/control/CSFileReader:mode	I
    //   205: goto +228 -> 433
    //   208: aload_2
    //   209: ldc_w 268
    //   212: invokevirtual 264	java/lang/String:startsWith	(Ljava/lang/String;)Z
    //   215: ifeq +11 -> 226
    //   218: aload_0
    //   219: iconst_5
    //   220: putfield 41	org/tizen/nativecpp/csviewer/control/CSFileReader:mode	I
    //   223: goto +210 -> 433
    //   226: aload_2
    //   227: ldc_w 270
    //   230: invokevirtual 264	java/lang/String:startsWith	(Ljava/lang/String;)Z
    //   233: ifeq +12 -> 245
    //   236: aload_0
    //   237: bipush 12
    //   239: putfield 41	org/tizen/nativecpp/csviewer/control/CSFileReader:mode	I
    //   242: goto +191 -> 433
    //   245: aload_2
    //   246: ldc_w 272
    //   249: invokevirtual 264	java/lang/String:startsWith	(Ljava/lang/String;)Z
    //   252: ifeq +12 -> 264
    //   255: aload_0
    //   256: bipush 13
    //   258: putfield 41	org/tizen/nativecpp/csviewer/control/CSFileReader:mode	I
    //   261: goto +172 -> 433
    //   264: aload_2
    //   265: ldc_w 274
    //   268: invokevirtual 264	java/lang/String:startsWith	(Ljava/lang/String;)Z
    //   271: ifeq +162 -> 433
    //   274: aload_0
    //   275: bipush 14
    //   277: putfield 41	org/tizen/nativecpp/csviewer/control/CSFileReader:mode	I
    //   280: goto +153 -> 433
    //   283: aload_0
    //   284: aload_1
    //   285: aload_2
    //   286: invokespecial 276	org/tizen/nativecpp/csviewer/control/CSFileReader:parseHeader	(Lorg/tizen/nativecpp/csviewer/model/CSVO;Ljava/lang/String;)Z
    //   289: ifeq +144 -> 433
    //   292: aload_0
    //   293: iconst_0
    //   294: putfield 41	org/tizen/nativecpp/csviewer/control/CSFileReader:mode	I
    //   297: goto +136 -> 433
    //   300: aload_0
    //   301: aload_1
    //   302: aload_2
    //   303: invokespecial 280	org/tizen/nativecpp/csviewer/control/CSFileReader:parseHeaderCrash	(Lorg/tizen/nativecpp/csviewer/model/CSVO;Ljava/lang/String;)Z
    //   306: ifeq +127 -> 433
    //   309: aload_0
    //   310: iconst_0
    //   311: putfield 41	org/tizen/nativecpp/csviewer/control/CSFileReader:mode	I
    //   314: goto +119 -> 433
    //   317: aload_0
    //   318: aload_1
    //   319: aload_2
    //   320: invokespecial 283	org/tizen/nativecpp/csviewer/control/CSFileReader:parseHeaderSignal	(Lorg/tizen/nativecpp/csviewer/model/CSVO;Ljava/lang/String;)Z
    //   323: ifeq +110 -> 433
    //   326: aload_0
    //   327: iconst_0
    //   328: putfield 41	org/tizen/nativecpp/csviewer/control/CSFileReader:mode	I
    //   331: goto +102 -> 433
    //   334: aload_0
    //   335: aload_1
    //   336: aload_2
    //   337: invokespecial 286	org/tizen/nativecpp/csviewer/control/CSFileReader:parseHeaderRegisterInfo	(Lorg/tizen/nativecpp/csviewer/model/CSVO;Ljava/lang/String;)Z
    //   340: ifeq +93 -> 433
    //   343: aload_0
    //   344: iconst_0
    //   345: putfield 41	org/tizen/nativecpp/csviewer/control/CSFileReader:mode	I
    //   348: goto +85 -> 433
    //   351: aload_0
    //   352: aload_1
    //   353: aload_2
    //   354: invokespecial 289	org/tizen/nativecpp/csviewer/control/CSFileReader:parseHeaderPackage	(Lorg/tizen/nativecpp/csviewer/model/CSVO;Ljava/lang/String;)Z
    //   357: ifeq +76 -> 433
    //   360: aload_0
    //   361: iconst_0
    //   362: putfield 41	org/tizen/nativecpp/csviewer/control/CSFileReader:mode	I
    //   365: goto +68 -> 433
    //   368: aload_0
    //   369: aload_1
    //   370: aload_2
    //   371: invokespecial 292	org/tizen/nativecpp/csviewer/control/CSFileReader:parseHeaderMemory	(Lorg/tizen/nativecpp/csviewer/model/CSVO;Ljava/lang/String;)Z
    //   374: ifeq +59 -> 433
    //   377: aload_0
    //   378: iconst_0
    //   379: putfield 41	org/tizen/nativecpp/csviewer/control/CSFileReader:mode	I
    //   382: goto +51 -> 433
    //   385: aload_0
    //   386: aload_1
    //   387: aload_2
    //   388: invokespecial 295	org/tizen/nativecpp/csviewer/control/CSFileReader:parseCallStackInfo	(Lorg/tizen/nativecpp/csviewer/model/CSVO;Ljava/lang/String;)Z
    //   391: ifeq +42 -> 433
    //   394: aload_0
    //   395: iconst_0
    //   396: putfield 41	org/tizen/nativecpp/csviewer/control/CSFileReader:mode	I
    //   399: goto +34 -> 433
    //   402: aload_0
    //   403: aload_1
    //   404: aload_2
    //   405: invokespecial 298	org/tizen/nativecpp/csviewer/control/CSFileReader:parseMemoryMap	(Lorg/tizen/nativecpp/csviewer/model/CSVO;Ljava/lang/String;)Z
    //   408: ifeq +25 -> 433
    //   411: aload_0
    //   412: iconst_0
    //   413: putfield 41	org/tizen/nativecpp/csviewer/control/CSFileReader:mode	I
    //   416: goto +17 -> 433
    //   419: aload_0
    //   420: aload_1
    //   421: aload_2
    //   422: invokespecial 301	org/tizen/nativecpp/csviewer/control/CSFileReader:parseDebugMessage	(Lorg/tizen/nativecpp/csviewer/model/CSVO;Ljava/lang/String;)Z
    //   425: ifeq +8 -> 433
    //   428: aload_0
    //   429: iconst_0
    //   430: putfield 41	org/tizen/nativecpp/csviewer/control/CSFileReader:mode	I
    //   433: aload 4
    //   435: invokevirtual 304	java/io/BufferedReader:readLine	()Ljava/lang/String;
    //   438: dup
    //   439: astore_2
    //   440: ifnonnull -386 -> 54
    //   443: goto +150 -> 593
    //   446: astore 5
    //   448: aload 5
    //   450: invokevirtual 307	java/io/FileNotFoundException:printStackTrace	()V
    //   453: aload_3
    //   454: ifnull +7 -> 461
    //   457: aload_3
    //   458: invokevirtual 310	java/io/FileReader:close	()V
    //   461: aload 4
    //   463: ifnull +158 -> 621
    //   466: aload 4
    //   468: invokevirtual 313	java/io/BufferedReader:close	()V
    //   471: goto +150 -> 621
    //   474: astore 7
    //   476: aload 7
    //   478: invokevirtual 200	java/io/IOException:printStackTrace	()V
    //   481: goto +140 -> 621
    //   484: astore 5
    //   486: aload 5
    //   488: invokevirtual 200	java/io/IOException:printStackTrace	()V
    //   491: aload_3
    //   492: ifnull +7 -> 499
    //   495: aload_3
    //   496: invokevirtual 310	java/io/FileReader:close	()V
    //   499: aload 4
    //   501: ifnull +120 -> 621
    //   504: aload 4
    //   506: invokevirtual 313	java/io/BufferedReader:close	()V
    //   509: goto +112 -> 621
    //   512: astore 7
    //   514: aload 7
    //   516: invokevirtual 200	java/io/IOException:printStackTrace	()V
    //   519: goto +102 -> 621
    //   522: astore 5
    //   524: aload 5
    //   526: invokevirtual 314	java/lang/Exception:printStackTrace	()V
    //   529: aload_3
    //   530: ifnull +7 -> 537
    //   533: aload_3
    //   534: invokevirtual 310	java/io/FileReader:close	()V
    //   537: aload 4
    //   539: ifnull +82 -> 621
    //   542: aload 4
    //   544: invokevirtual 313	java/io/BufferedReader:close	()V
    //   547: goto +74 -> 621
    //   550: astore 7
    //   552: aload 7
    //   554: invokevirtual 200	java/io/IOException:printStackTrace	()V
    //   557: goto +64 -> 621
    //   560: astore 6
    //   562: aload_3
    //   563: ifnull +7 -> 570
    //   566: aload_3
    //   567: invokevirtual 310	java/io/FileReader:close	()V
    //   570: aload 4
    //   572: ifnull +18 -> 590
    //   575: aload 4
    //   577: invokevirtual 313	java/io/BufferedReader:close	()V
    //   580: goto +10 -> 590
    //   583: astore 7
    //   585: aload 7
    //   587: invokevirtual 200	java/io/IOException:printStackTrace	()V
    //   590: aload 6
    //   592: athrow
    //   593: aload_3
    //   594: ifnull +7 -> 601
    //   597: aload_3
    //   598: invokevirtual 310	java/io/FileReader:close	()V
    //   601: aload 4
    //   603: ifnull +18 -> 621
    //   606: aload 4
    //   608: invokevirtual 313	java/io/BufferedReader:close	()V
    //   611: goto +10 -> 621
    //   614: astore 7
    //   616: aload 7
    //   618: invokevirtual 200	java/io/IOException:printStackTrace	()V
    //   621: aload_1
    //   622: areturn
    // Line number table:
    //   Java source line #172	-> byte code offset #0
    //   Java source line #174	-> byte code offset #2
    //   Java source line #175	-> byte code offset #9
    //   Java source line #176	-> byte code offset #11
    //   Java source line #177	-> byte code offset #13
    //   Java source line #179	-> byte code offset #16
    //   Java source line #180	-> byte code offset #21
    //   Java source line #183	-> byte code offset #29
    //   Java source line #184	-> byte code offset #41
    //   Java source line #186	-> byte code offset #51
    //   Java source line #188	-> byte code offset #54
    //   Java source line #190	-> byte code offset #59
    //   Java source line #192	-> byte code offset #136
    //   Java source line #193	-> byte code offset #145
    //   Java source line #194	-> byte code offset #153
    //   Java source line #195	-> byte code offset #163
    //   Java source line #196	-> byte code offset #171
    //   Java source line #197	-> byte code offset #181
    //   Java source line #198	-> byte code offset #190
    //   Java source line #199	-> byte code offset #200
    //   Java source line #200	-> byte code offset #208
    //   Java source line #201	-> byte code offset #218
    //   Java source line #202	-> byte code offset #226
    //   Java source line #203	-> byte code offset #236
    //   Java source line #204	-> byte code offset #245
    //   Java source line #205	-> byte code offset #255
    //   Java source line #206	-> byte code offset #264
    //   Java source line #207	-> byte code offset #274
    //   Java source line #208	-> byte code offset #280
    //   Java source line #211	-> byte code offset #283
    //   Java source line #212	-> byte code offset #292
    //   Java source line #213	-> byte code offset #297
    //   Java source line #216	-> byte code offset #300
    //   Java source line #217	-> byte code offset #309
    //   Java source line #218	-> byte code offset #314
    //   Java source line #221	-> byte code offset #317
    //   Java source line #222	-> byte code offset #326
    //   Java source line #223	-> byte code offset #331
    //   Java source line #226	-> byte code offset #334
    //   Java source line #227	-> byte code offset #343
    //   Java source line #228	-> byte code offset #348
    //   Java source line #231	-> byte code offset #351
    //   Java source line #232	-> byte code offset #360
    //   Java source line #233	-> byte code offset #365
    //   Java source line #236	-> byte code offset #368
    //   Java source line #237	-> byte code offset #377
    //   Java source line #238	-> byte code offset #382
    //   Java source line #241	-> byte code offset #385
    //   Java source line #242	-> byte code offset #394
    //   Java source line #243	-> byte code offset #399
    //   Java source line #246	-> byte code offset #402
    //   Java source line #247	-> byte code offset #411
    //   Java source line #248	-> byte code offset #416
    //   Java source line #251	-> byte code offset #419
    //   Java source line #252	-> byte code offset #428
    //   Java source line #186	-> byte code offset #433
    //   Java source line #256	-> byte code offset #446
    //   Java source line #257	-> byte code offset #448
    //   Java source line #264	-> byte code offset #453
    //   Java source line #265	-> byte code offset #457
    //   Java source line #266	-> byte code offset #461
    //   Java source line #267	-> byte code offset #466
    //   Java source line #268	-> byte code offset #474
    //   Java source line #269	-> byte code offset #476
    //   Java source line #258	-> byte code offset #484
    //   Java source line #259	-> byte code offset #486
    //   Java source line #264	-> byte code offset #491
    //   Java source line #265	-> byte code offset #495
    //   Java source line #266	-> byte code offset #499
    //   Java source line #267	-> byte code offset #504
    //   Java source line #268	-> byte code offset #512
    //   Java source line #269	-> byte code offset #514
    //   Java source line #260	-> byte code offset #522
    //   Java source line #261	-> byte code offset #524
    //   Java source line #264	-> byte code offset #529
    //   Java source line #265	-> byte code offset #533
    //   Java source line #266	-> byte code offset #537
    //   Java source line #267	-> byte code offset #542
    //   Java source line #268	-> byte code offset #550
    //   Java source line #269	-> byte code offset #552
    //   Java source line #262	-> byte code offset #560
    //   Java source line #264	-> byte code offset #562
    //   Java source line #265	-> byte code offset #566
    //   Java source line #266	-> byte code offset #570
    //   Java source line #267	-> byte code offset #575
    //   Java source line #268	-> byte code offset #583
    //   Java source line #269	-> byte code offset #585
    //   Java source line #271	-> byte code offset #590
    //   Java source line #264	-> byte code offset #593
    //   Java source line #265	-> byte code offset #597
    //   Java source line #266	-> byte code offset #601
    //   Java source line #267	-> byte code offset #606
    //   Java source line #268	-> byte code offset #614
    //   Java source line #269	-> byte code offset #616
    //   Java source line #274	-> byte code offset #621
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	623	0	this	CSFileReader
    //   1	621	1	result	CSVO
    //   10	430	2	strLine	String
    //   12	586	3	fr	java.io.FileReader
    //   14	593	4	br	java.io.BufferedReader
    //   446	3	5	e	java.io.FileNotFoundException
    //   484	3	5	e	IOException
    //   522	3	5	e	Exception
    //   560	31	6	localObject	Object
    //   474	3	7	e	IOException
    //   512	3	7	e	IOException
    //   550	3	7	e	IOException
    //   583	3	7	e	IOException
    //   614	3	7	e	IOException
    // Exception table:
    //   from	to	target	type
    //   29	443	446	java/io/FileNotFoundException
    //   453	471	474	java/io/IOException
    //   29	443	484	java/io/IOException
    //   491	509	512	java/io/IOException
    //   29	443	522	java/lang/Exception
    //   529	547	550	java/io/IOException
    //   29	453	560	finally
    //   484	491	560	finally
    //   522	529	560	finally
    //   562	580	583	java/io/IOException
    //   593	611	614	java/io/IOException
  }
  
  private boolean parseHeader(CSVO result, String strLine)
    throws Exception
  {
    boolean isEnd = false;
    
    int idxSub = -1;
    String strSub = null;
    if (strLine.isEmpty())
    {
      isEnd = true;
    }
    else
    {
      HeaderVO header = result.getHeader();
      if (strLine.startsWith("Build-Number:"))
      {
        idxSub = strLine.indexOf(':');
        if (idxSub > -1)
        {
          strSub = strLine.substring(idxSub + 1, strLine.length());
          header.setBuildNumber(strSub);
        }
      }
      else if (strLine.startsWith("Build-Date:"))
      {
        idxSub = strLine.indexOf(':');
        if (idxSub > -1)
        {
          strSub = strLine.substring(idxSub + 1, strLine.length());
          header.setBuildDate(strSub);
        }
      }
      else if (strLine.startsWith("Model:"))
      {
        idxSub = strLine.indexOf(':');
        if (idxSub > -1)
        {
          strSub = strLine.substring(idxSub + 1, strLine.length());
          header.setModel(strSub);
        }
      }
      else if (strLine.startsWith("Tizen-Version:"))
      {
        idxSub = strLine.indexOf(':');
        if (idxSub > -1)
        {
          strSub = strLine.substring(idxSub + 1, strLine.length());
          header.setVersion(strSub);
        }
      }
      result.setHeader(header);
    }
    return isEnd;
  }
  
  private boolean parseHeaderCrash(CSVO result, String strLine)
    throws Exception
  {
    boolean isEnd = false;
    
    int idxSub = -1;
    String strSub = null;
    if (strLine.isEmpty())
    {
      isEnd = true;
    }
    else
    {
      HeaderVO header = result.getHeader();
      if (strLine.startsWith("Date:"))
      {
        idxSub = strLine.indexOf(':');
        if (idxSub > -1)
        {
          strSub = strLine.substring(idxSub + 1, strLine.length()).trim();
          header.setCrashDate(strSub);
        }
      }
      else if (strLine.startsWith("Executable File Path:"))
      {
        idxSub = strLine.indexOf(':');
        if (idxSub > -1)
        {
          strSub = strLine.substring(idxSub + 1, strLine.length()).trim();
          header.setCrashExePath(strSub);
        }
      }
      else if (strLine.startsWith("Process Name:"))
      {
        idxSub = strLine.indexOf(':');
        if (idxSub > -1)
        {
          strSub = strLine.substring(idxSub + 1, strLine.length()).trim();
          header.setProcessName(strSub);
        }
      }
      else if (strLine.startsWith("PID:"))
      {
        idxSub = strLine.indexOf(':');
        if (idxSub > -1)
        {
          strSub = strLine.substring(idxSub + 1, strLine.length()).trim();
          header.setPID(strSub);
        }
      }
      else if (strLine.startsWith("Signal:"))
      {
        idxSub = strLine.indexOf(':');
        if (idxSub > -1)
        {
          strSub = strLine.substring(idxSub + 1, strLine.length()).trim();
          header.appendSignalLine(strSub);
          mode = 3;
        }
      }
      result.setHeader(header);
    }
    return isEnd;
  }
  
  private boolean parseHeaderSignal(CSVO result, String strLine)
    throws Exception
  {
    boolean isEnd = false;
    if (strLine.isEmpty())
    {
      isEnd = true;
    }
    else
    {
      HeaderVO header = result.getHeader();
      if ((strSignalNumber != null) && (!strSignalNumber.isEmpty()))
      {
        header.appendSignalLine(strSignalNumber);
        strSignalNumber = null;
      }
      header.appendSignalLine(strLine);
      result.setHeader(header);
    }
    return isEnd;
  }
  
  private boolean parseHeaderPackage(CSVO result, String strLine)
    throws Exception
  {
    boolean isEnd = false;
    
    int idxSub = -1;
    String strSub = null;
    if (strLine.isEmpty())
    {
      isEnd = true;
    }
    else
    {
      HeaderVO header = result.getHeader();
      if (strLine.startsWith("Package Name:"))
      {
        idxSub = strLine.indexOf(':');
        if (idxSub > -1)
        {
          strSub = strLine.substring(idxSub + 1, strLine.length()).trim();
          header.setPackageName(strSub);
        }
      }
      else if (strLine.startsWith("Package Type:"))
      {
        idxSub = strLine.indexOf(':');
        if (idxSub > -1)
        {
          strSub = strLine.substring(idxSub + 1, strLine.length()).trim();
          header.setPackageType(strSub);
        }
      }
      else if (strLine.startsWith("Version:"))
      {
        idxSub = strLine.indexOf(':');
        if (idxSub > -1)
        {
          strSub = strLine.substring(idxSub + 1, strLine.length()).trim();
          header.setPackageVersion(strSub);
        }
      }
      else if (strLine.startsWith("App Name:"))
      {
        idxSub = strLine.indexOf(':');
        if (idxSub > -1)
        {
          strSub = strLine.substring(idxSub + 1, strLine.length()).trim();
          header.setAppName(strSub);
        }
      }
      else if (strLine.startsWith("App ID"))
      {
        idxSub = strLine.indexOf(':');
        if (idxSub > -1)
        {
          strSub = strLine.substring(idxSub + 1, strLine.length()).trim();
          header.setAppID(strSub);
        }
      }
      else if (strLine.startsWith("Type:"))
      {
        idxSub = strLine.indexOf(':');
        if (idxSub > -1)
        {
          strSub = strLine.substring(idxSub + 1, strLine.length()).trim();
          header.setAppType(strSub);
        }
      }
      else if (strLine.startsWith("Categories:"))
      {
        idxSub = strLine.indexOf(':');
        if (idxSub > -1)
        {
          strSub = strLine.substring(idxSub + 1, strLine.length()).trim();
          header.setCategories(strSub);
        }
      }
    }
    return isEnd;
  }
  
  private boolean parseHeaderRegisterInfo(CSVO result, String strLine)
    throws Exception
  {
    boolean isEnd = false;
    if (strLine.isEmpty())
    {
      isEnd = true;
    }
    else
    {
      HeaderVO header = result.getHeader();
      
      ArrayList<RegisterVO> registerList = header.getRegisterList();
      String[] strsLine = strLine.split(",");
      String[] arrayOfString1;
      int j = (arrayOfString1 = strsLine).length;
      for (int i = 0; i < j; i++)
      {
        String str = arrayOfString1[i];
        int idxSub = str.indexOf('=');
        if (idxSub > -1)
        {
          RegisterVO registerVO = new RegisterVO(str.substring(0, idxSub).trim(), str.substring(idxSub + 1, 
            str.length()).trim());
          registerList.add(registerVO);
        }
      }
      header.setRegisters(registerList);
      result.setHeader(header);
    }
    return isEnd;
  }
  
  private boolean parseHeaderMemory(CSVO result, String strLine)
    throws Exception
  {
    boolean isEnd = false;
    if (strLine.isEmpty())
    {
      isEnd = true;
    }
    else
    {
      HeaderVO header = result.getHeader();
      
      int idxSub = -1;
      String strSub = null;
      
      idxSub = strLine.indexOf(":");
      if (idxSub > -1)
      {
        strSub = strLine.substring(0, idxSub).trim();
        if (strSub.equals("MemTotal")) {
          header.setMemTotal(Integer.parseInt(strLine.substring(idxSub + 1, strLine.length())
            .replace(" KB", "").trim()));
        } else if (strSub.equals("MemFree")) {
          header.setMemFree(Integer.parseInt(strLine.substring(idxSub + 1, strLine.length())
            .replace(" KB", "").trim()));
        } else if (strSub.equals("Buffers")) {
          header.setBuffers(Integer.parseInt(strLine.substring(idxSub + 1, strLine.length())
            .replace(" KB", "").trim()));
        } else if (strSub.equals("Cached")) {
          header.setCached(Integer.parseInt(strLine.substring(idxSub + 1, strLine.length())
            .replace(" KB", "").trim()));
        } else if (strSub.equals("VmPeak")) {
          header.setVmPeak(Integer.parseInt(strLine.substring(idxSub + 1, strLine.length())
            .replace(" KB", "").trim()));
        } else if (strSub.equals("VmSize")) {
          header.setVmSize(Integer.parseInt(strLine.substring(idxSub + 1, strLine.length())
            .replace(" KB", "").trim()));
        } else if (strSub.equals("VmLck")) {
          header.setVmLck(Integer.parseInt(strLine.substring(idxSub + 1, strLine.length())
            .replace(" KB", "").trim()));
        } else if (strSub.equals("VmPin")) {
          header.setVmPin(Integer.parseInt(strLine.substring(idxSub + 1, strLine.length())
            .replace(" KB", "").trim()));
        } else if (strSub.equals("VmHWM")) {
          header.setVmHWM(Integer.parseInt(strLine.substring(idxSub + 1, strLine.length())
            .replace(" KB", "").trim()));
        } else if (strSub.equals("VmRSS")) {
          header.setVmRSS(Integer.parseInt(strLine.substring(idxSub + 1, strLine.length())
            .replace(" KB", "").trim()));
        } else if (strSub.equals("VmData")) {
          header.setVmData(Integer.parseInt(strLine.substring(idxSub + 1, strLine.length())
            .replace(" KB", "").trim()));
        } else if (strSub.equals("VmStk")) {
          header.setVmStk(Integer.parseInt(strLine.substring(idxSub + 1, strLine.length())
            .replace(" KB", "").trim()));
        } else if (strSub.equals("VmExe")) {
          header.setVmExe(Integer.parseInt(strLine.substring(idxSub + 1, strLine.length())
            .replace(" KB", "").trim()));
        } else if (strSub.equals("VmLib")) {
          header.setVmLib(Integer.parseInt(strLine.substring(idxSub + 1, strLine.length())
            .replace(" KB", "").trim()));
        } else if (strSub.equals("VmPTE")) {
          header.setVmPTE(Integer.parseInt(strLine.substring(idxSub + 1, strLine.length())
            .replace(" KB", "").trim()));
        } else if (strSub.equals("VmSwap")) {
          header.setVmSwap(Integer.parseInt(strLine.substring(idxSub + 1, strLine.length())
            .replace(" KB", "").trim()));
        }
      }
      result.setHeader(header);
    }
    return isEnd;
  }
  
  private boolean parseCallStackInfo(CSVO result, String strLine)
    throws Exception
  {
    boolean isEnd = false;
    if (strLine.equals("End of Call Stack"))
    {
      isEnd = true;
    }
    else if (!strLine.startsWith("Call Stack Count:"))
    {
      ArrayList<CallStackVO> csList = result.getCallStackList();
      
      int idxSub = -1;
      int idxL = -1;int idxR = -1;
      int countP = 0;
      
      CallStackVO csVO = new CallStackVO();
      
      idxSub = strLine.indexOf(":");
      if (idxSub > -1) {
        csVO.setSerialNumber(Integer.parseInt(strLine.substring(0, idxSub).trim()));
      }
      boolean isAbnormalAddressFormat = false;
      String strAddressTemp = null;
      long addressTemp = 0L;
      idxL = strLine.indexOf('[');
      idxR = strLine.indexOf(']');
      if ((idxL > -1) && (idxR > -1))
      {
        strAddressTemp = strLine.substring(idxL + 1, idxR).trim();
        if (strAddressTemp != null) {
          try
          {
            if (strAddressTemp.startsWith("0x")) {
              strAddressTemp = strAddressTemp.substring(2, strAddressTemp.length());
            }
            addressTemp = Long.parseLong(strAddressTemp, 16);
          }
          catch (NumberFormatException localNumberFormatException)
          {
            isAbnormalAddressFormat = true;
          }
        }
      }
      if (isAbnormalAddressFormat)
      {
        idxL = 0;
        idxR = 0;
        countP = countParentheses(strLine);
        if (countP > 0) {
          for (int i = 0; i < countP; i++)
          {
            idxL = strLine.indexOf("(", idxL);
            if (idxL > -1)
            {
              idxR = strLine.indexOf(")", idxL);
              if (idxR > -1) {
                if (idxL + 3 < idxR)
                {
                  long longTemp = getAddress(strLine.substri
1 2 3

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