MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / InternalGetBreakpointException

Class InternalGetBreakpointException

_pydevd_bundle/pydevd_comm.py:1623–1659  ·  view source on GitHub ↗

Send details of exception raised while evaluating conditional breakpoint

Source from the content-addressed store, hash-verified

1621
1622
1623class InternalGetBreakpointException(InternalThreadCommand):
1624 """Send details of exception raised while evaluating conditional breakpoint"""
1625
1626 def __init__(self, thread_id, exc_type, stacktrace):
1627 self.sequence = 0
1628 self.thread_id = thread_id
1629 self.stacktrace = stacktrace
1630 self.exc_type = exc_type
1631
1632 def do_it(self, dbg):
1633 try:
1634 callstack = "<xml>"
1635
1636 makeValid = pydevd_xml.make_valid_xml_value
1637
1638 for filename, line, methodname, methodobj in self.stacktrace:
1639 if not filesystem_encoding_is_utf8 and hasattr(filename, "decode"):
1640 # filename is a byte string encoded using the file system encoding
1641 # convert it to utf8
1642 filename = filename.decode(file_system_encoding).encode("utf-8")
1643
1644 callstack += '<frame thread_id = "%s" file="%s" line="%s" name="%s" obj="%s" />' % (
1645 self.thread_id,
1646 makeValid(filename),
1647 line,
1648 makeValid(methodname),
1649 makeValid(methodobj),
1650 )
1651 callstack += "</xml>"
1652
1653 cmd = dbg.cmd_factory.make_send_breakpoint_exception_message(self.sequence, self.exc_type + "\t" + callstack)
1654 dbg.writer.add_command(cmd)
1655 except:
1656 exc = get_exception_traceback_str()
1657 sys.stderr.write("%s\n" % (exc,))
1658 cmd = dbg.cmd_factory.make_error_message(self.sequence, "Error Sending Exception: " + exc)
1659 dbg.writer.add_command(cmd)
1660
1661
1662class InternalSendCurrExceptionTrace(InternalThreadCommand):

Calls

no outgoing calls

Tested by

no test coverage detected