(self,
resume=None, # type: Optional[Message]
wait=True # type: Optional[bool]
)
| 1518 | self._do_start(*args, **kargs) |
| 1519 | |
| 1520 | def run(self, |
| 1521 | resume=None, # type: Optional[Message] |
| 1522 | wait=True # type: Optional[bool] |
| 1523 | ): |
| 1524 | # type: (...) -> Any |
| 1525 | if resume is None: |
| 1526 | resume = Message(type=_ATMT_Command.RUN) |
| 1527 | self.cmdin.send(resume) |
| 1528 | if wait: |
| 1529 | try: |
| 1530 | c = self.cmdout.recv() |
| 1531 | if c is None: |
| 1532 | return None |
| 1533 | except KeyboardInterrupt: |
| 1534 | self.cmdin.send(Message(type=_ATMT_Command.FREEZE)) |
| 1535 | return None |
| 1536 | if c.type == _ATMT_Command.END: |
| 1537 | return c.result |
| 1538 | elif c.type == _ATMT_Command.INTERCEPT: |
| 1539 | raise self.InterceptionPoint("packet intercepted", state=c.state.state, packet=c.pkt) # noqa: E501 |
| 1540 | elif c.type == _ATMT_Command.SINGLESTEP: |
| 1541 | raise self.Singlestep("singlestep state=[%s]" % c.state.state, state=c.state.state) # noqa: E501 |
| 1542 | elif c.type == _ATMT_Command.BREAKPOINT: |
| 1543 | raise self.Breakpoint("breakpoint triggered on state [%s]" % c.state.state, state=c.state.state) # noqa: E501 |
| 1544 | elif c.type == _ATMT_Command.EXCEPTION: |
| 1545 | # this code comes from the `six` module (`.reraise()`) |
| 1546 | # to raise an exception with specified exc_info. |
| 1547 | value = c.exc_info[0]() if c.exc_info[1] is None else c.exc_info[1] # type: ignore # noqa: E501 |
| 1548 | if value.__traceback__ is not c.exc_info[2]: |
| 1549 | raise value.with_traceback(c.exc_info[2]) |
| 1550 | raise value |
| 1551 | return None |
| 1552 | |
| 1553 | def runbg(self, resume=None, wait=False): |
| 1554 | # type: (Optional[Message], Optional[bool]) -> None |
no test coverage detected