eric6/Debugger/DebugServer.py

branch
multi_processing
changeset 7389
770ffcb88be5
parent 7379
72a72fd56494
child 7390
052ce4cf06c6
equal deleted inserted replaced
7386:3de001de249c 7389:770ffcb88be5
9 9
10 10
11 import os 11 import os
12 import sys 12 import sys
13 13
14 from PyQt5.QtCore import pyqtSignal, QModelIndex 14 from PyQt5.QtCore import pyqtSignal, pyqtSlot, QModelIndex
15 from PyQt5.QtNetwork import ( 15 from PyQt5.QtNetwork import (
16 QTcpServer, QHostAddress, QHostInfo, QNetworkInterface 16 QTcpServer, QHostAddress, QHostInfo, QNetworkInterface
17 ) 17 )
18 18
19 from E5Gui.E5Application import e5App 19 from E5Gui.E5Application import e5App
40 @signal clientProcessStdout(str) emitted after the client has sent some 40 @signal clientProcessStdout(str) emitted after the client has sent some
41 output via stdout 41 output via stdout
42 @signal clientProcessStderr(str) emitted after the client has sent some 42 @signal clientProcessStderr(str) emitted after the client has sent some
43 output via stderr 43 output via stderr
44 @signal clientOutput(str) emitted after the client has sent some output 44 @signal clientOutput(str) emitted after the client has sent some output
45 @signal clientRawInputSent() emitted after the data was sent to the 45 @signal clientRawInputSent(debuggerId) emitted after the data was sent
46 debug client 46 to the indicated debug client
47 @signal clientLine(filename, lineno, debuggerId, forStack) emitted after 47 @signal clientLine(filename, lineno, debuggerId, forStack) emitted after
48 the debug client has executed a line of code 48 the debug client has executed a line of code
49 @signal clientStack(stack, debuggerId) emitted after the debug client has 49 @signal clientStack(stack, debuggerId) emitted after the debug client has
50 executed a line of code 50 executed a line of code
51 @signal clientThreadList(currentId, threadList, debuggerId) emitted after 51 @signal clientThreadList(currentId, threadList, debuggerId) emitted after
70 @signal clientExit(int, str, bool, str) emitted after the client has exited 70 @signal clientExit(int, str, bool, str) emitted after the client has exited
71 giving the exit status, an exit message, an indication to be quiet and 71 giving the exit status, an exit message, an indication to be quiet and
72 the ID of the exited client 72 the ID of the exited client
73 @signal lastClientExited() emitted to indicate that the last connected 73 @signal lastClientExited() emitted to indicate that the last connected
74 debug client has terminated 74 debug client has terminated
75 @signal clientClearBreak(filename, lineno) emitted after the debug client 75 @signal clientClearBreak(filename, lineno, debuggerId) emitted after the
76 has decided to clear a temporary breakpoint 76 debug client has decided to clear a temporary breakpoint
77 @signal clientBreakConditionError(fn, lineno) emitted after the client has 77 @signal clientBreakConditionError(fn, lineno, debuggerId) emitted after the
78 signaled a syntax error in a breakpoint condition 78 client has signaled a syntax error in a breakpoint condition
79 @signal clientClearWatch(condition) emitted after the debug client 79 @signal clientClearWatch(condition, debuggerId) emitted after the debug
80 has decided to clear a temporary watch expression 80 client has decided to clear a temporary watch expression
81 @signal clientWatchConditionError(condition) emitted after the client has 81 @signal clientWatchConditionError(condition, debuggerId) emitted after the
82 signaled a syntax error in a watch expression 82 client has signaled a syntax error in a watch expression
83 @signal clientRawInput(prompt, echo) emitted after a raw input request was 83 @signal clientRawInput(prompt, echo, debuggerId) emitted after a raw input
84 received 84 request was received
85 @signal clientBanner(version, platform, dbgclient, venvname) emitted after 85 @signal clientBanner(version, platform, dbgclient, venvname) emitted after
86 the client banner data was received 86 the client banner data was received
87 @signal clientCapabilities(capabilities, cltype, venvname) emitted after 87 @signal clientCapabilities(capabilities, cltype, venvname) emitted after
88 the clients capabilities were received 88 the clients capabilities were received
89 @signal clientCompletionList(completionList, text) emitted after the client 89 @signal clientCompletionList(completionList, text) emitted after the client
120 @signal appendStdout(msg) emitted when a passive debug connection is 120 @signal appendStdout(msg) emitted when a passive debug connection is
121 established or lost 121 established or lost
122 @signal clientDebuggerIds(debuggerIds) emitted to give the list of IDs of 122 @signal clientDebuggerIds(debuggerIds) emitted to give the list of IDs of
123 attached debugger backends 123 attached debugger backends
124 """ 124 """
125 clientClearBreak = pyqtSignal(str, int) 125 clientClearBreak = pyqtSignal(str, int, str)
126 clientClearWatch = pyqtSignal(str) 126 clientClearWatch = pyqtSignal(str, str)
127 # TODO: check this signal for debuggerId
127 clientGone = pyqtSignal(bool) 128 clientGone = pyqtSignal(bool)
128 clientProcessStdout = pyqtSignal(str) 129 clientProcessStdout = pyqtSignal(str)
129 clientProcessStderr = pyqtSignal(str) 130 clientProcessStderr = pyqtSignal(str)
130 clientRawInputSent = pyqtSignal() 131 clientRawInputSent = pyqtSignal(str)
131 clientOutput = pyqtSignal(str) 132 clientOutput = pyqtSignal(str)
132 clientLine = pyqtSignal(str, int, str, bool) 133 clientLine = pyqtSignal(str, int, str, bool)
133 clientStack = pyqtSignal(list, str) 134 clientStack = pyqtSignal(list, str)
134 clientThreadList = pyqtSignal(int, list, str) 135 clientThreadList = pyqtSignal(int, list, str)
135 clientThreadSet = pyqtSignal(str) 136 clientThreadSet = pyqtSignal(str)
139 clientException = pyqtSignal(str, str, list, str) 140 clientException = pyqtSignal(str, str, list, str)
140 clientSyntaxError = pyqtSignal(str, str, int, int, str) 141 clientSyntaxError = pyqtSignal(str, str, int, int, str)
141 clientSignal = pyqtSignal(str, str, int, str, str, str) 142 clientSignal = pyqtSignal(str, str, int, str, str, str)
142 clientExit = pyqtSignal(int, str, bool, str) 143 clientExit = pyqtSignal(int, str, bool, str)
143 lastClientExited = pyqtSignal() 144 lastClientExited = pyqtSignal()
144 clientBreakConditionError = pyqtSignal(str, int) 145 clientBreakConditionError = pyqtSignal(str, int, str)
145 clientWatchConditionError = pyqtSignal(str) 146 clientWatchConditionError = pyqtSignal(str, str)
146 clientRawInput = pyqtSignal(str, bool) 147 clientRawInput = pyqtSignal(str, bool, str)
147 clientBanner = pyqtSignal(str, str, str, str) 148 clientBanner = pyqtSignal(str, str, str, str)
148 clientCapabilities = pyqtSignal(int, str, str) 149 clientCapabilities = pyqtSignal(int, str, str)
149 clientCompletionList = pyqtSignal(list, str) 150 clientCompletionList = pyqtSignal(list, str)
151 # TODO: check this signal for debuggerId
150 clientInterpreterChanged = pyqtSignal(str) 152 clientInterpreterChanged = pyqtSignal(str)
151 clientDebuggerIds = pyqtSignal(list) 153 clientDebuggerIds = pyqtSignal(list)
152 utDiscovered = pyqtSignal(list, str, str) 154 utDiscovered = pyqtSignal(list, str, str)
153 utPrepared = pyqtSignal(int, str, str) 155 utPrepared = pyqtSignal(int, str, str)
154 utStartTest = pyqtSignal(str, str) 156 utStartTest = pyqtSignal(str, str)
192 self.watchpointModel = WatchPointModel(self) 194 self.watchpointModel = WatchPointModel(self)
193 self.watchSpecialCreated = self.tr( 195 self.watchSpecialCreated = self.tr(
194 "created", "must be same as in EditWatchpointDialog") 196 "created", "must be same as in EditWatchpointDialog")
195 self.watchSpecialChanged = self.tr( 197 self.watchSpecialChanged = self.tr(
196 "changed", "must be same as in EditWatchpointDialog") 198 "changed", "must be same as in EditWatchpointDialog")
199
200 # arrays to track already reported issues
201 self.__reportedBreakpointIssues = []
202 self.__reportedWatchpointIssues = []
197 203
198 self.networkInterface = Preferences.getDebugger("NetworkInterface") 204 self.networkInterface = Preferences.getDebugger("NetworkInterface")
199 if self.networkInterface == "all": 205 if self.networkInterface == "all":
200 hostAddress = QHostAddress("0.0.0.0") # QHostAddress.Any) 206 hostAddress = QHostAddress("0.0.0.0") # QHostAddress.Any)
201 elif self.networkInterface == "allv6": 207 elif self.networkInterface == "allv6":
257 self.watchpointModel.rowsInserted.connect(self.__addWatchPoints) 263 self.watchpointModel.rowsInserted.connect(self.__addWatchPoints)
258 264
259 self.__maxVariableSize = Preferences.getDebugger("MaxVariableSize") 265 self.__maxVariableSize = Preferences.getDebugger("MaxVariableSize")
260 266
261 self.__registerDebuggerInterfaces() 267 self.__registerDebuggerInterfaces()
262 268
263 def getHostAddress(self, localhost): 269 def getHostAddress(self, localhost):
264 """ 270 """
265 Public method to get the IP address or hostname the debug server is 271 Public method to get the IP address or hostname the debug server is
266 listening. 272 listening.
267 273
268 @param localhost flag indicating to return the address for localhost 274 @param localhost flag indicating to return the address for localhost
269 (boolean) 275 @type bool
270 @return IP address or hostname (string) 276 @return IP address or hostname
277 @rtype str
271 """ 278 """
272 if self.networkInterface == "all": 279 if self.networkInterface == "all":
273 if localhost: 280 if localhost:
274 return "127.0.0.1" 281 return "127.0.0.1"
275 else: 282 else:
280 else: 287 else:
281 return "{0}@@v6".format(QHostInfo.localHostName()) 288 return "{0}@@v6".format(QHostInfo.localHostName())
282 else: 289 else:
283 return "{0}@@i{1}".format(self.networkInterface, 290 return "{0}@@i{1}".format(self.networkInterface,
284 self.networkInterfaceIndex) 291 self.networkInterfaceIndex)
285 292
286 def __getNetworkInterfaceAndIndex(self, address): 293 def __getNetworkInterfaceAndIndex(self, address):
287 """ 294 """
288 Private method to determine the network interface and the interface 295 Private method to determine the network interface and the interface
289 index. 296 index.
290 297
291 @param address address to determine the info for (string) 298 @param address address to determine the info for
292 @return tuple of network interface name (string) and index (integer) 299 @type str
300 @return tuple of network interface name and index
301 @rtype tuple of (str, int)
293 """ 302 """
294 if address not in ["all", "allv6"]: 303 if address not in ["all", "allv6"]:
295 for networkInterface in QNetworkInterface.allInterfaces(): 304 for networkInterface in QNetworkInterface.allInterfaces():
296 addressEntries = networkInterface.addressEntries() 305 addressEntries = networkInterface.addressEntries()
297 if len(addressEntries) > 0: 306 if len(addressEntries) > 0:
300 address.lower()): 309 address.lower()):
301 return (networkInterface.humanReadableName(), 310 return (networkInterface.humanReadableName(),
302 networkInterface.index()) 311 networkInterface.index())
303 312
304 return "", 0 313 return "", 0
305 314
306 def preferencesChanged(self): 315 def preferencesChanged(self):
307 """ 316 """
308 Public slot to handle the preferencesChanged signal. 317 Public slot to handle the preferencesChanged signal.
309 """ 318 """
310 registeredInterfaces = {} 319 registeredInterfaces = {}
316 for interfaceName, getRegistryData in registeredInterfaces.items(): 325 for interfaceName, getRegistryData in registeredInterfaces.items():
317 self.registerDebuggerInterface(interfaceName, getRegistryData, 326 self.registerDebuggerInterface(interfaceName, getRegistryData,
318 reregister=True) 327 reregister=True)
319 328
320 self.__maxVariableSize = Preferences.getDebugger("MaxVariableSize") 329 self.__maxVariableSize = Preferences.getDebugger("MaxVariableSize")
321 330
322 def registerDebuggerInterface(self, interfaceName, getRegistryData, 331 def registerDebuggerInterface(self, interfaceName, getRegistryData,
323 reregister=False): 332 reregister=False):
324 """ 333 """
325 Public method to register a debugger interface. 334 Public method to register a debugger interface.
326 335
350 for (clientLanguage, clientCapabilities, clientExtensions, 359 for (clientLanguage, clientCapabilities, clientExtensions,
351 interfaceCreator) in registryDataList: 360 interfaceCreator) in registryDataList:
352 self.__debuggerInterfaceRegistry[clientLanguage] = [ 361 self.__debuggerInterfaceRegistry[clientLanguage] = [
353 clientCapabilities, clientExtensions, interfaceCreator, 362 clientCapabilities, clientExtensions, interfaceCreator,
354 interfaceName] 363 interfaceName]
355 364
356 def unregisterDebuggerInterface(self, interfaceName): 365 def unregisterDebuggerInterface(self, interfaceName):
357 """ 366 """
358 Public method to unregister a debugger interface. 367 Public method to unregister a debugger interface.
359 368
360 @param interfaceName interfaceName of the debugger interface 369 @param interfaceName interfaceName of the debugger interface
367 if interfaceName == registryData[-1]: 376 if interfaceName == registryData[-1]:
368 clientLanguages.append(clientLanguage) 377 clientLanguages.append(clientLanguage)
369 for clientLanguage in clientLanguages: 378 for clientLanguage in clientLanguages:
370 del self.__debuggerInterfaceRegistry[clientLanguage] 379 del self.__debuggerInterfaceRegistry[clientLanguage]
371 del self.__debuggerInterfaces[interfaceName] 380 del self.__debuggerInterfaces[interfaceName]
372 381
373 def __findLanguageForExtension(self, ext): 382 def __findLanguageForExtension(self, ext):
374 """ 383 """
375 Private method to get the language associated with a file extension. 384 Private method to get the language associated with a file extension.
376 385
377 @param ext file extension 386 @param ext file extension
382 for language in self.__debuggerInterfaceRegistry: 391 for language in self.__debuggerInterfaceRegistry:
383 if ext in self.__debuggerInterfaceRegistry[language][1]: 392 if ext in self.__debuggerInterfaceRegistry[language][1]:
384 return language 393 return language
385 394
386 return "" 395 return ""
387 396
388 def __registerDebuggerInterfaces(self): 397 def __registerDebuggerInterfaces(self):
389 """ 398 """
390 Private method to register the available internal debugger interfaces. 399 Private method to register the available internal debugger interfaces.
391 """ 400 """
392 for name, interface in DebuggerInterfaces.items(): 401 for name, interface in DebuggerInterfaces.items():
395 components = modName.split('.') 404 components = modName.split('.')
396 for comp in components[1:]: 405 for comp in components[1:]:
397 mod = getattr(mod, comp) 406 mod = getattr(mod, comp)
398 407
399 self.registerDebuggerInterface(name, mod.getRegistryData) 408 self.registerDebuggerInterface(name, mod.getRegistryData)
400 409
401 def getSupportedLanguages(self, shellOnly=False): 410 def getSupportedLanguages(self, shellOnly=False):
402 """ 411 """
403 Public slot to return the supported programming languages. 412 Public slot to return the supported programming languages.
404 413
405 @param shellOnly flag indicating only languages supporting an 414 @param shellOnly flag indicating only languages supporting an
406 interactive shell should be returned 415 interactive shell should be returned
407 @return list of supported languages (list of strings) 416 @type bool
417 @return list of supported languages
418 @rtype list of str
408 """ 419 """
409 languages = list(self.__debuggerInterfaceRegistry.keys()) 420 languages = list(self.__debuggerInterfaceRegistry.keys())
410 try: 421 try:
411 languages.remove("None") 422 languages.remove("None")
412 except ValueError: 423 except ValueError:
416 languages = [lang for lang in languages 427 languages = [lang for lang in languages
417 if self.__debuggerInterfaceRegistry[lang][0] & 428 if self.__debuggerInterfaceRegistry[lang][0] &
418 DebugClientCapabilities.HasShell] 429 DebugClientCapabilities.HasShell]
419 430
420 return languages[:] 431 return languages[:]
421 432
422 def getExtensions(self, language): 433 def getExtensions(self, language):
423 """ 434 """
424 Public slot to get the extensions associated with the given language. 435 Public slot to get the extensions associated with the given language.
425 436
426 @param language language to get extensions for (string) 437 @param language language to get extensions for
438 @type str
427 @return tuple of extensions associated with the language 439 @return tuple of extensions associated with the language
428 (tuple of strings) 440 @rtype tuple of str
429 """ 441 """
430 if language in self.__debuggerInterfaceRegistry: 442 if language in self.__debuggerInterfaceRegistry:
431 return tuple(self.__debuggerInterfaceRegistry[language][1]) 443 return tuple(self.__debuggerInterfaceRegistry[language][1])
432 else: 444 else:
433 return () 445 return ()
434 446
435 def __createDebuggerInterface(self, clientType=None): 447 def __createDebuggerInterface(self, clientType=None):
436 """ 448 """
437 Private slot to create the debugger interface object. 449 Private slot to create the debugger interface object.
438 450
439 @param clientType type of the client interface to be created (string) 451 @param clientType type of the client interface to be created
452 @type str
440 """ 453 """
441 if self.lastClientType != self.clientType or clientType is not None: 454 if self.lastClientType != self.clientType or clientType is not None:
442 if clientType is None: 455 if clientType is None:
443 clientType = self.clientType 456 clientType = self.clientType
444 if clientType in self.__debuggerInterfaceRegistry: 457 if clientType in self.__debuggerInterfaceRegistry:
448 else: 461 else:
449 self.debuggerInterface = ( 462 self.debuggerInterface = (
450 self.__debuggerInterfaceRegistry["None"][2]( 463 self.__debuggerInterfaceRegistry["None"][2](
451 self, self.passive)) 464 self, self.passive))
452 self.clientType = "None" 465 self.clientType = "None"
453 466
454 def __setClientType(self, clType): 467 def __setClientType(self, clType):
455 """ 468 """
456 Private method to set the client type. 469 Private method to set the client type.
457 470
458 @param clType type of client to be started (string) 471 @param clType type of client to be started
472 @type str
459 """ 473 """
460 if clType is not None and clType in self.getSupportedLanguages(): 474 if clType is not None and clType in self.getSupportedLanguages():
461 self.clientType = clType 475 self.clientType = clType
462 Preferences.Prefs.settings.setValue( 476 Preferences.Prefs.settings.setValue(
463 'DebugClient/Type', self.clientType) 477 'DebugClient/Type', self.clientType)
464 478
465 def startClient(self, unplanned=True, clType=None, forProject=False, 479 def startClient(self, unplanned=True, clType=None, forProject=False,
466 runInConsole=False, venvName="", workingDir=None): 480 runInConsole=False, venvName="", workingDir=None):
467 """ 481 """
468 Public method to start a debug client. 482 Public method to start a debug client.
469 483
545 clientInterpreter = "" 559 clientInterpreter = ""
546 560
547 if clientInterpreter != self.clientInterpreter: 561 if clientInterpreter != self.clientInterpreter:
548 self.clientInterpreter = clientInterpreter 562 self.clientInterpreter = clientInterpreter
549 self.clientInterpreterChanged.emit(clientInterpreter) 563 self.clientInterpreterChanged.emit(clientInterpreter)
550 564
551 def __clientProcessOutput(self): 565 def __clientProcessOutput(self):
552 """ 566 """
553 Private slot to process client output received via stdout. 567 Private slot to process client output received via stdout.
554 """ 568 """
555 output = str(self.clientProcess.readAllStandardOutput(), 569 output = str(self.clientProcess.readAllStandardOutput(),
556 Preferences.getSystem("IOEncoding"), 570 Preferences.getSystem("IOEncoding"),
557 'replace') 571 'replace')
558 self.clientProcessStdout.emit(output) 572 self.clientProcessStdout.emit(output)
559 573
560 def __clientProcessError(self): 574 def __clientProcessError(self):
561 """ 575 """
562 Private slot to process client output received via stderr. 576 Private slot to process client output received via stderr.
563 """ 577 """
564 error = str(self.clientProcess.readAllStandardError(), 578 error = str(self.clientProcess.readAllStandardError(),
565 Preferences.getSystem("IOEncoding"), 579 Preferences.getSystem("IOEncoding"),
566 'replace') 580 'replace')
567 self.clientProcessStderr.emit(error) 581 self.clientProcessStderr.emit(error)
568 582
583 @pyqtSlot(str, int)
569 def __clientClearBreakPoint(self, fn, lineno): 584 def __clientClearBreakPoint(self, fn, lineno):
570 """ 585 """
571 Private slot to handle the clientClearBreak signal. 586 Private slot to handle the clientClearBreak signal.
572 587
573 @param fn filename of breakpoint to clear (string) 588 @param fn filename of breakpoint to clear
574 @param lineno line number of breakpoint to clear (integer) 589 @type str
590 @param lineno line number of breakpoint to clear
591 @type int
575 """ 592 """
576 if self.debugging: 593 if self.debugging:
577 index = self.breakpointModel.getBreakPointIndex(fn, lineno) 594 index = self.breakpointModel.getBreakPointIndex(fn, lineno)
578 self.breakpointModel.deleteBreakPointByIndex(index) 595 self.breakpointModel.deleteBreakPointByIndex(index)
579 596 if (fn, lineno) in self.__reportedBreakpointIssues:
597 self.__reportedBreakpointIssues.remove((fn, lineno))
598
580 def __deleteBreakPoints(self, parentIndex, start, end): 599 def __deleteBreakPoints(self, parentIndex, start, end):
581 """ 600 """
582 Private slot to delete breakpoints. 601 Private slot to delete breakpoints.
583 602
584 @param parentIndex index of parent item (QModelIndex) 603 @param parentIndex index of parent item
585 @param start start row (integer) 604 @type QModelIndex
586 @param end end row (integer) 605 @param start start row
606 @type int
607 @param end end row
608 @type int
587 """ 609 """
588 if self.debugging: 610 if self.debugging:
589 for row in range(start, end + 1): 611 for row in range(start, end + 1):
590 index = self.breakpointModel.index(row, 0, parentIndex) 612 index = self.breakpointModel.index(row, 0, parentIndex)
591 fn, lineno = ( 613 fn, lineno = (
592 self.breakpointModel.getBreakPointByIndex(index)[0:2]) 614 self.breakpointModel.getBreakPointByIndex(index)[0:2])
593 # delete the breakpoints of all connected backends 615 # delete the breakpoints of all connected backends
594 self.remoteBreakpoint("", fn, lineno, False) 616 self.remoteBreakpoint("", fn, lineno, False)
595 617 if (fn, lineno) in self.__reportedBreakpointIssues:
618 self.__reportedBreakpointIssues.remove((fn, lineno))
619
596 def __changeBreakPoints(self, startIndex, endIndex): 620 def __changeBreakPoints(self, startIndex, endIndex):
597 """ 621 """
598 Private slot to set changed breakpoints. 622 Private slot to set changed breakpoints.
599 623
600 @param startIndex starting index of the change breakpoins (QModelIndex) 624 @param startIndex starting index of the change breakpoins
601 @param endIndex ending index of the change breakpoins (QModelIndex) 625 @type QModelIndex
626 @param endIndex ending index of the change breakpoins
627 @type QModelIndex
602 """ 628 """
603 if self.debugging: 629 if self.debugging:
604 self.__addBreakPoints( 630 self.__addBreakPoints(
605 QModelIndex(), startIndex.row(), endIndex.row()) 631 QModelIndex(), startIndex.row(), endIndex.row())
606 632
607 def __breakPointDataAboutToBeChanged(self, startIndex, endIndex): 633 def __breakPointDataAboutToBeChanged(self, startIndex, endIndex):
608 """ 634 """
609 Private slot to handle the dataAboutToBeChanged signal of the 635 Private slot to handle the dataAboutToBeChanged signal of the
610 breakpoint model. 636 breakpoint model.
611 637
612 @param startIndex start index of the rows to be changed (QModelIndex) 638 @param startIndex start index of the rows to be changed
613 @param endIndex end index of the rows to be changed (QModelIndex) 639 @type QModelIndex
640 @param endIndex end index of the rows to be changed
641 @type QModelIndex
614 """ 642 """
615 if self.debugging: 643 if self.debugging:
616 self.__deleteBreakPoints( 644 self.__deleteBreakPoints(
617 QModelIndex(), startIndex.row(), endIndex.row()) 645 QModelIndex(), startIndex.row(), endIndex.row())
618 646
619 def __addBreakPoints(self, parentIndex, start, end, debuggerId=""): 647 def __addBreakPoints(self, parentIndex, start, end, debuggerId=""):
620 """ 648 """
621 Private slot to add breakpoints. 649 Private slot to add breakpoints.
622 650
623 @param parentIndex index of parent item 651 @param parentIndex index of parent item
631 @type str 659 @type str
632 """ 660 """
633 if self.debugging: 661 if self.debugging:
634 for row in range(start, end + 1): 662 for row in range(start, end + 1):
635 index = self.breakpointModel.index(row, 0, parentIndex) 663 index = self.breakpointModel.index(row, 0, parentIndex)
636 fn, line, cond, temp, enabled, ignorecount = ( 664 fn, lineno, cond, temp, enabled, ignorecount = (
637 self.breakpointModel.getBreakPointByIndex(index)[:6]) 665 self.breakpointModel.getBreakPointByIndex(index)[:6])
638 self.remoteBreakpoint(debuggerId, fn, line, True, cond, temp) 666
667 if (fn, lineno) in self.__reportedBreakpointIssues:
668 self.__reportedBreakpointIssues.remove((fn, lineno))
669
670 self.remoteBreakpoint(debuggerId, fn, lineno, True, cond, temp)
639 if not enabled: 671 if not enabled:
640 self.__remoteBreakpointEnable(debuggerId, fn, line, False) 672 self.__remoteBreakpointEnable(
673 debuggerId, fn, lineno, False)
641 if ignorecount: 674 if ignorecount:
642 self.__remoteBreakpointIgnore( 675 self.__remoteBreakpointIgnore(
643 debuggerId, fn, line, ignorecount) 676 debuggerId, fn, lineno, ignorecount)
644 677
645 def __makeWatchCondition(self, cond, special): 678 def __makeWatchCondition(self, cond, special):
646 """ 679 """
647 Private method to construct the condition string. 680 Private method to construct the condition string.
648 681
649 @param cond condition (string) 682 @param cond condition
650 @param special special condition (string) 683 @type str
651 @return condition string (string) 684 @param special special condition
685 @type str
686 @return condition string
687 @rtype str
652 """ 688 """
653 if special == "": 689 if special == "":
654 _cond = cond 690 _cond = cond
655 else: 691 else:
656 if special == self.watchSpecialCreated: 692 if special == self.watchSpecialCreated:
657 _cond = "{0} ??created??".format(cond) 693 _cond = "{0} ??created??".format(cond)
658 elif special == self.watchSpecialChanged: 694 elif special == self.watchSpecialChanged:
659 _cond = "{0} ??changed??".format(cond) 695 _cond = "{0} ??changed??".format(cond)
660 return _cond 696 return _cond
661 697
662 def __splitWatchCondition(self, cond): 698 def __splitWatchCondition(self, cond):
663 """ 699 """
664 Private method to split a remote watch expression. 700 Private method to split a remote watch expression.
665 701
666 @param cond remote expression (string) 702 @param cond remote expression
703 @type str
667 @return tuple of local expression (string) and special condition 704 @return tuple of local expression (string) and special condition
668 (string) 705 @rtype str
669 """ 706 """
670 if cond.endswith(" ??created??"): 707 if cond.endswith(" ??created??"):
671 cond, special = cond.split() 708 cond, special = cond.split()
672 special = self.watchSpecialCreated 709 special = self.watchSpecialCreated
673 elif cond.endswith(" ??changed??"): 710 elif cond.endswith(" ??changed??"):
676 else: 713 else:
677 cond = cond 714 cond = cond
678 special = "" 715 special = ""
679 716
680 return cond, special 717 return cond, special
681 718
719 @pyqtSlot(str)
682 def __clientClearWatchPoint(self, condition): 720 def __clientClearWatchPoint(self, condition):
683 """ 721 """
684 Private slot to handle the clientClearWatch signal. 722 Private slot to handle the clientClearWatch signal.
685 723
686 @param condition expression of watch expression to clear (string) 724 @param condition expression of watch expression to clear
725 @type str
687 """ 726 """
688 if self.debugging: 727 if self.debugging:
689 cond, special = self.__splitWatchCondition(condition) 728 cond, special = self.__splitWatchCondition(condition)
690 index = self.watchpointModel.getWatchPointIndex(cond, special) 729 index = self.watchpointModel.getWatchPointIndex(cond, special)
691 self.watchpointModel.deleteWatchPointByIndex(index) 730 self.watchpointModel.deleteWatchPointByIndex(index)
692 731 if condition in self.__reportedWatchpointIssues:
732 self.__reportedWatchpointIssues.remove(condition)
733
693 def __deleteWatchPoints(self, parentIndex, start, end): 734 def __deleteWatchPoints(self, parentIndex, start, end):
694 """ 735 """
695 Private slot to delete watch expressions. 736 Private slot to delete watch expressions.
696 737
697 @param parentIndex index of parent item 738 @param parentIndex index of parent item
706 index = self.watchpointModel.index(row, 0, parentIndex) 747 index = self.watchpointModel.index(row, 0, parentIndex)
707 cond, special = ( 748 cond, special = (
708 self.watchpointModel.getWatchPointByIndex(index)[0:2]) 749 self.watchpointModel.getWatchPointByIndex(index)[0:2])
709 cond = self.__makeWatchCondition(cond, special) 750 cond = self.__makeWatchCondition(cond, special)
710 self.__remoteWatchpoint("", cond, False) 751 self.__remoteWatchpoint("", cond, False)
711 752 if cond in self.__reportedWatchpointIssues:
753 self.__reportedWatchpointIssues.remove(cond)
754
712 def __watchPointDataAboutToBeChanged(self, startIndex, endIndex): 755 def __watchPointDataAboutToBeChanged(self, startIndex, endIndex):
713 """ 756 """
714 Private slot to handle the dataAboutToBeChanged signal of the 757 Private slot to handle the dataAboutToBeChanged signal of the
715 watch expression model. 758 watch expression model.
716 759
720 @type QModelIndex 763 @type QModelIndex
721 """ 764 """
722 if self.debugging: 765 if self.debugging:
723 self.__deleteWatchPoints( 766 self.__deleteWatchPoints(
724 QModelIndex(), startIndex.row(), endIndex.row()) 767 QModelIndex(), startIndex.row(), endIndex.row())
725 768
726 def __addWatchPoints(self, parentIndex, start, end, debuggerId=""): 769 def __addWatchPoints(self, parentIndex, start, end, debuggerId=""):
727 """ 770 """
728 Private slot to set a watch expression. 771 Private slot to set a watch expression.
729 772
730 @param parentIndex index of parent item 773 @param parentIndex index of parent item
741 for row in range(start, end + 1): 784 for row in range(start, end + 1):
742 index = self.watchpointModel.index(row, 0, parentIndex) 785 index = self.watchpointModel.index(row, 0, parentIndex)
743 cond, special, temp, enabled, ignorecount = ( 786 cond, special, temp, enabled, ignorecount = (
744 self.watchpointModel.getWatchPointByIndex(index)[:5]) 787 self.watchpointModel.getWatchPointByIndex(index)[:5])
745 cond = self.__makeWatchCondition(cond, special) 788 cond = self.__makeWatchCondition(cond, special)
789
790 if cond in self.__reportedWatchpointIssues:
791 self.__reportedWatchpointIssues.remove(cond)
792
746 self.__remoteWatchpoint(debuggerId, cond, True, temp) 793 self.__remoteWatchpoint(debuggerId, cond, True, temp)
747 if not enabled: 794 if not enabled:
748 self.__remoteWatchpointEnable(debuggerId, cond, False) 795 self.__remoteWatchpointEnable(debuggerId, cond, False)
749 if ignorecount: 796 if ignorecount:
750 self.__remoteWatchpointIgnore(debuggerId, cond, 797 self.__remoteWatchpointIgnore(debuggerId, cond,
751 ignorecount) 798 ignorecount)
752 799
753 def __changeWatchPoints(self, startIndex, endIndex): 800 def __changeWatchPoints(self, startIndex, endIndex):
754 """ 801 """
755 Private slot to set changed watch expressions. 802 Private slot to set changed watch expressions.
756 803
757 @param startIndex start index of the rows to be changed (QModelIndex) 804 @param startIndex start index of the rows to be changed
758 @param endIndex end index of the rows to be changed (QModelIndex) 805 @type QModelIndex
806 @param endIndex end index of the rows to be changed
807 @type QModelIndex
759 """ 808 """
760 if self.debugging: 809 if self.debugging:
761 self.__addWatchPoints( 810 self.__addWatchPoints(
762 QModelIndex(), startIndex.row(), endIndex.row()) 811 QModelIndex(), startIndex.row(), endIndex.row())
763 812
764 def getClientCapabilities(self, clientType): 813 def getClientCapabilities(self, clientType):
765 """ 814 """
766 Public method to retrieve the debug clients capabilities. 815 Public method to retrieve the debug clients capabilities.
767 816
768 @param clientType debug client type (string) 817 @param clientType debug client type
769 @return debug client capabilities (integer) 818 @type str
819 @return debug client capabilities
820 @rtype int
770 """ 821 """
771 try: 822 try:
772 return self.__debuggerInterfaceRegistry[clientType][0] 823 return self.__debuggerInterfaceRegistry[clientType][0]
773 except KeyError: 824 except KeyError:
774 return 0 # no capabilities 825 return 0 # no capabilities
775 826
776 def getClientInterpreter(self): 827 def getClientInterpreter(self):
777 """ 828 """
778 Public method to get the interpreter of the debug client. 829 Public method to get the interpreter of the debug client.
779 830
780 @return interpreter of the debug client (string) 831 @return interpreter of the debug client
832 @rtype str
781 """ 833 """
782 return self.clientInterpreter 834 return self.clientInterpreter
783 835
784 def getClientType(self): 836 def getClientType(self):
785 """ 837 """
841 elif self.__autoClearShell: 893 elif self.__autoClearShell:
842 self.__autoClearShell = False 894 self.__autoClearShell = False
843 self.remoteBanner() 895 self.remoteBanner()
844 elif self.passive: 896 elif self.passive:
845 self.remoteBanner() 897 self.remoteBanner()
846 898
847 def shutdownServer(self): 899 def shutdownServer(self):
848 """ 900 """
849 Public method to cleanly shut down. 901 Public method to cleanly shut down.
850 902
851 It closes our socket and shuts down 903 It closes our socket and shuts down
852 the debug client. (Needed on Win OS) 904 the debug client. (Needed on Win OS)
853 """ 905 """
854 if self.debuggerInterface is not None: 906 if self.debuggerInterface is not None:
855 self.debuggerInterface.shutdown() 907 self.debuggerInterface.shutdown()
856 908
857 def remoteEnvironment(self, env): 909 def remoteEnvironment(self, env):
858 """ 910 """
859 Public method to set the environment for a program to debug, run, ... 911 Public method to set the environment for a program to debug, run, ...
860 912
861 @param env environment settings (string) 913 @param env environment settings
914 @type str
862 """ 915 """
863 envlist = Utilities.parseEnvironmentString(env) 916 envlist = Utilities.parseEnvironmentString(env)
864 envdict = {} 917 envdict = {}
865 for el in envlist: 918 for el in envlist:
866 try: 919 try:
869 value = value[1:-1] 922 value = value[1:-1]
870 envdict[key] = value 923 envdict[key] = value
871 except ValueError: 924 except ValueError:
872 pass 925 pass
873 self.debuggerInterface.remoteEnvironment(envdict) 926 self.debuggerInterface.remoteEnvironment(envdict)
874 927
875 def remoteLoad(self, venvName, fn, argv, wd, env, autoClearShell=True, 928 def remoteLoad(self, venvName, fn, argv, wd, env, autoClearShell=True,
876 tracePython=False, autoContinue=True, forProject=False, 929 tracePython=False, autoContinue=True, forProject=False,
877 runInConsole=False, autoFork=False, forkChild=False, 930 runInConsole=False, autoFork=False, forkChild=False,
878 clientType="", enableCallTrace=False): 931 clientType="", enableCallTrace=False):
879 """ 932 """
946 autoContinue, autoFork, forkChild) 999 autoContinue, autoFork, forkChild)
947 self.debugging = True 1000 self.debugging = True
948 self.running = True 1001 self.running = True
949 self.__restoreBreakpoints() 1002 self.__restoreBreakpoints()
950 self.__restoreWatchpoints() 1003 self.__restoreWatchpoints()
951 1004
952 def remoteRun(self, venvName, fn, argv, wd, env, autoClearShell=True, 1005 def remoteRun(self, venvName, fn, argv, wd, env, autoClearShell=True,
953 forProject=False, runInConsole=False, autoFork=False, 1006 forProject=False, runInConsole=False, autoFork=False,
954 forkChild=False, clientType=""): 1007 forkChild=False, clientType=""):
955 """ 1008 """
956 Public method to load a new program to run. 1009 Public method to load a new program to run.
1008 self.remoteEnvironment(env) 1061 self.remoteEnvironment(env)
1009 1062
1010 self.debuggerInterface.remoteRun(fn, argv, wd, autoFork, forkChild) 1063 self.debuggerInterface.remoteRun(fn, argv, wd, autoFork, forkChild)
1011 self.debugging = False 1064 self.debugging = False
1012 self.running = True 1065 self.running = True
1013 1066
1014 def remoteCoverage(self, venvName, fn, argv, wd, env, 1067 def remoteCoverage(self, venvName, fn, argv, wd, env,
1015 autoClearShell=True, erase=False, forProject=False, 1068 autoClearShell=True, erase=False, forProject=False,
1016 runInConsole=False, clientType=""): 1069 runInConsole=False, clientType=""):
1017 """ 1070 """
1018 Public method to load a new program to collect coverage data. 1071 Public method to load a new program to collect coverage data.
1069 self.remoteEnvironment(env) 1122 self.remoteEnvironment(env)
1070 1123
1071 self.debuggerInterface.remoteCoverage(fn, argv, wd, erase) 1124 self.debuggerInterface.remoteCoverage(fn, argv, wd, erase)
1072 self.debugging = False 1125 self.debugging = False
1073 self.running = True 1126 self.running = True
1074 1127
1075 def remoteProfile(self, venvName, fn, argv, wd, env, 1128 def remoteProfile(self, venvName, fn, argv, wd, env,
1076 autoClearShell=True, erase=False, forProject=False, 1129 autoClearShell=True, erase=False, forProject=False,
1077 runInConsole=False, clientType=""): 1130 runInConsole=False, clientType=""):
1078 """ 1131 """
1079 Public method to load a new program to collect profiling data. 1132 Public method to load a new program to collect profiling data.
1130 self.remoteEnvironment(env) 1183 self.remoteEnvironment(env)
1131 1184
1132 self.debuggerInterface.remoteProfile(fn, argv, wd, erase) 1185 self.debuggerInterface.remoteProfile(fn, argv, wd, erase)
1133 self.debugging = False 1186 self.debugging = False
1134 self.running = True 1187 self.running = True
1135 1188
1136 def remoteStatement(self, debuggerId, stmt): 1189 def remoteStatement(self, debuggerId, stmt):
1137 """ 1190 """
1138 Public method to execute a Python statement. 1191 Public method to execute a Python statement.
1139 1192
1140 @param debuggerId ID of the debugger backend 1193 @param debuggerId ID of the debugger backend
1141 @type str 1194 @type str
1142 @param stmt the Python statement to execute. 1195 @param stmt the Python statement to execute.
1143 @type str 1196 @type str
1144 """ 1197 """
1145 self.debuggerInterface.remoteStatement(debuggerId, stmt.rstrip()) 1198 self.debuggerInterface.remoteStatement(debuggerId, stmt.rstrip())
1146 1199
1147 def remoteStep(self, debuggerId): 1200 def remoteStep(self, debuggerId):
1148 """ 1201 """
1149 Public method to single step the debugged program. 1202 Public method to single step the debugged program.
1150 1203
1151 @param debuggerId ID of the debugger backend 1204 @param debuggerId ID of the debugger backend
1152 @type str 1205 @type str
1153 """ 1206 """
1154 self.debuggerInterface.remoteStep(debuggerId) 1207 self.debuggerInterface.remoteStep(debuggerId)
1155 1208
1156 def remoteStepOver(self, debuggerId): 1209 def remoteStepOver(self, debuggerId):
1157 """ 1210 """
1158 Public method to step over the debugged program. 1211 Public method to step over the debugged program.
1159 1212
1160 @param debuggerId ID of the debugger backend 1213 @param debuggerId ID of the debugger backend
1161 @type str 1214 @type str
1162 """ 1215 """
1163 self.debuggerInterface.remoteStepOver(debuggerId) 1216 self.debuggerInterface.remoteStepOver(debuggerId)
1164 1217
1165 def remoteStepOut(self, debuggerId): 1218 def remoteStepOut(self, debuggerId):
1166 """ 1219 """
1167 Public method to step out the debugged program. 1220 Public method to step out the debugged program.
1168 1221
1169 @param debuggerId ID of the debugger backend 1222 @param debuggerId ID of the debugger backend
1170 @type str 1223 @type str
1171 """ 1224 """
1172 self.debuggerInterface.remoteStepOut(debuggerId) 1225 self.debuggerInterface.remoteStepOut(debuggerId)
1173 1226
1174 def remoteStepQuit(self, debuggerId): 1227 def remoteStepQuit(self, debuggerId):
1175 """ 1228 """
1176 Public method to stop the debugged program. 1229 Public method to stop the debugged program.
1177 1230
1178 @param debuggerId ID of the debugger backend 1231 @param debuggerId ID of the debugger backend
1179 @type str 1232 @type str
1180 """ 1233 """
1181 self.debuggerInterface.remoteStepQuit(debuggerId) 1234 self.debuggerInterface.remoteStepQuit(debuggerId)
1182 1235
1183 def remoteContinue(self, debuggerId, special=False): 1236 def remoteContinue(self, debuggerId, special=False):
1184 """ 1237 """
1185 Public method to continue the debugged program. 1238 Public method to continue the debugged program.
1186 1239
1187 @param debuggerId ID of the debugger backend 1240 @param debuggerId ID of the debugger backend
1188 @type str 1241 @type str
1189 @param special flag indicating a special continue operation 1242 @param special flag indicating a special continue operation
1190 """ 1243 """
1191 self.debuggerInterface.remoteContinue(debuggerId, special) 1244 self.debuggerInterface.remoteContinue(debuggerId, special)
1192 1245
1193 def remoteMoveIP(self, debuggerId, line): 1246 def remoteMoveIP(self, debuggerId, line):
1194 """ 1247 """
1195 Public method to move the instruction pointer to a different line. 1248 Public method to move the instruction pointer to a different line.
1196 1249
1197 @param debuggerId ID of the debugger backend 1250 @param debuggerId ID of the debugger backend
1198 @type str 1251 @type str
1199 @param line the new line, where execution should be continued 1252 @param line the new line, where execution should be continued
1200 @type int 1253 @type int
1201 """ 1254 """
1202 self.debuggerInterface.remoteMoveIP(debuggerId, line) 1255 self.debuggerInterface.remoteMoveIP(debuggerId, line)
1203 1256
1204 def remoteBreakpoint(self, debuggerId, fn, line, setBreakpoint, cond=None, 1257 def remoteBreakpoint(self, debuggerId, fn, line, setBreakpoint, cond=None,
1205 temp=False): 1258 temp=False):
1206 """ 1259 """
1207 Public method to set or clear a breakpoint. 1260 Public method to set or clear a breakpoint.
1208 1261
1219 @param temp flag indicating a temporary breakpoint 1272 @param temp flag indicating a temporary breakpoint
1220 @type bool 1273 @type bool
1221 """ 1274 """
1222 self.debuggerInterface.remoteBreakpoint( 1275 self.debuggerInterface.remoteBreakpoint(
1223 debuggerId, fn, line, setBreakpoint, cond, temp) 1276 debuggerId, fn, line, setBreakpoint, cond, temp)
1224 1277
1225 def __remoteBreakpointEnable(self, debuggerId, fn, line, enable): 1278 def __remoteBreakpointEnable(self, debuggerId, fn, line, enable):
1226 """ 1279 """
1227 Private method to enable or disable a breakpoint. 1280 Private method to enable or disable a breakpoint.
1228 1281
1229 @param debuggerId ID of the debugger backend 1282 @param debuggerId ID of the debugger backend
1235 @param enable flag indicating enabling or disabling a breakpoint 1288 @param enable flag indicating enabling or disabling a breakpoint
1236 @type bool 1289 @type bool
1237 """ 1290 """
1238 self.debuggerInterface.remoteBreakpointEnable( 1291 self.debuggerInterface.remoteBreakpointEnable(
1239 debuggerId, fn, line, enable) 1292 debuggerId, fn, line, enable)
1240 1293
1241 def __remoteBreakpointIgnore(self, debuggerId, fn, line, count): 1294 def __remoteBreakpointIgnore(self, debuggerId, fn, line, count):
1242 """ 1295 """
1243 Private method to ignore a breakpoint the next couple of occurrences. 1296 Private method to ignore a breakpoint the next couple of occurrences.
1244 1297
1245 @param debuggerId ID of the debugger backend 1298 @param debuggerId ID of the debugger backend
1251 @param count number of occurrences to ignore 1304 @param count number of occurrences to ignore
1252 @type int 1305 @type int
1253 """ 1306 """
1254 self.debuggerInterface.remoteBreakpointIgnore( 1307 self.debuggerInterface.remoteBreakpointIgnore(
1255 debuggerId, fn, line, count) 1308 debuggerId, fn, line, count)
1256 1309
1257 def __remoteWatchpoint(self, debuggerId, cond, setWatch, temp=False): 1310 def __remoteWatchpoint(self, debuggerId, cond, setWatch, temp=False):
1258 """ 1311 """
1259 Private method to set or clear a watch expression. 1312 Private method to set or clear a watch expression.
1260 1313
1261 @param debuggerId ID of the debugger backend 1314 @param debuggerId ID of the debugger backend
1298 @type int 1351 @type int
1299 """ 1352 """
1300 # cond is combination of cond and special (s. watch expression viewer) 1353 # cond is combination of cond and special (s. watch expression viewer)
1301 self.debuggerInterface.remoteWatchpointIgnore(debuggerId, cond, count) 1354 self.debuggerInterface.remoteWatchpointIgnore(debuggerId, cond, count)
1302 1355
1303 def remoteRawInput(self, s): 1356 def remoteRawInput(self, debuggerId, inputString):
1304 """ 1357 """
1305 Public method to send the raw input to the debugged program. 1358 Public method to send the raw input to the debugged program.
1306 1359
1307 @param s the raw input (string) 1360 @param debuggerId ID of the debugger backend
1308 """ 1361 @type str
1309 self.debuggerInterface.remoteRawInput(s) 1362 @param inputString the raw input
1310 self.clientRawInputSent.emit() 1363 @type str
1311 1364 """
1365 self.debuggerInterface.remoteRawInput(debuggerId, inputString)
1366 self.clientRawInputSent.emit(debuggerId)
1367
1312 def remoteThreadList(self, debuggerId): 1368 def remoteThreadList(self, debuggerId):
1313 """ 1369 """
1314 Public method to request the list of threads from the client. 1370 Public method to request the list of threads from the client.
1315 1371
1316 @param debuggerId ID of the debugger backend 1372 @param debuggerId ID of the debugger backend
1317 @type str 1373 @type str
1318 """ 1374 """
1319 self.debuggerInterface.remoteThreadList(debuggerId) 1375 self.debuggerInterface.remoteThreadList(debuggerId)
1320 1376
1321 def remoteSetThread(self, debuggerId, tid): 1377 def remoteSetThread(self, debuggerId, tid):
1322 """ 1378 """
1323 Public method to request to set the given thread as current thread. 1379 Public method to request to set the given thread as current thread.
1324 1380
1325 @param debuggerId ID of the debugger backend 1381 @param debuggerId ID of the debugger backend
1351 @param framenr framenumber of the variables to retrieve 1407 @param framenr framenumber of the variables to retrieve
1352 @type int 1408 @type int
1353 """ 1409 """
1354 self.debuggerInterface.remoteClientVariables( 1410 self.debuggerInterface.remoteClientVariables(
1355 debuggerId, scope, filterList, framenr, self.__maxVariableSize) 1411 debuggerId, scope, filterList, framenr, self.__maxVariableSize)
1356 1412
1357 def remoteClientVariable(self, debuggerId, scope, filterList, var, 1413 def remoteClientVariable(self, debuggerId, scope, filterList, var,
1358 framenr=0, maxSize=0): 1414 framenr=0, maxSize=0):
1359 """ 1415 """
1360 Public method to request the variables of the debugged program. 1416 Public method to request the variables of the debugged program.
1361 1417
1375 @type int 1431 @type int
1376 """ 1432 """
1377 self.debuggerInterface.remoteClientVariable( 1433 self.debuggerInterface.remoteClientVariable(
1378 debuggerId, scope, filterList, var, framenr, 1434 debuggerId, scope, filterList, var, framenr,
1379 self.__maxVariableSize) 1435 self.__maxVariableSize)
1380 1436
1381 def remoteClientSetFilter(self, scope, filterStr): 1437 def remoteClientSetFilter(self, debuggerId, scope, filterStr):
1382 """ 1438 """
1383 Public method to set a variables filter list. 1439 Public method to set a variables filter list.
1384 1440
1441 @param debuggerId ID of the debugger backend
1442 @type str
1385 @param scope the scope of the variables (0 = local, 1 = global) 1443 @param scope the scope of the variables (0 = local, 1 = global)
1444 @type int
1386 @param filterStr regexp string for variable names to filter out 1445 @param filterStr regexp string for variable names to filter out
1387 (string) 1446 @type str
1388 """ 1447 """
1389 self.debuggerInterface.remoteClientSetFilter(scope, filterStr) 1448 self.debuggerInterface.remoteClientSetFilter(
1390 1449 debuggerId, scope, filterStr)
1450
1391 def setCallTraceEnabled(self, debuggerId, on): 1451 def setCallTraceEnabled(self, debuggerId, on):
1392 """ 1452 """
1393 Public method to set the call trace state. 1453 Public method to set the call trace state.
1394 1454
1395 @param debuggerId ID of the debugger backend 1455 @param debuggerId ID of the debugger backend
1396 @type str 1456 @type str
1397 @param on flag indicating to enable the call trace function 1457 @param on flag indicating to enable the call trace function
1398 @type bool 1458 @type bool
1399 """ 1459 """
1400 self.debuggerInterface.setCallTraceEnabled(debuggerId, on) 1460 self.debuggerInterface.setCallTraceEnabled(debuggerId, on)
1401 1461
1402 def remoteBanner(self): 1462 def remoteBanner(self):
1403 """ 1463 """
1404 Public slot to get the banner info of the remote client. 1464 Public slot to get the banner info of the remote client.
1405 """ 1465 """
1406 self.debuggerInterface.remoteBanner() 1466 self.debuggerInterface.remoteBanner()
1407 1467
1408 def remoteCapabilities(self): 1468 def remoteCapabilities(self):
1409 """ 1469 """
1410 Public slot to get the debug clients capabilities. 1470 Public slot to get the debug clients capabilities.
1411 """ 1471 """
1412 self.debuggerInterface.remoteCapabilities() 1472 self.debuggerInterface.remoteCapabilities()
1413 1473
1414 def remoteCompletion(self, text): 1474 def remoteCompletion(self, text):
1415 """ 1475 """
1416 Public slot to get the a list of possible commandline completions 1476 Public slot to get the a list of possible commandline completions
1417 from the remote client. 1477 from the remote client.
1418 1478
1531 self.running = True 1591 self.running = True
1532 self.debugging = debug 1592 self.debugging = debug
1533 if debug: 1593 if debug:
1534 self.__restoreBreakpoints() 1594 self.__restoreBreakpoints()
1535 self.__restoreWatchpoints() 1595 self.__restoreWatchpoints()
1536 1596
1537 def remoteUTRun(self, debug=False, failfast=False): 1597 def remoteUTRun(self, debug=False, failfast=False):
1538 """ 1598 """
1539 Public method to start a unittest run. 1599 Public method to start a unittest run.
1540 1600
1541 @param debug flag indicating to run unittest with debugging 1601 @param debug flag indicating to run unittest with debugging
1542 @type bool 1602 @type bool
1543 @param failfast flag indicating to stop at the first error 1603 @param failfast flag indicating to stop at the first error
1544 @type bool 1604 @type bool
1545 """ 1605 """
1546 self.debuggerInterface.remoteUTRun(debug, failfast) 1606 self.debuggerInterface.remoteUTRun(debug, failfast)
1547 1607
1548 def remoteUTStop(self): 1608 def remoteUTStop(self):
1549 """ 1609 """
1550 public method to stop a unittest run. 1610 public method to stop a unittest run.
1551 """ 1611 """
1552 self.debuggerInterface.remoteUTStop() 1612 self.debuggerInterface.remoteUTStop()
1553 1613
1554 def signalClientOutput(self, line, debuggerId): 1614 def signalClientOutput(self, line, debuggerId):
1555 """ 1615 """
1556 Public method to process a line of client output. 1616 Public method to process a line of client output.
1557 1617
1558 @param line client output 1618 @param line client output
1562 """ 1622 """
1563 if debuggerId: 1623 if debuggerId:
1564 self.clientOutput.emit("{0}: {1}".format(debuggerId, line)) 1624 self.clientOutput.emit("{0}: {1}".format(debuggerId, line))
1565 else: 1625 else:
1566 self.clientOutput.emit(line) 1626 self.clientOutput.emit(line)
1567 1627
1568 def signalClientLine(self, filename, lineno, debuggerId, forStack=False): 1628 def signalClientLine(self, filename, lineno, debuggerId, forStack=False):
1569 """ 1629 """
1570 Public method to process client position feedback. 1630 Public method to process client position feedback.
1571 1631
1572 @param filename name of the file currently being executed 1632 @param filename name of the file currently being executed
1577 @type str 1637 @type str
1578 @param forStack flag indicating this is for a stack dump 1638 @param forStack flag indicating this is for a stack dump
1579 @type bool 1639 @type bool
1580 """ 1640 """
1581 self.clientLine.emit(filename, lineno, debuggerId, forStack) 1641 self.clientLine.emit(filename, lineno, debuggerId, forStack)
1582 1642
1583 def signalClientStack(self, stack, debuggerId): 1643 def signalClientStack(self, stack, debuggerId):
1584 """ 1644 """
1585 Public method to process a client's stack information. 1645 Public method to process a client's stack information.
1586 1646
1587 @param stack list of stack entries. Each entry is a tuple of three 1647 @param stack list of stack entries. Each entry is a tuple of three
1589 @type list of lists of (string, integer, string) 1649 @type list of lists of (string, integer, string)
1590 @param debuggerId ID of the debugger backend 1650 @param debuggerId ID of the debugger backend
1591 @type str 1651 @type str
1592 """ 1652 """
1593 self.clientStack.emit(stack, debuggerId) 1653 self.clientStack.emit(stack, debuggerId)
1594 1654
1595 def signalClientThreadList(self, currentId, threadList, debuggerId): 1655 def signalClientThreadList(self, currentId, threadList, debuggerId):
1596 """ 1656 """
1597 Public method to process the client thread list info. 1657 Public method to process the client thread list info.
1598 1658
1599 @param currentId id of the current thread 1659 @param currentId id of the current thread
1602 @type list of dict 1662 @type list of dict
1603 @param debuggerId ID of the debugger backend 1663 @param debuggerId ID of the debugger backend
1604 @type str 1664 @type str
1605 """ 1665 """
1606 self.clientThreadList.emit(currentId, threadList, debuggerId) 1666 self.clientThreadList.emit(currentId, threadList, debuggerId)
1607 1667
1608 def signalClientThreadSet(self, debuggerId): 1668 def signalClientThreadSet(self, debuggerId):
1609 """ 1669 """
1610 Public method to handle the change of the client thread. 1670 Public method to handle the change of the client thread.
1611 1671
1612 @param debuggerId ID of the debugger backend 1672 @param debuggerId ID of the debugger backend
1613 @type str 1673 @type str
1614 """ 1674 """
1615 self.clientThreadSet.emit(debuggerId) 1675 self.clientThreadSet.emit(debuggerId)
1616 1676
1617 def signalClientVariables(self, scope, variables, debuggerId): 1677 def signalClientVariables(self, scope, variables, debuggerId):
1618 """ 1678 """
1619 Public method to process the client variables info. 1679 Public method to process the client variables info.
1620 1680
1621 @param scope scope of the variables (-1 = empty global, 1 = global, 1681 @param scope scope of the variables (-1 = empty global, 1 = global,
1625 @type list 1685 @type list
1626 @param debuggerId ID of the debugger backend 1686 @param debuggerId ID of the debugger backend
1627 @type str 1687 @type str
1628 """ 1688 """
1629 self.clientVariables.emit(scope, variables, debuggerId) 1689 self.clientVariables.emit(scope, variables, debuggerId)
1630 1690
1631 def signalClientVariable(self, scope, variables, debuggerId): 1691 def signalClientVariable(self, scope, variables, debuggerId):
1632 """ 1692 """
1633 Public method to process the client variable info. 1693 Public method to process the client variable info.
1634 1694
1635 @param scope scope of the variables (-1 = empty global, 1 = global, 1695 @param scope scope of the variables (-1 = empty global, 1 = global,
1639 @type list 1699 @type list
1640 @param debuggerId ID of the debugger backend 1700 @param debuggerId ID of the debugger backend
1641 @type str 1701 @type str
1642 """ 1702 """
1643 self.clientVariable.emit(scope, variables, debuggerId) 1703 self.clientVariable.emit(scope, variables, debuggerId)
1644 1704
1645 def signalClientStatement(self, more, debuggerId): 1705 def signalClientStatement(self, more, debuggerId):
1646 """ 1706 """
1647 Public method to process the input response from the client. 1707 Public method to process the input response from the client.
1648 1708
1649 @param more flag indicating that more user input is required 1709 @param more flag indicating that more user input is required
1650 @type bool 1710 @type bool
1651 @param debuggerId ID of the debugger backend 1711 @param debuggerId ID of the debugger backend
1652 @type str 1712 @type str
1653 """ 1713 """
1654 self.clientStatement.emit(more, debuggerId) 1714 self.clientStatement.emit(more, debuggerId)
1655 1715
1656 def signalClientException(self, exceptionType, exceptionMessage, 1716 def signalClientException(self, exceptionType, exceptionMessage,
1657 stackTrace, debuggerId): 1717 stackTrace, debuggerId):
1658 """ 1718 """
1659 Public method to process the exception info from the client. 1719 Public method to process the exception info from the client.
1660 1720
1670 @type str 1730 @type str
1671 """ 1731 """
1672 if self.running: 1732 if self.running:
1673 self.clientException.emit(exceptionType, exceptionMessage, 1733 self.clientException.emit(exceptionType, exceptionMessage,
1674 stackTrace, debuggerId) 1734 stackTrace, debuggerId)
1675 1735
1676 def signalClientSyntaxError(self, message, filename, lineNo, characterNo, 1736 def signalClientSyntaxError(self, message, filename, lineNo, characterNo,
1677 debuggerId): 1737 debuggerId):
1678 """ 1738 """
1679 Public method to process a syntax error info from the client. 1739 Public method to process a syntax error info from the client.
1680 1740
1690 @type str 1750 @type str
1691 """ 1751 """
1692 if self.running: 1752 if self.running:
1693 self.clientSyntaxError.emit(message, filename, lineNo, characterNo, 1753 self.clientSyntaxError.emit(message, filename, lineNo, characterNo,
1694 debuggerId) 1754 debuggerId)
1695 1755
1696 def signalClientSignal(self, message, filename, lineNo, 1756 def signalClientSignal(self, message, filename, lineNo,
1697 funcName, funcArgs, debuggerId): 1757 funcName, funcArgs, debuggerId):
1698 """ 1758 """
1699 Public method to process a signal generated on the client side. 1759 Public method to process a signal generated on the client side.
1700 1760
1712 @type str 1772 @type str
1713 """ 1773 """
1714 if self.running: 1774 if self.running:
1715 self.clientSignal.emit(message, filename, lineNo, 1775 self.clientSignal.emit(message, filename, lineNo,
1716 funcName, funcArgs, debuggerId) 1776 funcName, funcArgs, debuggerId)
1717 1777
1718 def signalClientExit(self, status, message, debuggerId): 1778 def signalClientExit(self, status, message, debuggerId):
1719 """ 1779 """
1720 Public method to process the client exit status. 1780 Public method to process the client exit status.
1721 1781
1722 @param status exit code 1782 @param status exit code
1743 self.__createDebuggerInterface("None") 1803 self.__createDebuggerInterface("None")
1744 self.signalClientOutput(self.tr('\nNot connected\n')) 1804 self.signalClientOutput(self.tr('\nNot connected\n'))
1745 self.signalClientStatement(False, "") 1805 self.signalClientStatement(False, "")
1746 self.running = False 1806 self.running = False
1747 1807
1748 def signalClientClearBreak(self, filename, lineno): 1808 def signalClientClearBreak(self, filename, lineno, debuggerId):
1749 """ 1809 """
1750 Public method to process the client clear breakpoint command. 1810 Public method to process the client clear breakpoint command.
1751 1811
1752 @param filename filename of the breakpoint (string) 1812 @param filename filename of the breakpoint
1753 @param lineno line umber of the breakpoint (integer) 1813 @type str
1754 """ 1814 @param lineno line umber of the breakpoint
1755 self.clientClearBreak.emit(filename, lineno) 1815 @type int
1756 1816 @param debuggerId ID of the debugger backend
1757 def signalClientBreakConditionError(self, filename, lineno): 1817 @type str
1818 """
1819 self.clientClearBreak.emit(filename, lineno, debuggerId)
1820
1821 def signalClientBreakConditionError(self, filename, lineno, debuggerId):
1758 """ 1822 """
1759 Public method to process the client breakpoint condition error info. 1823 Public method to process the client breakpoint condition error info.
1760 1824
1761 @param filename filename of the breakpoint (string) 1825 @param filename filename of the breakpoint
1762 @param lineno line umber of the breakpoint (integer) 1826 @type str
1763 """ 1827 @param lineno line umber of the breakpoint
1764 self.clientBreakConditionError.emit(filename, lineno) 1828 @type int
1765 1829 @param debuggerId ID of the debugger backend
1766 def signalClientClearWatch(self, condition): 1830 @type str
1831 """
1832 if (filename, lineno) not in self.__reportedBreakpointIssues:
1833 self.__reportedBreakpointIssues.append((filename, lineno))
1834 self.clientBreakConditionError.emit(filename, lineno, debuggerId)
1835
1836 def signalClientClearWatch(self, condition, debuggerId):
1767 """ 1837 """
1768 Public slot to handle the clientClearWatch signal. 1838 Public slot to handle the clientClearWatch signal.
1769 1839
1770 @param condition expression of watch expression to clear (string) 1840 @param condition expression of watch expression to clear
1771 """ 1841 @type str
1772 self.clientClearWatch.emit(condition) 1842 @param debuggerId ID of the debugger backend
1773 1843 @type str
1774 def signalClientWatchConditionError(self, condition): 1844 """
1845 self.clientClearWatch.emit(condition, debuggerId)
1846
1847 def signalClientWatchConditionError(self, condition, debuggerId):
1775 """ 1848 """
1776 Public method to process the client watch expression error info. 1849 Public method to process the client watch expression error info.
1777 1850
1778 @param condition expression of watch expression to clear (string) 1851 @param condition expression of watch expression to clear
1779 """ 1852 @type str
1780 self.clientWatchConditionError.emit(condition) 1853 @param debuggerId ID of the debugger backend
1781 1854 @type str
1782 def signalClientRawInput(self, prompt, echo): 1855 """
1856 if condition not in self.__reportedWatchpointIssues:
1857 self.__reportedWatchpointIssues.append(condition)
1858 self.clientWatchConditionError.emit(condition, debuggerId)
1859
1860 def signalClientRawInput(self, prompt, echo, debuggerId):
1783 """ 1861 """
1784 Public method to process the client raw input command. 1862 Public method to process the client raw input command.
1785 1863
1786 @param prompt the input prompt (string) 1864 @param prompt the input prompt
1787 @param echo flag indicating an echoing of the input (boolean) 1865 @type str
1788 """ 1866 @param echo flag indicating an echoing of the input
1789 self.clientRawInput.emit(prompt, echo) 1867 @type bool
1790 1868 @param debuggerId ID of the debugger backend
1869 @type str
1870 """
1871 self.clientRawInput.emit(prompt, echo, debuggerId)
1872
1791 def signalClientBanner(self, version, platform, debugClient, venvName): 1873 def signalClientBanner(self, version, platform, debugClient, venvName):
1792 """ 1874 """
1793 Public method to process the client banner info. 1875 Public method to process the client banner info.
1794 1876
1795 @param version interpreter version info 1877 @param version interpreter version info
1818 self.__debuggerInterfaceRegistry[clientType][0] = capabilities 1900 self.__debuggerInterfaceRegistry[clientType][0] = capabilities
1819 self.clientCapabilities.emit(capabilities, clientType, venvName) 1901 self.clientCapabilities.emit(capabilities, clientType, venvName)
1820 except KeyError: 1902 except KeyError:
1821 # ignore silently 1903 # ignore silently
1822 pass 1904 pass
1823 1905
1824 def signalClientCompletionList(self, completionList, text): 1906 def signalClientCompletionList(self, completionList, text):
1825 """ 1907 """
1826 Public method to process the client auto completion info. 1908 Public method to process the client auto completion info.
1827 1909
1828 @param completionList list of possible completions (list of strings) 1910 @param completionList list of possible completions
1829 @param text the text to be completed (string) 1911 @type list of str
1912 @param text the text to be completed
1913 @type str
1830 """ 1914 """
1831 self.clientCompletionList.emit(completionList, text) 1915 self.clientCompletionList.emit(completionList, text)
1832 1916
1833 def signalClientCallTrace(self, isCall, fromFile, fromLine, fromFunction, 1917 def signalClientCallTrace(self, isCall, fromFile, fromLine, fromFunction,
1834 toFile, toLine, toFunction, debuggerId): 1918 toFile, toLine, toFunction, debuggerId):
1835 """ 1919 """
1836 Public method to process the client call trace data. 1920 Public method to process the client call trace data.
1837 1921
1866 @type str 1950 @type str
1867 @param exceptionValue exception message 1951 @param exceptionValue exception message
1868 @type str 1952 @type str
1869 """ 1953 """
1870 self.utDiscovered.emit(testCases, exceptionType, exceptionValue) 1954 self.utDiscovered.emit(testCases, exceptionType, exceptionValue)
1871 1955
1872 def clientUtPrepared(self, result, exceptionType, exceptionValue): 1956 def clientUtPrepared(self, result, exceptionType, exceptionValue):
1873 """ 1957 """
1874 Public method to process the client unittest prepared info. 1958 Public method to process the client unittest prepared info.
1875 1959
1876 @param result number of test cases (0 = error) (integer) 1960 @param result number of test cases (0 = error)
1877 @param exceptionType exception type (string) 1961 @type int
1878 @param exceptionValue exception message (string) 1962 @param exceptionType exception type
1963 @type str
1964 @param exceptionValue exception message
1965 @type str
1879 """ 1966 """
1880 self.utPrepared.emit(result, exceptionType, exceptionValue) 1967 self.utPrepared.emit(result, exceptionType, exceptionValue)
1881 1968
1882 def clientUtStartTest(self, testname, doc): 1969 def clientUtStartTest(self, testname, doc):
1883 """ 1970 """
1884 Public method to process the client start test info. 1971 Public method to process the client start test info.
1885 1972
1886 @param testname name of the test (string) 1973 @param testname name of the test
1887 @param doc short description of the test (string) 1974 @type str
1975 @param doc short description of the test
1976 @type str
1888 """ 1977 """
1889 self.utStartTest.emit(testname, doc) 1978 self.utStartTest.emit(testname, doc)
1890 1979
1891 def clientUtStopTest(self): 1980 def clientUtStopTest(self):
1892 """ 1981 """
1893 Public method to process the client stop test info. 1982 Public method to process the client stop test info.
1894 """ 1983 """
1895 self.utStopTest.emit() 1984 self.utStopTest.emit()
1896 1985
1897 def clientUtTestFailed(self, testname, traceback, testId): 1986 def clientUtTestFailed(self, testname, traceback, testId):
1898 """ 1987 """
1899 Public method to process the client test failed info. 1988 Public method to process the client test failed info.
1900 1989
1901 @param testname name of the test (string) 1990 @param testname name of the test
1902 @param traceback lines of traceback info (list of strings) 1991 @type str
1903 @param testId id of the test (string) 1992 @param traceback lines of traceback info
1993 @type list of str
1994 @param testId id of the test
1995 @type str
1904 """ 1996 """
1905 self.utTestFailed.emit(testname, traceback, testId) 1997 self.utTestFailed.emit(testname, traceback, testId)
1906 1998
1907 def clientUtTestErrored(self, testname, traceback, testId): 1999 def clientUtTestErrored(self, testname, traceback, testId):
1908 """ 2000 """
1909 Public method to process the client test errored info. 2001 Public method to process the client test errored info.
1910 2002
1911 @param testname name of the test (string) 2003 @param testname name of the test
1912 @param traceback lines of traceback info (list of strings) 2004 @type str
1913 @param testId id of the test (string) 2005 @param traceback lines of traceback info
2006 @type list of str
2007 @param testId id of the test
2008 @type str
1914 """ 2009 """
1915 self.utTestErrored.emit(testname, traceback, testId) 2010 self.utTestErrored.emit(testname, traceback, testId)
1916 2011
1917 def clientUtTestSkipped(self, testname, reason, testId): 2012 def clientUtTestSkipped(self, testname, reason, testId):
1918 """ 2013 """
1919 Public method to process the client test skipped info. 2014 Public method to process the client test skipped info.
1920 2015
1921 @param testname name of the test (string) 2016 @param testname name of the test
1922 @param reason reason for skipping the test (string) 2017 @type str
1923 @param testId id of the test (string) 2018 @param reason reason for skipping the test
2019 @type str
2020 @param testId id of the test
2021 @type str
1924 """ 2022 """
1925 self.utTestSkipped.emit(testname, reason, testId) 2023 self.utTestSkipped.emit(testname, reason, testId)
1926 2024
1927 def clientUtTestFailedExpected(self, testname, traceback, testId): 2025 def clientUtTestFailedExpected(self, testname, traceback, testId):
1928 """ 2026 """
1929 Public method to process the client test failed expected info. 2027 Public method to process the client test failed expected info.
1930 2028
1931 @param testname name of the test (string) 2029 @param testname name of the test
1932 @param traceback lines of traceback info (list of strings) 2030 @type str
1933 @param testId id of the test (string) 2031 @param traceback lines of traceback info
2032 @type list of str
2033 @param testId id of the test
2034 @type str
1934 """ 2035 """
1935 self.utTestFailedExpected.emit(testname, traceback, testId) 2036 self.utTestFailedExpected.emit(testname, traceback, testId)
1936 2037
1937 def clientUtTestSucceededUnexpected(self, testname, testId): 2038 def clientUtTestSucceededUnexpected(self, testname, testId):
1938 """ 2039 """
1939 Public method to process the client test succeeded unexpected info. 2040 Public method to process the client test succeeded unexpected info.
1940 2041
1941 @param testname name of the test (string) 2042 @param testname name of the test
1942 @param testId id of the test (string) 2043 @type str
2044 @param testId id of the test
2045 @type str
1943 """ 2046 """
1944 self.utTestSucceededUnexpected.emit(testname, testId) 2047 self.utTestSucceededUnexpected.emit(testname, testId)
1945 2048
1946 def clientUtFinished(self, status): 2049 def clientUtFinished(self, status):
1947 """ 2050 """
1948 Public method to process the client unit test finished info. 2051 Public method to process the client unit test finished info.
1949 2052
1950 @param status exit status of the unit test 2053 @param status exit status of the unit test
1953 self.utFinished.emit() 2056 self.utFinished.emit()
1954 2057
1955 self.clientExit.emit(int(status), "", True, "") 2058 self.clientExit.emit(int(status), "", True, "")
1956 self.debugging = False 2059 self.debugging = False
1957 self.running = False 2060 self.running = False
1958 2061
1959 def passiveStartUp(self, fn, exc): 2062 def passiveStartUp(self, fn, exc):
1960 """ 2063 """
1961 Public method to handle a passive debug connection. 2064 Public method to handle a passive debug connection.
1962 2065
1963 @param fn filename of the debugged script (string) 2066 @param fn filename of the debugged script
1964 @param exc flag to enable exception reporting of the IDE (boolean) 2067 @type str
2068 @param exc flag to enable exception reporting of the IDE
2069 @type bool
1965 """ 2070 """
1966 self.appendStdout.emit(self.tr("Passive debug connection received\n")) 2071 self.appendStdout.emit(self.tr("Passive debug connection received\n"))
1967 self.passiveClientExited = False 2072 self.passiveClientExited = False
1968 self.debugging = True 2073 self.debugging = True
1969 self.running = True 2074 self.running = True
1970 self.__restoreBreakpoints() 2075 self.__restoreBreakpoints()
1971 self.__restoreWatchpoints() 2076 self.__restoreWatchpoints()
1972 self.passiveDebugStarted.emit(fn, exc) 2077 self.passiveDebugStarted.emit(fn, exc)
1973 2078
1974 def __passiveShutDown(self): 2079 def __passiveShutDown(self):
1975 """ 2080 """
1976 Private method to shut down a passive debug connection. 2081 Private method to shut down a passive debug connection.
1977 """ 2082 """
1978 self.passiveClientExited = True 2083 self.passiveClientExited = True
1979 self.shutdownServer() 2084 self.shutdownServer()
1980 self.appendStdout.emit(self.tr("Passive debug connection closed\n")) 2085 self.appendStdout.emit(self.tr("Passive debug connection closed\n"))
1981 2086
1982 def __restoreBreakpoints(self, debuggerId=""): 2087 def __restoreBreakpoints(self, debuggerId=""):
1983 """ 2088 """
1984 Private method to restore the breakpoints after a restart. 2089 Private method to restore the breakpoints after a restart.
1985 2090
1986 @param debuggerId ID of the debugger backend to send to. If this is 2091 @param debuggerId ID of the debugger backend to send to. If this is
2007 2112
2008 def getBreakPointModel(self): 2113 def getBreakPointModel(self):
2009 """ 2114 """
2010 Public slot to get a reference to the breakpoint model object. 2115 Public slot to get a reference to the breakpoint model object.
2011 2116
2012 @return reference to the breakpoint model object (BreakPointModel) 2117 @return reference to the breakpoint model object
2118 @rtype BreakPointModel
2013 """ 2119 """
2014 return self.breakpointModel 2120 return self.breakpointModel
2015 2121
2016 def getWatchPointModel(self): 2122 def getWatchPointModel(self):
2017 """ 2123 """
2018 Public slot to get a reference to the watch expression model object. 2124 Public slot to get a reference to the watch expression model object.
2019 2125
2020 @return reference to the watch expression model object 2126 @return reference to the watch expression model object
2021 (WatchPointModel) 2127 @rtype WatchPointModel
2022 """ 2128 """
2023 return self.watchpointModel 2129 return self.watchpointModel
2024 2130
2025 def isConnected(self): 2131 def isConnected(self):
2026 """ 2132 """
2027 Public method to test, if the debug server is connected to a backend. 2133 Public method to test, if the debug server is connected to a backend.
2028 2134
2029 @return flag indicating a connection (boolean) 2135 @return flag indicating a connection
2136 @rtype bool
2030 """ 2137 """
2031 return self.debuggerInterface and self.debuggerInterface.isConnected() 2138 return self.debuggerInterface and self.debuggerInterface.isConnected()
2032 2139
2033 def isDebugging(self): 2140 def isDebugging(self):
2034 """ 2141 """

eric ide

mercurial