@@ -652,7 +652,10 @@ def __init__(self, conn, *args, **kwargs):
652
652
"""
653
653
# Creates a real breakpoint and connects it with this mirror
654
654
self .conn = conn
655
- self .server_breakpoint = conn .root .set_breakpoint (
655
+ self .server_breakpoint = self ._server_set_breakpoint (* args , ** kwargs )
656
+
657
+ def _server_set_breakpoint (self , * args , ** kwargs ):
658
+ return self .conn .root .set_breakpoint (
656
659
self , hasattr (self , 'stop' ), * args , ** kwargs )
657
660
658
661
def __getattr__ (self , item ):
@@ -670,25 +673,43 @@ def __getattr__(self, item):
670
673
raise AttributeError ()
671
674
return getattr (self .server_breakpoint , item )
672
675
676
+ def __setattr__ (self , name , value ):
677
+ """Set attributes of the real breakpoint."""
678
+ if name in (
679
+ 'enabled' ,
680
+ 'silent' ,
681
+ 'thread' ,
682
+ 'task' ,
683
+ 'ignore_count' ,
684
+ 'hit_count'
685
+ 'condition' ,
686
+ 'commands' ,
687
+ ):
688
+ return setattr (self .server_breakpoint , name , value )
689
+ return super ().__setattr__ (name , value )
690
+
673
691
def exposed_stop (self ):
674
692
# Handle stop() call from the server.
675
693
return self .stop ()
676
694
677
- class FinishBreakpoint :
695
+ class FinishBreakpoint ( Breakpoint ) :
678
696
"""Mirror of ``gdb.FinishBreakpoint`` class.
679
697
680
698
See https://sourceware.org/gdb/onlinedocs/gdb/Finish-Breakpoints-in-Python.html
681
699
for more information.
682
700
"""
683
701
684
- def __init__ (self , conn , * args , ** kwargs ):
702
+ def __init__ (self , * args , ** kwargs ):
685
703
"""Do not create instances of this class directly.
686
704
687
705
Use ``pwnlib.gdb.Gdb.FinishBreakpoint`` instead.
688
706
"""
689
- # Creates a real finish breakpoint and connects it with this mirror
690
- self .conn = conn
691
- self .server_breakpoint = conn .root .set_finish_breakpoint (
707
+ # See https://github.com/pylint-dev/pylint/issues/4228
708
+ # pylint: disable=useless-super-delegation
709
+ super ().__init__ (* args , ** kwargs )
710
+
711
+ def _server_set_breakpoint (self , * args , ** kwargs ):
712
+ return self .conn .root .set_finish_breakpoint (
692
713
self , hasattr (self , 'stop' ), hasattr (self , 'out_of_scope' ),
693
714
* args , ** kwargs )
694
715
@@ -708,10 +729,6 @@ def __getattr__(self, item):
708
729
raise AttributeError ()
709
730
return getattr (self .server_breakpoint , item )
710
731
711
- def exposed_stop (self ):
712
- # Handle stop() call from the server.
713
- return self .stop ()
714
-
715
732
def exposed_out_of_scope (self ):
716
733
# Handle out_of_scope() call from the server.
717
734
return self .out_of_scope ()
0 commit comments