def doGetData(self, cmd):
    # backtrace and locals overload the 200 response with a length so we need
    # to send them manually rather than use getAck()
    self.writeToPUT(cmd.upper() + "\n")
    dataResponse = self.readFromPUT().strip()
    debug("dataResponse: " + dataResponse)
    dataMatches = re.search(r'^(\d+)[^0-9]*(\d+)$', dataResponse)
    if dataMatches is not None:
      status = dataMatches.group(1)
      length = int(dataMatches.group(2))
      if status == "200":
        if length == 0:
          debugger_status("No "+cmd)
        else:
          dataStr = ""
          while len(dataStr) < length:
            dataStr += self.readFromPUT(int(len(dataStr) - length))
          if cmd == 'backtrace':
            # Tidy up backtrace
            if dataStr.find('platform/resources/init.lua:') != -1 or dataStr.find('?:0') != -1:
              # Stopped in internal code
              dataStr = re.sub(r' at .*platform/resources/init\.lua:[0-9]*', ' at <internal location>', dataStr)
              dataStr = re.sub(r' at \?:0', ' at <internal location>', dataStr)
            # Elide the project directory from any frames that contain it
            # debug("projectDir: " + self.projectDir + os.path.sep)
            dataStr = re.sub("(?i)" + re.escape('@' + self.projectDir + os.path.sep), '', dataStr)
            stack_output(cmd.title() + ":\n" + dataStr)
          else:
            dataStr = re.sub("(?i)" + re.escape('@' + self.projectDir + os.path.sep), '', dataStr)
            variables_output(cmd.title() + ":\n" + dataStr)
      else:
        debugger_status("Error response from '" + cmd + "' (" + dataResponse + ")")
    else:
      debugger_status("Unparsable response from '" + cmd + "' (" + dataResponse + ")")
dataset/ETHPy150Open coronalabs/CoronaSDK-SublimeText/debugger.py/CoronaDebuggerThread.doGetData/swapped operands of `-`