(self, ptr=None)
Shows AddWatchpointDialog
Shows AddWatchpointDialog
Shows AddWatchpointDialog
def do_addwatchpoint_dlg(self, ptr=None):  # pylint: disable=too-many-branches
        """ Shows AddWatchpointDialog
        """
        watchpoint_dlg = AddWatchpointDialog(self, ptr)
        if watchpoint_dlg.exec_() == QDialog.Accepted:
            mem_r = watchpoint_dlg.acc_read.isChecked()
            mem_w = watchpoint_dlg.acc_write.isChecked()
            mem_x = watchpoint_dlg.acc_execute.isChecked()
            mem_s = watchpoint_dlg.singleshot.isChecked()

            ptr = watchpoint_dlg.text_field.toPlainText()

            if ptr:
                if isinstance(ptr, str):
                    if ptr.startswith('0x') or ptr.startswith('#'):
                        ptr = utils.parse_ptr(ptr)
                    else:
                        try:
                            ptr = int(ptr, 10)
                        except ValueError:
                            pass

                    # int now?
                    if not isinstance(ptr, int):
                        try:
                            ptr = int(
                                self._app_window.dwarf.dwarf_api(
                                    'evaluatePtr', ptr), 16)
                        except ValueError:
                            ptr = 0

                        if ptr == 0:
                            return

                        if not self._app_window.dwarf.dwarf_api(
                                'isValidPointer', ptr):
                            return
                else:
                    return

                mem_val = 0
                if mem_r:
                    mem_val |= self.MEMORY_ACCESS_READ
                if mem_w:
                    mem_val |= self.MEMORY_ACCESS_WRITE
                if mem_x:
                    mem_val |= self.MEMORY_ACCESS_EXECUTE
                if mem_s:
                    mem_val |= self.MEMORY_WATCH_SINGLESHOT

                self.add_address(ptr, mem_val, from_api=False)
def do_addwatchpoint_dlg ( self , ptr = None ) : # pylint: disable=too-many-branches watchpoint_dlg = AddWatchpointDialog ( self , ptr ) if watchpoint_dlg . exec_ ( ) == QDialog . Accepted : mem_r = watchpoint_dlg . acc_read . isChecked ( ) mem_w = watchpoint_dlg . acc_write . isChecked ( ) mem_x = watchpoint_dlg . acc_execute . isChecked ( ) mem_s = watchpoint_dlg . singleshot . isChecked ( ) ptr = watchpoint_dlg . text_field . toPlainText ( ) if ptr : if isinstance ( ptr , str ) : if ptr . startswith ( '0x' ) or ptr . startswith ( '#' ) : ptr = utils . parse_ptr ( ptr ) else : try : ptr = int ( ptr , 10 ) except ValueError : pass # int now? if not isinstance ( ptr , int ) : try : ptr = int ( self . _app_window . dwarf . dwarf_api ( 'evaluatePtr' , ptr ) , 16 ) except ValueError : ptr = 0 if ptr == 0 : return if not self . _app_window . dwarf . dwarf_api ( 'isValidPointer' , ptr ) : return else : return mem_val = 0 if mem_r : mem_val |= self . MEMORY_ACCESS_READ if mem_w : mem_val |= self . MEMORY_ACCESS_WRITE if mem_x : mem_val |= self . MEMORY_ACCESS_EXECUTE if mem_s : mem_val |= self . MEMORY_WATCH_SINGLESHOT self . add_address ( ptr , mem_val , from_api = False )