Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
myLine = str(curFrame.f_lineno)
#print "line is ", myLine
#the variables are all gotten 'on-demand'
#variables = pydevd_vars.frameVarsToXML(curFrame)
variables = ''
cmdTextList.append('"' % (quote(myFile, '/>_= \t'), myLine))
cmdTextList.append(variables)
cmdTextList.append("")
curFrame = curFrame.f_back
cmdTextList.append("")
cmdText = ''.join(cmdTextList)
return NetCommand(CMD_THREAD_SUSPEND, 0, cmdText)
except:
return self.makeErrorMessage(0, GetExceptionTracebackStr())
def makeGetVariableMessage(self, seq, payload):
try:
return NetCommand(CMD_GET_VARIABLE, seq, payload)
except Exception:
return self.makeErrorMessage(seq, GetExceptionTracebackStr())
def makeIoMessage(self, v, ctx, dbg=None):
'''
@param v: the message to pass to the debug server
@param ctx: 1 for stdio 2 for stderr
@param dbg: If not none, add to the writer
'''
try:
if len(v) > MAX_IO_MSG_SIZE:
v = v[0:MAX_IO_MSG_SIZE]
v += '...'
v = pydevd_vars.makeValidXmlValue(quote(v, '/>_= \t'))
net = NetCommand(str(CMD_WRITE_TO_CONSOLE), 0, '' % (v, ctx))
if dbg:
dbg.writer.addCommand(net)
except:
return self.makeErrorMessage(0, GetExceptionTracebackStr())
def makeListThreadsMessage(self, seq):
""" returns thread listing as XML """
try:
t = threading.enumerate()
cmdText = ""
for i in t:
if t.isAlive():
cmdText += self.threadToXML(i)
cmdText += ""
return NetCommand(CMD_RETURN, seq, cmdText)
except:
return self.makeErrorMessage(seq, GetExceptionTracebackStr())
def makeSendConsoleMessage(self, seq, payload):
try:
return NetCommand(CMD_EVALUATE_CONSOLE_EXPRESSION, seq, payload)
except Exception:
return self.makeErrorMessage(seq, GetExceptionTracebackStr())
def makeVersionMessage(self, seq):
try:
return NetCommand(CMD_VERSION, seq, VERSION_STRING)
except:
return self.makeErrorMessage(seq, GetExceptionTracebackStr())
def makeThreadKilledMessage(self, id):
try:
return NetCommand(CMD_THREAD_KILL, 0, str(id))
except:
return self.makeErrorMessage(0, GetExceptionTracebackStr())
def makeThreadCreatedMessage(self, thread):
cmdText = "" + self.threadToXML(thread) + ""
return NetCommand(CMD_THREAD_CREATE, 0, cmdText)
def makeErrorMessage(self, seq, text):
cmd = NetCommand(CMD_ERROR, seq, text)
if DEBUG_TRACE_LEVEL > 2:
sys.stderr.write("Error: %s" % (text,))
return cmd