parameters: (debugger, command, result, dict)
docstring: Start logging GDB remote packets by enabling logging with timestamps and
      thread safe logging. Follow a call to this function with a call to "stop_gdb_log"
      in order to dump out the commands.
docstring_summary: Start logging GDB remote packets by enabling logging with timestamps and
      thread safe logging. Follow a call to this function with a call to "stop_gdb_log"
      in order to dump out the commands.
docstring_tokens: Start logging GDB remote packets by enabling logging with timestamps and thread safe logging . Follow a call to this function with a call to stop_gdb_log in order to dump out the commands .
function: def start_gdb_log(debugger, command, result, dict):
      '''Start logging GDB remote packets by enabling logging with timestamps and
      thread safe logging. Follow a call to this function with a call to "stop_gdb_log"
      in order to dump out the commands.'''
      global g_log_file
      command_args = shlex.split(command)
      usage = "usage: start_gdb_log [options] [<LOGFILEPATH>]"
      description = '''The command enables GDB remote packet logging with timestamps. The packets will be logged to <LOGFILEPATH> if supplied, or a temporary file will be used. Logging stops when stop_gdb_log is called and the packet times will
      be aggregated and displayed.'''
      parser = optparse.OptionParser(
          description=description,
          prog='start_gdb_log',
          usage=usage)
      parser.add_option(
          '-v',
          '--verbose',
          action='store_true',
          dest='verbose',
          help='display verbose debug info',
          default=False)
      try:
          (options, args) = parser.parse_args(command_args)
      except:
          return
  
      if g_log_file:
          result.PutCString(
              'error: logging is already in progress with file "%s"' %
              g_log_file)
      else:
          args_len = len(args)
          if args_len == 0:
              g_log_file = tempfile.mktemp()
          elif len(args) == 1:
              g_log_file = args[0]
  
          if g_log_file:
              debugger.HandleCommand(
                  'log enable --threadsafe --timestamp --file "%s" gdb-remote packets' %
                  g_log_file)
              result.PutCString(
                  "GDB packet logging enable with log file '%s'\nUse the 'stop_gdb_log' command to stop logging and show packet statistics." %
                  g_log_file)
              return
  
          result.PutCString('error: invalid log file path')
      result.PutCString(usage)
function_tokens: def start_gdb_log ( debugger , command , result , dict ) : global g_log_file command_args = shlex . split ( command ) usage = "usage: start_gdb_log [options] [<LOGFILEPATH>]" description = '''The command enables GDB remote packet logging with timestamps. The packets will be logged to <LOGFILEPATH> if supplied, or a temporary file will be used. Logging stops when stop_gdb_log is called and the packet times will
      be aggregated and displayed.''' parser = optparse . OptionParser ( description = description , prog = 'start_gdb_log' , usage = usage ) parser . add_option ( '-v' , '--verbose' , action = 'store_true' , dest = 'verbose' , help = 'display verbose debug info' , default = False ) try : ( options , args ) = parser . parse_args ( command_args ) except : return if g_log_file : result . PutCString ( 'error: logging is already in progress with file "%s"' % g_log_file ) else : args_len = len ( args ) if args_len == 0 : g_log_file = tempfile . mktemp ( ) elif len ( args ) == 1 : g_log_file = args [ 0 ] if g_log_file : debugger . HandleCommand ( 'log enable --threadsafe --timestamp --file "%s" gdb-remote packets' % g_log_file ) result . PutCString ( "GDB packet logging enable with log file '%s'\nUse the 'stop_gdb_log' command to stop logging and show packet statistics." % g_log_file ) return result . PutCString ( 'error: invalid log file path' ) result . PutCString ( usage )