27
27
28
28
class Pugdebug (QObject ):
29
29
30
- init_breakpoints = []
31
30
breakpoints = []
32
31
33
32
def __init__ (self ):
@@ -472,7 +471,7 @@ def start_listening(self):
472
471
473
472
start_debugging = True
474
473
475
- if break_at_first_line == 0 and len (self .init_breakpoints ) == 0 :
474
+ if break_at_first_line == 0 and len (self .breakpoints ) == 0 :
476
475
messageBox = QMessageBox ()
477
476
messageBox .setText ("There are no breakpoints set and the break at"
478
477
" first line setting is turned off." )
@@ -525,7 +524,7 @@ def handle_debugging_started(self):
525
524
return
526
525
527
526
post_start_data = {
528
- 'init_breakpoints ' : self .init_breakpoints
527
+ 'breakpoints ' : self .breakpoints
529
528
}
530
529
self .debugger .post_start_command (post_start_data )
531
530
@@ -563,12 +562,6 @@ def handle_debugging_stopped(self):
563
562
This handler should be called when the connection to
564
563
xdebug is terminated.
565
564
"""
566
- # Only set breakpoints as init_breakpoints
567
- # if there are any breakpoints set
568
- if len (self .breakpoints ) > 0 :
569
- self .init_breakpoints = self .breakpoints
570
- self .breakpoints = []
571
-
572
565
self .main_window .toggle_actions (False )
573
566
574
567
self .main_window .set_debugging_status (2 )
@@ -664,22 +657,22 @@ def set_breakpoint(self, breakpoint):
664
657
"""Set a breakpoint
665
658
666
659
If there is no active debugging session, add the breakpoint data to
667
- the initial breakpoints, highlight the init breakpoints on the line
660
+ the breakpoints, highlight the breakpoints on the line
668
661
numbers of the documents, and show them in the breakpoint viewer.
669
662
670
663
If there is an active debugging session, tell the debugger to set the
671
664
breakpoint.
672
665
"""
673
666
if not self .debugger .is_connected ():
674
- self .init_breakpoints .append (breakpoint )
667
+ self .breakpoints .append (breakpoint )
675
668
676
669
path = breakpoint ['filename' ]
677
670
path = self .__get_path_mapped_to_local (path )
678
671
679
672
document_widget = self .document_viewer .get_document_by_path (path )
680
673
document_widget .rehighlight_breakpoint_lines ()
681
674
682
- self .breakpoint_viewer .set_breakpoints (self .init_breakpoints )
675
+ self .breakpoint_viewer .set_breakpoints (self .breakpoints )
683
676
684
677
return
685
678
@@ -689,7 +682,7 @@ def remove_breakpoint(self, breakpoint):
689
682
"""Remove a breakpoint
690
683
691
684
If there is no active debugging session, just remove the breakpoint
692
- from the initial breakpoints, rehighlight the line numbers for
685
+ from the breakpoints, rehighlight the line numbers for
693
686
breakpoint markers and update the breakpoint viewer.
694
687
695
688
If there is an active debugging session, tell the debugger to remove
@@ -699,17 +692,17 @@ def remove_breakpoint(self, breakpoint):
699
692
path = breakpoint ['filename' ]
700
693
line_number = breakpoint ['lineno' ]
701
694
702
- for init_breakpoint in self .init_breakpoints :
703
- if (init_breakpoint ['filename' ] == path and
704
- init_breakpoint ['lineno' ] == line_number ):
705
- self .init_breakpoints .remove (init_breakpoint )
695
+ for breakpoint in self .breakpoints :
696
+ if (breakpoint ['filename' ] == path and
697
+ breakpoint ['lineno' ] == line_number ):
698
+ self .breakpoints .remove (breakpoint )
706
699
707
700
path = self .__get_path_mapped_to_local (path )
708
701
709
702
document_widget = self .document_viewer .get_document_by_path (path )
710
703
document_widget .rehighlight_breakpoint_lines ()
711
704
712
- self .breakpoint_viewer .set_breakpoints (self .init_breakpoints )
705
+ self .breakpoint_viewer .set_breakpoints (self .breakpoints )
713
706
714
707
return
715
708
@@ -727,20 +720,11 @@ def remove_stale_breakpoints(self, path):
727
720
"""
728
721
remote_path = self .__get_path_mapped_to_remote (path )
729
722
730
- breakpoints = []
731
-
732
- if self .debugger .is_connected ():
733
- breakpoints = list (filter (
734
- lambda breakpoint : breakpoint ['filename' ] != remote_path ,
735
- self .breakpoints
736
- ))
737
- self .breakpoints = breakpoints
738
- else :
739
- breakpoints = list (filter (
740
- lambda breakpoint : breakpoint ['filename' ] != remote_path ,
741
- self .init_breakpoints
742
- ))
743
- self .init_breakpoints = breakpoints
723
+ breakpoints = list (filter (
724
+ lambda breakpoint : breakpoint ['filename' ] != remote_path ,
725
+ self .breakpoints
726
+ ))
727
+ self .breakpoints = breakpoints
744
728
745
729
self .breakpoint_viewer .set_breakpoints (breakpoints )
746
730
@@ -783,11 +767,6 @@ def get_breakpoint(self, path, line_number):
783
767
int (breakpoint ['lineno' ]) == line_number ):
784
768
return breakpoint
785
769
786
- for breakpoint in self .init_breakpoints :
787
- if (breakpoint ['filename' ] == path and
788
- int (breakpoint ['lineno' ]) == line_number ):
789
- return breakpoint
790
-
791
770
return None
792
771
793
772
def handle_breakpoints_listed (self , breakpoints ):
0 commit comments