Package flash.tools.debugger

Examples of flash.tools.debugger.Location


    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);

    if (l != null)
    {
      /* send the message */
 
View Full Code Here


  @Override
  public Location setBreakpointWorker(int fileId, int lineNum, int isolateId)
      throws NoResponseException, NotConnectedException {
    /* send the message to the player and await a response */
    Location l = null;
    int bp = DLocation.encodeId(fileId, lineNum);
    int wideLineSize = 0;
    if (supportsWideLineNumbers())
      wideLineSize = 4;
    DMessage dm = DMessageCache.alloc(8 + wideLineSize);
View Full Code Here

   * @see flash.tools.debugger.Session#setBreakpoint(int, int)
   */
  public Location setBreakpoint(int fileId, int lineNum) throws NoResponseException, NotConnectedException
  {
    /* send the message to the player and await a response */
    Location l = null;
    int bp = DLocation.encodeId(fileId, lineNum);

    DMessage dm = DMessageCache.alloc(8);
    dm.setType(DMessage.OutSetBreakpoints);
    dm.putDWord(1);
View Full Code Here

    /* 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)
    {
      /* send the message */
      DMessage dm = DMessageCache.alloc(8);
      dm.setType(DMessage.OutRemoveBreakpoints);
View Full Code Here

        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)
    {
            // since the player takes a long time to provide swf/swd, try 80 * 250ms = ~20s
            if (propertyGet(METADATA_ATTEMPTS) > 0)
          try { waitForMetaData(80); } catch(InProgressException ipe) { }

            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

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.