Package flash.tools.debugger

Examples of flash.tools.debugger.SwfInfo


    int reason = session.suspendReason();
    int offset = ((PlayerSession)session).getSuspendOffset();
    int index = ((PlayerSession)session).getSuspendActionIndex();

    SwfInfo info = null;
    try { info = fileInfo.getSwfs()[index]; } catch(ArrayIndexOutOfBoundsException oobe) {}
    if (info != null)
    {
      Map<String, String> args = new HashMap<String, String>();
      args.put("swfName", FileInfoCache.nameOfSwf(info) ); //$NON-NLS-1$
View Full Code Here


           int which = info.getActionIndex();
           int until = info.getNextOffset();
           if (info.getReason() == SuspendReason.Unknown)
             throw new SuspendedException();
           SwfInfo swf = fileInfo.getSwfs()[which];
           outputAssembly(cli, (DSwfInfo)swf, at, until);
           throw new AmbiguousException(getLocalizationManager().getLocalizedTextString("key27")); //$NON-NLS-1$
         }
       }     
       /**
        * Check for a few error conditions, otherwise we'll write a listing!
        */
       if (cli.hasMoreTokens())
       {
         cli.err(getLocalizationManager().getLocalizedTextString("key28")); //$NON-NLS-1$
       }
       else
       {
         SourceFile file = fileInfo.getFile(module1);
         numLines = file.getLineCount();
         // pressing return is ok, otherwise throw the exception
         if (line1 > numLines && arg1 != null)
           throw new IndexOutOfBoundsException();
         /* if no arg2 then user list a single line */
         if (arg2 == null)
           line2 = line1;
         /* adjust our range of lines to ensure we conform */
         if (line1 < 1)
         {
           /* shrink line 1, grow line2 */
           line2 += -(line1 - 1);
           line1 = 1;
         }
         if (line2 > numLines)
           line2 = numLines;
        //          System.out.println("1="+module1+":"+line1+",2="+module2+":"+line2+",num="+numLines+",half="+half);
         /* nothing to display */
         if (line1 > line2)
           throw new IndexOutOfBoundsException();
         /* now dump the mixed source / assembly */
         // now lets find which swf this in
         DSwfInfo swf = (DSwfInfo)fileInfo.swfForFile(file);
         ActionLocation lStart = null;
         ActionLocation lEnd = null;
         if (swf == null)
        {
          Map<String, String> args = new HashMap<String, String>();
          args.put("arg3", file.getName()); //$NON-NLS-1$
           cli.err(getLocalizationManager().getLocalizedTextString("key29", args)); //$NON-NLS-1$
        }
         else if (functionNamed)
         {
           // if we name a function just dump the whole thing without source.
           int offset = file.getOffsetForLine(line1);
           lStart = swf.locate(offset);
           if (lStart.function == null)
             cli.err(getLocalizationManager().getLocalizedTextString("key30")); //$NON-NLS-1$
           else
           {
             // create a psudeo action list from which to disasemble the function
             ActionList al = new ActionList(true);
             al.setActionOffset(0, lStart.function);
             lStart.actions = al;
             lStart.at = 0;
             lEnd = new ActionLocation();
             lEnd.actions = al;
             lEnd.at = 0;
             outputAssembly(cli, swf, lStart, lEnd);
           }
         }
         else
         {
           ActionLocation lastEnd = null;
           for(int i=line1; i<=line2; i++)
           {
             int offset = file.getOffsetForLine(i);
             // locate the action list associated with this of the swf
             if (offset != 0)
             {
               // get the starting point and try to locate a nice ending
               lStart = swf.locate(offset);
               lEnd = swf.locateSourceLineEnd(lStart);
               // now see if we skipped some assembly between source lines
               if (lastEnd != null)
               {
                 lastEnd.at++;  // point our pseudo start to the next action
                 // new actions list so attempt to find the end of source in the old actions list
                 if (lastEnd.actions != lStart.actions && lastEnd.actions.size() != lastEnd.at)
                 {
                   String atString = Integer.toHexString(lastEnd.actions.getOffset(lastEnd.at));
                  Map<String, String> args = new HashMap<String, String>();
                  args.put("arg4", atString); //$NON-NLS-1$
                   cli.out(getLocalizationManager().getLocalizedTextString("key31", args)); //$NON-NLS-1$
                    // we are missing some of the dissassembly, so back up a bit and dump it out
                   ActionLocation gapEnd = swf.locateSourceLineEnd(lastEnd);
                   outputAssembly(cli, swf, lastEnd, gapEnd);
                 }
                 else if (lastEnd.at < lStart.at)
                 {
                   // same action list but we skipped some instructions
View Full Code Here

        sb.append(':');
        sb.append(l.getLine());

        try
        {
          SwfInfo info = m_fileInfo.swfForFile(file);
          Map<String, Object> swfArgs = new HashMap<String, Object>();
          swfArgs.put("swf", FileInfoCache.shortNameOfSwf(info)); //$NON-NLS-1$
          sb.append(getLocalizationManager().getLocalizedTextString("inSwf", swfArgs)); //$NON-NLS-1$
        }
        catch(NullPointerException npe)
View Full Code Here

    {
      StringBuilder sb = new StringBuilder();
      SwfInfo[] swfs = m_fileInfo.getSwfs();
      for(int i=0; i<swfs.length; i++)
      {
        SwfInfo e = swfs[i];
        if (e == null || e.isUnloaded())
          continue;

        Map<String, Object> args = new HashMap<String, Object>();
        args.put("swfName", FileInfoCache.nameOfSwf(e)); //$NON-NLS-1$
        args.put("size", NumberFormat.getInstance().format(e.getSwfSize())); //$NON-NLS-1$

        try
        {
          int size = e.getSwdSize(m_session);

          // our swd is loaded so let's comb through our
          // list of scripts and locate the range of ids.
          SourceFile[] files = e.getSourceList(m_session);
          int max = Integer.MIN_VALUE;
          int min = Integer.MAX_VALUE;
          for(int j=0; j<files.length; j++)
          {
            SourceFile f = files[j];
            int id = f.getId();
            max = (id > max) ? id : max;
            min = (id < min) ? id : min;
          }

          args.put("scriptCount", Integer.toString(e.getSourceCount(m_session))); //$NON-NLS-1$
          args.put("min", Integer.toString(min)); //$NON-NLS-1$
          args.put("max", Integer.toString(max)); //$NON-NLS-1$
          args.put("plus", (e.isProcessingComplete()) ? "+" : ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
          args.put("moreInfo", (size==0) ? getLocalizationManager().getLocalizedTextString("remainingSourceBeingLoaded") : ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
        }
        catch(InProgressException ipe)
        {
          sb.append(getLocalizationManager().getLocalizedTextString("debugInfoBeingLoaded")); //$NON-NLS-1$
        }
        args.put("url", e.getUrl()); //$NON-NLS-1$
        sb.append(getLocalizationManager().getLocalizedTextString("swfInfo", args)); //$NON-NLS-1$
        sb.append(m_newline);
      }
      out( sb.toString() );
    }
View Full Code Here

      // if a single swf break action then append more info
      if (singleSwf && isResolved)
      {
        try
        {
          SwfInfo info = m_fileInfo.swfForFile(file);
          Map<String, Object> swfArgs = new HashMap<String, Object>();
          swfArgs.put("swf", FileInfoCache.nameOfSwf(info)); //$NON-NLS-1$
          sb.append(getLocalizationManager().getLocalizedTextString("inSwf", swfArgs)); //$NON-NLS-1$
        }
        catch(NullPointerException npe)
View Full Code Here

     */
    void propagateBreakpoints() throws NotConnectedException
    {
    // get the newly added swf, which lands at the end list
    SwfInfo[] swfs = m_fileInfo.getSwfs();
    SwfInfo swf = (swfs.length > 1) ? swfs[swfs.length-1] : null;

    // now walk through all breakpoints propagating the
    // the break for each source and line number we
    // find in the new swf
    int size = m_breakpoints.size();
View Full Code Here

   */
  LocationCollection enableBreak(SourceFile f, int line) throws NotConnectedException
  {
        LocationCollection col = new LocationCollection();
    boolean singleSwfBreakpoint = m_fileInfo.isSwfFilterOn();
    SwfInfo swf = m_fileInfo.getSwfFilter();

        // If we have a swf filter enabled then we only want to
        // set a breakpoint in a specific swf not all of them
        if (singleSwfBreakpoint)
        {
            Location l = null;
            try {
                l = findAndEnableBreak(swf, f, line);
            }
            catch(InProgressException ipe)
            {
                if (Trace.error)
                    Trace.trace( ( (swf==null)?"SWF ":swf.getUrl() )+" still loading, breakpoint at "+f.getName()+":"+line+" not set"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
            }
            col.add(l);
        }
        else
        {
            // walk all swfs looking to add this breakpoint
            SwfInfo[] swfs = m_fileInfo.getSwfs();
            for (SwfInfo swf1 : swfs) {
                swf = swf1;
                if (swf != null) {
                    try {
                        Location l = findAndEnableBreak(swf, f, line);
                        if (l != null)
                            col.add(l);
                    } catch (InProgressException ipe) {
                        if (Trace.error)
                            Trace.trace((swf.getUrl()) + " still loading, breakpoint at " + f.getName() + ":" + line + " not set"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
                    }
                }
            }
        }
    return col;
View Full Code Here

    else
    {
      SwfInfo[] swfs = getAllSwfs();
      for(int i=0; i<swfs.length; i++)
      {
        SwfInfo e = swfs[i];
        if (e != null && nameOfSwf(e).equalsIgnoreCase(swfName))
        {
          worked = true;
          m_swfFilter = e;
          break;
View Full Code Here

   */
  public SwfInfo swfForFile(SourceFile f, int isolateId)
  {
    // We use the id to determine which swf this source files resides in
    int id = f.getId();
    SwfInfo info = null;
    SwfInfo[] swfs = getSwfs(isolateId);//getAllSwfs();
    for(int i=0; ( i<swfs.length && (info == null) ); i++)
    {
      if (swfs[i] != null && swfs[i].containsSource(f))
        info = swfs[i];
View Full Code Here

    int reason = session.suspendReason();
    int offset = ((PlayerSession)session).getSuspendOffset();
    int index = ((PlayerSession)session).getSuspendActionIndex();

    SwfInfo info = null;
    try { info = fileInfo.getSwfs(isolateId)[index]; } catch(ArrayIndexOutOfBoundsException oobe) {}
    if (info != null)
    {
      Map<String, String> args = new HashMap<String, String>();
      args.put("swfName", FileInfoCache.nameOfSwf(info) ); //$NON-NLS-1$
View Full Code Here

TOP

Related Classes of flash.tools.debugger.SwfInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.