Package flash.tools.debugger

Examples of flash.tools.debugger.SourceFile


      appendBreakInfo(sb);
      //sb.append("unknown location");
    }
    else
    {
      SourceFile file = l.getFile();
      name = file.getName();
      line = l.getLine();
      String funcName = file.getFunctionNameForLine(m_session, line) ;

      // where were we last time
      int lastModule = propertyGet(LIST_MODULE);
      int lastDepth = propertyGet(LAST_FRAME_DEPTH);

      int thisModule = file.getId();
      int thisDepth = propertyGet(CURRENT_FRAME_DEPTH)// triggered via getCurrentLocation()

      // mark where we stopped
      propertyPut(LAST_FRAME_DEPTH, thisDepth);

      // if we have changed our context or we are not spitting out source then dump our location
      if (!postStep || lastModule != thisModule || lastDepth != thisDepth )
      {
        // is it a fault?
        String reasonForHalting;
        if ( reason == SuspendReason.Fault || reason == SuspendReason.StopRequest)
        {
          StringBuilder s = new StringBuilder();
          appendReason(s, reason);
          reasonForHalting = s.toString();
        }
        // if its a breakpoint add that information
        else if ( (bp = enabledBreakpointIndexOf(l)) > -1 )
        {
          Map<String, Object> args = new HashMap<String, Object>();
          args.put("breakpointNumber", Integer.toString(breakpointAt(bp).getId())); //$NON-NLS-1$
          reasonForHalting = getLocalizationManager().getLocalizedTextString("hitBreakpoint", args); //$NON-NLS-1$
        }
        else
        {
          reasonForHalting = getLocalizationManager().getLocalizedTextString("executionHalted"); //$NON-NLS-1$
        }

        Map<String, Object> args = new HashMap<String, Object>();
        args.put("reasonForHalting", reasonForHalting); //$NON-NLS-1$
        args.put("fileAndLine", name + ':' + line); //$NON-NLS-1$
        String formatString;
        if (funcName != null)
        {
          args.put("functionName", funcName); //$NON-NLS-1$
          formatString = "haltedInFunction"; //$NON-NLS-1$
        }
        else
        {
          formatString = "haltedInFile"; //$NON-NLS-1$
        }
        sb.append(getLocalizationManager().getLocalizedTextString(formatString, args));

        if (!m_fullnameOption)
          sb.append(m_newline);       
      }

            // set current listing poistion and emit emacs trigger
            setListingPosition(thisModule, line);

      // dump our source line if not in emacs mode
      if (!m_fullnameOption)
        appendSource(sb, file.getId(), line, file.getLine(line), false);
    }
  }
View Full Code Here


      try
      {
        Location l = bp.getLocation();
        int line = l.getLine();
        SourceFile f = l.getFile();
        Location newLoc = findAndEnableBreak(swf, f, line);
        if (newLoc != null)
          bp.addLocation(newLoc);
      }
      catch(InProgressException ipe)
View Full Code Here

  void doHome()
  {
    try
    {
      Location l = getCurrentLocation();
      SourceFile file = l.getFile();
      int module = file.getId();
      int line = l.getLine();

      // now set it
            setListingPosition(module, line);
    }
View Full Code Here

      }
      else
      {
        // no parameter mean use current location;  null pointer if nothing works
        Location l = getCurrentLocation();
        SourceFile file = l.getFile();
        module = file.getId();
        line = l.getLine();
      }

//      // check to see if there are any existing breakpoints at this file/line
//      LinkedList existingBreakpoints = new LinkedList();
View Full Code Here

     * @return object associated with breakpoint
     */
    BreakAction addBreakpoint(int fileId, int line) throws NotConnectedException, NullPointerException
    {
    // use fileId SourceFile to denote the name of file in which we wish to set a breakpoint
        SourceFile f = m_fileInfo.getFile(fileId);
    LocationCollection col = enableBreak(f, line);

        BreakAction b = new BreakAction(col)//  throws NullPointerException if collection is null
        b.setEnabled(true);
    b.setSingleSwf(m_fileInfo.isSwfFilterOn());
View Full Code Here

            // whoo-hoo, it resolved!
                    module = result[0];
                    line = result[1];
   
            // use module SourceFile to denote the name of file in which we wish to set a breakpoint
                SourceFile f = m_fileInfo.getFile(module);
            LocationCollection col = enableBreak(f, line);
            if (col.isEmpty())
              throw new NullPointerException(getLocalizationManager().getLocalizedTextString("noExecutableCode")); //$NON-NLS-1$
            b.setLocations(col);
   
            Location l = col.first();
            SourceFile file = (l != null) ? l.getFile() : null;
            String funcName = (file == null) ? null : file.getFunctionNameForLine(m_session, l.getLine()) ;

            Map<String, Object> args = new HashMap<String, Object>();
            String formatString;
            args.put("breakpointNumber", Integer.toString(b.getId())); //$NON-NLS-1$
            String filename = file.getName();
            if (b.isSingleSwf() && file != null)
            {
              filename = filename + "#" + file.getId(); //$NON-NLS-1$
            }
            args.put("file", filename); //$NON-NLS-1$
            args.put("line", new Integer(l.getLine())); //$NON-NLS-1$

            if (funcName != null)
View Full Code Here

  Location findAndEnableBreak(SwfInfo swf, SourceFile f, int line) throws NotConnectedException, InProgressException
  {
    int fileId = f.getId();
    if (swf != null)
    {
      SourceFile sameFile = m_fileInfo.similarFileInSwf(swf, f);
      if (sameFile != null)
        fileId = sameFile.getId();
      else
        fileId = -1;
    }

    Location l = (fileId > -1) ? breakEnableRequest(fileId, line) : null;
View Full Code Here

    // 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

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.