def doIt(self, dbg): """ Converts request into python variable """ try: try: xml = "<xml>" frame = pydevd_vars.findFrame(self.thread_id, self.frame_id) xml += pydevd_vars.frameVarsToXML(frame) del frame xml += "</xml>" cmd = dbg.cmdFactory.makeGetFrameMessage(self.sequence, xml) dbg.writer.addCommand(cmd) except pydevd_vars.FrameNotFoundError: #pydevd_vars.dumpFrames(self.thread_id) #don't print this error: frame not found: means that the client is not synchronized (but that's ok) cmd = dbg.cmdFactory.makeErrorMessage(self.sequence, "Frame not found: %s from thread: %s" % (self.frame_id, self.thread_id)) dbg.writer.addCommand(cmd) except: cmd = dbg.cmdFactory.makeErrorMessage(self.sequence, "Error resolving frame: %s from thread: %s" % (self.frame_id, self.thread_id)) dbg.writer.addCommand(cmd)
def doIt(self, dbg): """ Converts request into python variable """ try: frame = pydevd_vars.findFrame(self.thread_id, self.frame_id) if frame is not None: xml = "<xml>" xml += pydevd_vars.frameVarsToXML(frame.f_locals) del frame xml += "</xml>" cmd = dbg.cmdFactory.makeGetFrameMessage(self.sequence, xml) dbg.writer.addCommand(cmd) else: #pydevd_vars.dumpFrames(self.thread_id) #don't print this error: frame not found: means that the client is not synchronized (but that's ok) cmd = dbg.cmdFactory.makeErrorMessage(self.sequence, "Frame not found: %s from thread: %s" % (self.frame_id, self.thread_id)) dbg.writer.addCommand(cmd) except: cmd = dbg.cmdFactory.makeErrorMessage(self.sequence, "Error resolving frame: %s from thread: %s" % (self.frame_id, self.thread_id)) dbg.writer.addCommand(cmd)