Esempio n. 1
0
  def __init__(self, project, options):
    Analyzer.__init__(self, project)
    self.commands             = {}
    self.commandHelp          = {}
    self.options              = options
    self.parser               = ScriptParser()
    self.done                 = False
    self.colorizer            = Console.colorizer
    self.taskMonitor          = Task.RateLimitedTaskMonitor(self)
    self.profiling            = False
    self.plugins              = []
    self.traceFiles           = {}
    self.customSyntaxCommands = set()
    
    if not self.project.targets:
      Log.warn("Using empty project file.")
      
    if not self.projectHasApiDescription():
      Log.warn("Project file does not contain an API description.")
  
    # Register internal commands  
    self.registerCommand("quit", self.quit)

    # Start receiving task notifications
    Task.setMonitor(self.taskMonitor)

    # Load all plugins
    self._loadPlugins()
Esempio n. 2
0
def main(args):
  # Parse the command line options
  options, args = Options.parseCommandLine(args)
  
  if options.help_commands:
    printCommands()
    return 0

  if not args:
    fail("Command missing. Use one of %s" % ", ".join(getCommands().keys()))
    
  command  = args[0]
  commands = getCommands()
  
  if options.verbose:
    Log.quiet = False
  else:
    Log.debug = lambda msg: None

  if options.quiet:
    Log.quiet = True
  
  if not command in commands:
    fail("Bad command. Use one of %s" % ", ".join(getCommands().keys()))
    
  # Install a task monitor
  taskMon = Task.RateLimitedTaskMonitor(TracyTaskMonitor())
  Task.setMonitor(taskMon)

  # Read the project file
  project = Project.Project(options = options, fileName = options.project)

  getCommands()[command][0](project, options, args[1:])
  return 0
Esempio n. 3
0
def main(args):
    # Parse the command line options
    options, args = Options.parseCommandLine(args)

    if options.help_commands:
        printCommands()
        return 0

    if not args:
        fail("Command missing. Use one of %s" %
             ", ".join(getCommands().keys()))

    command = args[0]
    commands = getCommands()

    if options.verbose:
        Log.quiet = False
    else:
        Log.debug = lambda msg: None

    if options.quiet:
        Log.quiet = True

    if not command in commands:
        fail("Bad command. Use one of %s" % ", ".join(getCommands().keys()))

    # Install a task monitor
    taskMon = Task.RateLimitedTaskMonitor(TracyTaskMonitor())
    Task.setMonitor(taskMon)

    # Read the project file
    project = Project.Project(options=options, fileName=options.project)

    getCommands()[command][0](project, options, args[1:])
    return 0
Esempio n. 4
0
  def createAnalyzer(self, args = []):
    # Parse the command line options
    options, args = Options.parseCommandLine(args)
  
    # Read the project file
    project = Project.Project(options = options, fileName = options.project)

    # Create the interactive analyzer  
    analyzer = Analyzer.InteractiveAnalyzer(project, options)
    
    # Divert the output
    analyzer.reportInfo = self.logInfo
    Task.setMonitor(None)
    
    return analyzer
Esempio n. 5
0
    def createAnalyzer(self, args=[]):
        # Parse the command line options
        options, args = Options.parseCommandLine(args)

        # Read the project file
        project = Project.Project(options=options, fileName=options.project)

        # Create the interactive analyzer
        analyzer = Analyzer.InteractiveAnalyzer(project, options)

        # Divert the output
        analyzer.reportInfo = self.logInfo
        Task.setMonitor(None)

        return analyzer