Sha256: 4f765fcf15ee7eafab9765988389a899cc9e3d7c22888e3769714f1fc167629e

Contents?: true

Size: 1.92 KB

Versions: 46

Compression:

Stored size: 1.92 KB

Contents

#!/usr/bin/env ruby

class FakeFDB

  def initialize
    str = "Adobe fdb (Flash Player Debugger) [build 16076]\n"
    str << "Copyright (c) 2004-2007 Adobe, Inc. All rights reserved.\n"
    str << "(fdb) "
    printf str
    gather_input
  end

  def gather_input
    $stdout.flush
    command = $stdin.gets.chomp!
    parts = command.split(' ')
    name = parts.shift

    case name
    when "run"
      handle_run parts
    when "break"
      handle_break parts
    when "continue"
      handle_continue parts
    when "kill"
      handle_kill parts
    when "y"
      handle_confirmation parts
    when "quit"
      handle_quit parts
    when "run_with_error"
      handle_run_with_error parts
    else
      puts "FAKE FDB doesn't know how to respond to #{command}"
      exit 1
    end

    gather_input
  end

  def handle_run args
    str = "Waiting for Player to connect\n"
    str << "Player connected; session starting.\n"
    str << "Set breakpoints and then type 'continue' to resume the session.\n"
    str = "[SWF] Users:lbayes:Projects:AsUnit-P2:asunit-4.0:bin:AsUnitRunner.swf - 226,833 bytes after decompression\n"
    str << "(fdb) "
    printf str
  end

  def handle_break args
    str = "Breakpoint 1, AsUnitRunner() at AsUnitRunner.as:12\n"
    str << "12                core = new TextCore();\n"
    str << "(fdb) "
    printf str
  end

  def handle_continue args
    str = "Continuing now\n"
    str << "(fdb) "
    printf str
  end

  def handle_kill args
    printf "Kill the program being debugged? (y or n) "
  end

  def handle_confirmation args
    str = "Confirmation accepted\n"
    str << "(fdb) "
    printf str
  end

  def handle_run_with_error args
    str = "This is an error!\n"
    str << "This is more details about the error!\n"
    str << "Here are even more details!\n"
    $stderr.printf str
    printf "(fdb) "
  end

  def handle_quit args
    puts ">> EXITING NOW!\n"
    exit! 0
  end

end

fake_fdb = FakeFDB.new

Version data entries

46 entries across 46 versions & 4 rubygems

Version Path
h4oflashsdk-1.0.13 test/fixtures/sdk/fdb
h4oflashsdk-1.0.12 test/fixtures/sdk/fdb
h4oflashsdk-1.0.11 test/fixtures/sdk/fdb
h4oflashsdk-1.0.10 test/fixtures/sdk/fdb
h4oflashsdk-1.0.9 test/fixtures/sdk/fdb
h4oflashsdk-1.0.8 test/fixtures/sdk/fdb
h4oflashsdk-1.0.7 test/fixtures/sdk/fdb
h4oflashsdk-1.0.6 test/fixtures/sdk/fdb
h4oflashsdk-1.0.5 test/fixtures/sdk/fdb
h4oflashsdk-1.0.4 test/fixtures/sdk/fdb
h4oflashsdk-1.0.3 test/fixtures/sdk/fdb
h4oflashsdk-1.0.2 test/fixtures/sdk/fdb
h4oflashsdk-1.0.1 test/fixtures/sdk/fdb
h4oflashsdk-1.0.0 test/fixtures/sdk/fdb
flashsdk_sqe-0.0.14 test/fixtures/sdk/fdb
flashsdk_sqe-0.0.13 test/fixtures/sdk/fdb
flashsdk_sqe-0.0.12 test/fixtures/sdk/fdb
flashsdk_sqe-0.0.11 test/fixtures/sdk/fdb
flashsdk_sqe-0.0.10 test/fixtures/sdk/fdb
flashsdk_sqe-0.0.9 test/fixtures/sdk/fdb