Package flash.tools.debugger

Examples of flash.tools.debugger.Location


        sb.append("n   ");

      Iterator<Location> itr = b.getLocations().iterator();
      while(itr.hasNext())
      {
        Location l = itr.next();
        SourceFile file = l.getFile();
        String funcName = (file == null)
          ? getLocalizationManager().getLocalizedTextString("unknownBreakpointLocation") //$NON-NLS-1$
          : file.getFunctionNameForLine(m_session, l.getLine()) ;
        int offset = adjustOffsetForUnitTests((file == null) ? 0 : file.getOffsetForLine(l.getLine()));

        sb.append("0x"); //$NON-NLS-1$
        FieldFormat.formatLongToHex(sb, offset, 8);
        sb.append(' ');

        if (funcName != null)
        {
          Map<String, Object> funcArgs = new HashMap<String, Object>();
          funcArgs.put("functionName", funcName); //$NON-NLS-1$
          sb.append(getLocalizationManager().getLocalizedTextString("inFunctionAt", funcArgs)); //$NON-NLS-1$
        }

        sb.append(file.getName());
        if (file != null)
        {
          sb.append("#"); //$NON-NLS-1$
          sb.append(file.getId());
        }
        sb.append(':');
        sb.append(l.getLine());

        try
        {
          SwfInfo info = m_fileInfo.swfForFile(file);
          Map<String, Object> swfArgs = new HashMap<String, Object>();
View Full Code Here


    boolean validFrame = true;

    // some formatting properties
    int i = frameNumber;

    Location loc = ctx.getLocation();
    SourceFile file = loc.getFile();
    int line = loc.getLine();
    String name = (file == null) ? "<null>" : file.getName(); //$NON-NLS-1$
    String sig = ctx.getCallSignature();
    String func = extractFunctionName(sig);

    // file == null or line < 0 appears to be a terminator for stack info
View Full Code Here

    for(int i=0; i<count; i++)
    {
      BreakAction b = breakpointAt(i);
      int status = b.getStatus();
      boolean isResolved = (status == BreakAction.RESOLVED);
      Location l = b.getLocation();
      SourceFile file = (l != null) ? l.getFile() : null;
      String funcName = (file == null) ? null : file.getFunctionNameForLine(m_session, l.getLine()) ;
      boolean singleSwf = b.isSingleSwf();
      int cmdCount = b.getCommandCount();
      int hits = b.getHits();
      String cond = b.getConditionString();
      boolean silent = b.isSilent();
      int offset = adjustOffsetForUnitTests((file == null) ? 0 : file.getOffsetForLine(l.getLine()));

      int num = b.getId();
      FieldFormat.formatLong(sb, num, 3);
      sb.append(" breakpoint     ");

      if (b.isAutoDisable())
        sb.append("dis  ");
      else if (b.isAutoDelete())
        sb.append("del  ");
      else
        sb.append("keep ");

      if (b.isEnabled())
        sb.append("y   ");
      else
        sb.append("n   ");

      sb.append("0x"); //$NON-NLS-1$
      FieldFormat.formatLongToHex(sb, offset, 8);
      sb.append(' ');

      if (funcName != null)
      {
        Map<String, Object> args = new HashMap<String, Object>();
        args.put("functionName", funcName); //$NON-NLS-1$
        sb.append(getLocalizationManager().getLocalizedTextString("inFunctionAt", args)); //$NON-NLS-1$
      }

      if (file != null)
      {
        sb.append(file.getName());
        if (isResolved && singleSwf)
        {
          sb.append("#"); //$NON-NLS-1$
          sb.append(file.getId());
        }
        sb.append(':');
        sb.append(l.getLine());
      }
      else
      {
        String expr = b.getBreakpointExpression();
        if (expr != null)
View Full Code Here

    }
  }

  Location getCurrentLocation()
  {
    Location where = null;
    try
    {
      Frame[] ar = m_session.getFrames();
      propertyPut(CURRENT_FRAME_DEPTH, (ar.length > 0) ? ar.length : 0);
      where = ( (ar.length > 0) ? ar[0].getLocation() : null);
View Full Code Here

    // clear our current frame display
    propertyPut(DISPLAY_FRAME_NUMBER, 0);

    /* dump a context line to the console */
    Location l = getCurrentLocation();

    // figure out why we stopped
    int reason = SuspendReason.Unknown;
    try { reason = m_session.suspendReason(); } catch(PlayerDebugException pde) {}

    // then see if it because of a swfloaded event
    if( reason == SuspendReason.ScriptLoaded)
    {
            m_fileInfo.setDirty();
      processEvents();
            propagateBreakpoints();
           
            sb.append(getLocalizationManager().getLocalizedTextString("additionalCodeLoaded")); //$NON-NLS-1$
            sb.append(m_newline);

      if (resolveBreakpoints(sb))
        sb.append(getLocalizationManager().getLocalizedTextString("setAdditionalBreakpoints")+m_newline); //$NON-NLS-1$
      else
        sb.append(getLocalizationManager().getLocalizedTextString("fixBreakpoints")+m_newline); //$NON-NLS-1$
    }
    else if ( l == null || l.getFile() == null )
    {
      // no idea where we are ?!?
      propertyPut(LAST_FRAME_DEPTH, 0);
      sb.append(getLocalizationManager().getLocalizedTextString("executionHalted")); //$NON-NLS-1$
      sb.append(' ');

      /** disable this line (and enable the one after) if implementation Extensions are not provided */
      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);
View Full Code Here

      if (bp.getStatus() != BreakAction.RESOLVED)
        continue;

      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);
    }
    catch(NullPointerException npe)
View Full Code Here

                line = result[1];
      }
      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();
//      int start = 0;
//      for (;;)
//      {
//        int bp = breakpointIndexOf(module, line, start, true);
//        if (bp == -1)
//          break; // no more matches
//        boolean isEnabled = breakpointAt(bp).isEnabled();
//        existingBreakpoints.add("" + bp + (isEnabled ? "" : " (disabled)"));
//      }
//      if (existingBreakpoints.size() > 0)
//      {
//        String
//      }

      // go off; create it and set it
            BreakAction b = addBreakpoint(module, line)// throws npe if not able to set
            Location l = b.getLocation();

      int which = b.getId();
      String name = l.getFile().getName();
      int offset  = adjustOffsetForUnitTests(l.getFile().getOffsetForLine(line));

      Map<String, Object> args = new HashMap<String, Object>();
      args.put("breakpointNumber", Integer.toString(which)); //$NON-NLS-1$
      args.put("file", name); //$NON-NLS-1$
      args.put("line", Integer.toString(line)); //$NON-NLS-1$
View Full Code Here

            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)
            {
              args.put("functionName", funcName); //$NON-NLS-1$
              formatString = "resolvedBreakpointToFunction"; //$NON-NLS-1$
View Full Code Here

        // 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$
View Full Code Here

TOP

Related Classes of flash.tools.debugger.Location

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.