Package flash.tools.debugger

Examples of flash.tools.debugger.SourceFile


    // set the module and line
    Frame[] frames = m_session.getFrames();
    Frame ctx = frames[frameNum];

    Location l = ctx.getLocation();
    SourceFile f = l.getFile();
    int id = f.getId();
    int line = l.getLine();

        setListingPosition(id, line);
    }
View Full Code Here


    propertyPut(LIST_LINE, line);

        // if we are running under emacs then dump out our new location
        if (m_fullnameOption)
        {
            SourceFile f = m_fileInfo.getFile(module);
            if (f != null)
            {
                StringBuilder sb = new StringBuilder();
                appendFullnamePosition(sb, f, line);
                sb.append('\n'); // not sure why this is needed but it seems to address some emacs bugs
View Full Code Here

  {
    boolean yes = false;
    Location l = getCurrentLocation();
    if (l != null)
    {
      SourceFile file = l.getFile();
      if (file != null && file.getId() == module && l.getLine() == line)
        yes = true;
    }
    return yes;
  }
View Full Code Here

        else if (nSourceFiles > 1)
        {
            String s = getLocalizationManager().getLocalizedTextString("ambiguousMatchingFilenames") + m_newline; //$NON-NLS-1$
            for (int i = 0; i < nSourceFiles; i++)
            {
                SourceFile sourceFile = sourceFiles[i];
                s += " " + sourceFile.getName() + "#" + sourceFile.getId(); //$NON-NLS-1$ //$NON-NLS-2$
                if (i < nSourceFiles - 1)
                    s += m_newline;
            }
            throw new AmbiguousException(s);
        }
View Full Code Here

   * @see flash.tools.debugger.Session#clearBreakpoint(flash.tools.debugger.Location)
   */
  public Location clearBreakpoint(Location local)
  {
    /* first find it */
    SourceFile source = local.getFile();
    int fileId = source.getId();
    int lineNum = local.getLine();
    int bp = DLocation.encodeId(fileId, lineNum);
    int isolateId = local.getIsolateId();
    Location l = null;
    l = m_manager.getBreakpoint(bp, isolateId);
View Full Code Here

    int size = files.size();
    for(int i=0; i<size; i++)
    {
      boolean addIt = false;

      SourceFile fi = files.get(i);
      // no filter currently in place so we add the file as long
      // as no duplicates exist.  We use the original Swd full
      // name for matching.
      String fName = fi.getRawName();
      if (m_swfFilter == null)
      {
        // If it exists, then we don't add it!
        if (names.get(fName) == null)
          addIt = true;
View Full Code Here

     * @param f
     * @return
     */
    public SourceFile similarFileInSwf(SwfInfo info, SourceFile f) throws InProgressException
    {
        SourceFile hit = null;
    SourceFile[] files = info.getSourceList(m_session);
    if (!info.isProcessingComplete())
      throw new InProgressException();

    for(int i=0; i<files.length; i++)
View Full Code Here

    // If the matchString already starts with "." (e.g. ".as" or ".mxml"), then dotMatchString
    // will be equal to matchString; otherwise, dotMatchString will be "." + matchString
    String dotMatchString = (matchString.startsWith(".")) ? matchString : ("." + matchString); //$NON-NLS-1$ //$NON-NLS-2$
        for (int i = 0; i < n; i++)
        {
            SourceFile sourceFile = files[i];
      boolean pathExists = (usePath && sourceFile.getFullPath().matches(".*[/\\\\].*")); //$NON-NLS-1$
            String name = pathExists ? sourceFile.getFullPath() : sourceFile.getName();

      // if we are using the full path string, then prefix a '.' to our matching string so that abc.as and Gabc.as don't both hit
      String match = (usePath && pathExists) ? dotMatchString : matchString;

            match = match.replace('/', '.')// get rid of path identifiers and use dots
View Full Code Here

       {
         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, cli.getActiveIsolateId());
         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
                   ActionLocation gapEnd = new ActionLocation(lStart);
                   gapEnd.at--;
                   outputAssembly(cli, swf, lastEnd, gapEnd);
                 }
               }
               lastEnd = lEnd;
             }
             // dump source
             cli.outputSource(module1, i, file.getLine(i));
            
             // obtain the offset, locate it in the swf
             if (offset != 0)
               outputAssembly(cli, swf, lStart, lEnd);
           }
View Full Code Here

   * @see flash.tools.debugger.Session#clearBreakpoint(flash.tools.debugger.Location)
   */
  public Location clearBreakpoint(Location local)
  {
    /* first find it */
    SourceFile source = local.getFile();
    int fileId = source.getId();
    int lineNum = local.getLine();
    int bp = DLocation.encodeId(fileId, lineNum);
    Location l = m_manager.getBreakpoint(bp);
    if (l != null)
    {
View Full Code Here

TOP

Related Classes of flash.tools.debugger.SourceFile

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.