480 """ |
480 """ |
481 self.__scriptName = os.path.abspath(fn) |
481 self.__scriptName = os.path.abspath(fn) |
482 |
482 |
483 wd = self.translate(wd, False) |
483 wd = self.translate(wd, False) |
484 fn = self.translate(os.path.abspath(fn), False) |
484 fn = self.translate(os.path.abspath(fn), False) |
485 self.__sendCommand('{0}{1}\n'.format( |
485 ## self.__sendCommand('{0}{1}\n'.format( |
486 DebugProtocol.RequestForkMode, repr((autoFork, forkChild)))) |
486 ## DebugProtocol.RequestForkMode, repr((autoFork, forkChild)))) |
487 self.__sendCommand('{0}{1}|{2}|{3}\n'.format( |
487 ## self.__sendCommand('{0}{1}|{2}|{3}\n'.format( |
488 DebugProtocol.RequestRun, wd, fn, |
488 ## DebugProtocol.RequestRun, wd, fn, |
489 str(Utilities.parseOptionString(argv)))) |
489 ## str(Utilities.parseOptionString(argv)))) |
|
490 self.__sendJsonCommand("RequestRun", { |
|
491 "workdir": wd, |
|
492 "filename": fn, |
|
493 "argv": Utilities.parseOptionString(argv), |
|
494 "autofork": autoFork, |
|
495 "forkChild": forkChild, |
|
496 }) |
490 |
497 |
491 def remoteCoverage(self, fn, argv, wd, erase=False): |
498 def remoteCoverage(self, fn, argv, wd, erase=False): |
492 """ |
499 """ |
493 Public method to load a new program to collect coverage data. |
500 Public method to load a new program to collect coverage data. |
494 |
501 |
500 """ |
507 """ |
501 self.__scriptName = os.path.abspath(fn) |
508 self.__scriptName = os.path.abspath(fn) |
502 |
509 |
503 wd = self.translate(wd, False) |
510 wd = self.translate(wd, False) |
504 fn = self.translate(os.path.abspath(fn), False) |
511 fn = self.translate(os.path.abspath(fn), False) |
505 self.__sendCommand('{0}{1}@@{2}@@{3}@@{4:d}\n'.format( |
512 ## self.__sendCommand('{0}{1}@@{2}@@{3}@@{4:d}\n'.format( |
506 DebugProtocol.RequestCoverage, wd, fn, |
513 ## DebugProtocol.RequestCoverage, wd, fn, |
507 str(Utilities.parseOptionString(argv)), |
514 ## str(Utilities.parseOptionString(argv)), |
508 erase)) |
515 ## erase)) |
|
516 self.__sendJsonCommand("RequestCoverage", { |
|
517 "workdir": wd, |
|
518 "filename": fn, |
|
519 "argv": Utilities.parseOptionString(argv), |
|
520 "erase": erase, |
|
521 }) |
509 |
522 |
510 def remoteProfile(self, fn, argv, wd, erase=False): |
523 def remoteProfile(self, fn, argv, wd, erase=False): |
511 """ |
524 """ |
512 Public method to load a new program to collect profiling data. |
525 Public method to load a new program to collect profiling data. |
513 |
526 |
519 """ |
532 """ |
520 self.__scriptName = os.path.abspath(fn) |
533 self.__scriptName = os.path.abspath(fn) |
521 |
534 |
522 wd = self.translate(wd, False) |
535 wd = self.translate(wd, False) |
523 fn = self.translate(os.path.abspath(fn), False) |
536 fn = self.translate(os.path.abspath(fn), False) |
524 self.__sendCommand('{0}{1}|{2}|{3}|{4:d}\n'.format( |
537 ## self.__sendCommand('{0}{1}|{2}|{3}|{4:d}\n'.format( |
525 DebugProtocol.RequestProfile, wd, fn, |
538 ## DebugProtocol.RequestProfile, wd, fn, |
526 str(Utilities.parseOptionString(argv)), erase)) |
539 ## str(Utilities.parseOptionString(argv)), erase)) |
|
540 self.__sendJsonCommand("RequestProfile", { |
|
541 "workdir": wd, |
|
542 "filename": fn, |
|
543 "argv": Utilities.parseOptionString(argv), |
|
544 "erase": erase, |
|
545 }) |
527 |
546 |
528 def remoteStatement(self, stmt): |
547 def remoteStatement(self, stmt): |
529 """ |
548 """ |
530 Public method to execute a Python statement. |
549 Public method to execute a Python statement. |
531 |
550 |
532 @param stmt the Python statement to execute (string). It |
551 @param stmt the Python statement to execute (string). It |
533 should not have a trailing newline. |
552 should not have a trailing newline. |
534 """ |
553 """ |
535 self.__sendCommand('{0}\n'.format(stmt)) |
554 ## self.__sendCommand('{0}\n'.format(stmt)) |
536 self.__sendCommand(DebugProtocol.RequestOK + '\n') |
555 ## self.__sendCommand(DebugProtocol.RequestOK + '\n') |
|
556 self.__sendJsonCommand("ExecuteStatement", { |
|
557 "statement": stmt, |
|
558 }) |
537 |
559 |
538 def remoteStep(self): |
560 def remoteStep(self): |
539 """ |
561 """ |
540 Public method to single step the debugged program. |
562 Public method to single step the debugged program. |
541 """ |
563 """ |
542 self.__sendCommand(DebugProtocol.RequestStep + '\n') |
564 ## self.__sendCommand(DebugProtocol.RequestStep + '\n') |
|
565 self.__sendJsonCommand("RequestStep", {}) |
543 |
566 |
544 def remoteStepOver(self): |
567 def remoteStepOver(self): |
545 """ |
568 """ |
546 Public method to step over the debugged program. |
569 Public method to step over the debugged program. |
547 """ |
570 """ |
548 self.__sendCommand(DebugProtocol.RequestStepOver + '\n') |
571 ## self.__sendCommand(DebugProtocol.RequestStepOver + '\n') |
|
572 self.__sendJsonCommand("RequestStepOver", {}) |
549 |
573 |
550 def remoteStepOut(self): |
574 def remoteStepOut(self): |
551 """ |
575 """ |
552 Public method to step out the debugged program. |
576 Public method to step out the debugged program. |
553 """ |
577 """ |
554 self.__sendCommand(DebugProtocol.RequestStepOut + '\n') |
578 ## self.__sendCommand(DebugProtocol.RequestStepOut + '\n') |
|
579 self.__sendJsonCommand("RequestStepOut", {}) |
555 |
580 |
556 def remoteStepQuit(self): |
581 def remoteStepQuit(self): |
557 """ |
582 """ |
558 Public method to stop the debugged program. |
583 Public method to stop the debugged program. |
559 """ |
584 """ |
560 self.__sendCommand(DebugProtocol.RequestStepQuit + '\n') |
585 ## self.__sendCommand(DebugProtocol.RequestStepQuit + '\n') |
|
586 self.__sendJsonCommand("RequestStepQuit", {}) |
561 |
587 |
562 def remoteContinue(self, special=False): |
588 def remoteContinue(self, special=False): |
563 """ |
589 """ |
564 Public method to continue the debugged program. |
590 Public method to continue the debugged program. |
565 |
591 |
566 @param special flag indicating a special continue operation |
592 @param special flag indicating a special continue operation |
567 """ |
593 """ |
568 self.__sendCommand('{0}{1:d}\n'.format( |
594 ## self.__sendCommand('{0}{1:d}\n'.format( |
569 DebugProtocol.RequestContinue, special)) |
595 ## DebugProtocol.RequestContinue, special)) |
|
596 self.__sendJsonCommand("RequestContinue", { |
|
597 "special": special, |
|
598 }) |
570 |
599 |
571 def remoteBreakpoint(self, fn, line, set, cond=None, temp=False): |
600 def remoteBreakpoint(self, fn, line, set, cond=None, temp=False): |
572 """ |
601 """ |
573 Public method to set or clear a breakpoint. |
602 Public method to set or clear a breakpoint. |
574 |
603 |
986 if resp == DebugProtocol.ResponseWPConditionError: |
1018 if resp == DebugProtocol.ResponseWPConditionError: |
987 cond = line[eoc:-1] |
1019 cond = line[eoc:-1] |
988 self.debugServer.signalClientWatchConditionError(cond) |
1020 self.debugServer.signalClientWatchConditionError(cond) |
989 continue |
1021 continue |
990 |
1022 |
991 if resp == DebugProtocol.ResponseRaw: |
1023 ## if resp == DebugProtocol.ResponseRaw: |
992 prompt, echo = eval(line[eoc:-1]) |
1024 ## prompt, echo = eval(line[eoc:-1]) |
993 self.debugServer.signalClientRawInput(prompt, echo) |
1025 ## self.debugServer.signalClientRawInput(prompt, echo) |
994 continue |
1026 ## continue |
995 |
1027 ## |
996 ## if resp == DebugProtocol.ResponseBanner: |
1028 ## if resp == DebugProtocol.ResponseBanner: |
997 ## version, platform, dbgclient = eval(line[eoc:-1]) |
1029 ## version, platform, dbgclient = eval(line[eoc:-1]) |
998 ## self.debugServer.signalClientBanner( |
1030 ## self.debugServer.signalClientBanner( |
999 ## version, platform, dbgclient) |
1031 ## version, platform, dbgclient) |
1000 ## continue |
1032 ## continue |