def send_message(event_class, time, name, thread_id, type, event, file, line, frame, lock_id=0, parent=None): dbg = GlobalDebuggerHolder.global_dbg if dbg is None: return cmdTextList = ['<xml>'] cmdTextList.append('<' + event_class) cmdTextList.append(' time="%s"' % pydevd_xml.make_valid_xml_value(str(time))) cmdTextList.append(' name="%s"' % pydevd_xml.make_valid_xml_value(name)) cmdTextList.append(' thread_id="%s"' % pydevd_xml.make_valid_xml_value(thread_id)) cmdTextList.append(' type="%s"' % pydevd_xml.make_valid_xml_value(type)) if type == "lock": cmdTextList.append(' lock_id="%s"' % pydevd_xml.make_valid_xml_value(str(lock_id))) if parent is not None: cmdTextList.append(' parent="%s"' % pydevd_xml.make_valid_xml_value(parent)) cmdTextList.append(' event="%s"' % pydevd_xml.make_valid_xml_value(event)) cmdTextList.append(' file="%s"' % pydevd_xml.make_valid_xml_value(file)) cmdTextList.append(' line="%s"' % pydevd_xml.make_valid_xml_value(str(line))) cmdTextList.append('></' + event_class + '>') cmdTextList += get_text_list_for_frame(frame) cmdTextList.append('</xml>') text = ''.join(cmdTextList) if dbg.writer is not None: dbg.writer.add_command(NetCommand(145, 0, text))
def create_signature_message(signature): cmdTextList = ["<xml>"] cmdTextList.append('<call_signature file="%s" name="%s">' % (pydevd_vars.make_valid_xml_value(signature.file), pydevd_vars.make_valid_xml_value(signature.name))) for arg in signature.args: cmdTextList.append('<arg name="%s" type="%s"></arg>' % (pydevd_vars.make_valid_xml_value(arg[0]), pydevd_vars.make_valid_xml_value(arg[1]))) cmdTextList.append("</call_signature></xml>") cmdText = ''.join(cmdTextList) return NetCommand(CMD_SIGNATURE_CALL_TRACE, 0, cmdText)