Table of Contents

Eric3 Source Documentation: Debugger  
-í
* ?cs§dZ	dkZdkZ
dkZdkZdkZdklZlZdk	l
Z
lZdkTdk
Z
de
fd„ƒYZdS(s'
Module implementing the debug server.
N(sSIGNALsPYSIGNAL(s
QServerSocketsQSocket(s*sDebugServercsŽtZdZ<=d„ZSd„Zƒd„Z¡d„Zºd„ZÑd„Zçd„Z	ÿd„Z
d	„Z#d
„Z)d„Z
/d„Z5d
„Z;d„ZAd„Z[d„Zfdd„Ztd„Z~d„Zˆd„ZŽd„ZÖd„Zßd„Zçdd„Z÷d„Zd„Zd„Zd„Zd„Z)d „Z :d!„Z!RS("s™
    Class implementing the debug server embedded within the IDE.
    
    Signals
    
        clientRawInputSent -- emitted after the data was sent to the debug client
        
        clientLine(filename, lineno) -- emitted after the debug client has executed a
            line of code
        
        clientStack(stack) -- emitted after the debug client has executed a
            line of code
            
        clientVariables(variables) -- emitted after a variables dump has been received
        
        clientStatement(boolean) -- emitted after an interactive command has
            been executed. The parameter is 0 to indicate that the command is
            complete and 1 if it needs more input.
            
        clientException(exception) -- emitted after an exception occured on the 
            client side
            
        clientSyntaxError(exception) -- emitted after a syntax error has been detected
            on the client side
            
        clientExit(exitcode) -- emitted after the client has exited
        
        clientRawInput(prompt) -- emitted after a raw input request was received
        
        clientBanner(banner) -- emitted after the client banner was received
        
        passiveDebuStarted -- emitted after the debug client has connected in
            passive debug mode
            
        clientGone -- emitted if the client went away (planned or unplanned)
    csØ=@Atidƒo5Btidƒ}Cti||ƒDd|_n Fti|dƒGd|_It|_Jd|_	Kd|_
Lg|_Mh|_Nd|_
P|ioQ|iƒndS(s
        Constructor
        sPassiveDbgEnabledsPassiveDbgPortiiN(sPreferencessgetDebuggerssockets
QServerSockets__init__sselfspassivesNonesqsocks
progLoadeds	debuggingsqueuesbreakss	clientPIDsstartRemote(sselfssocket((sB/home/detlev/Development/Python/Eric/eric3/Debugger/DebugServer.pys__init__=sc	sSVWtidƒo<Xttidƒƒ}Y|djoZti}nn
\ti}^tidƒ}_|djo&`tii	tidddƒ}n»a|d	jo&btii	tiddd
ƒ}n…c|djo&dtii	tidddƒ}nOfttid
ƒƒ}g|djo&htii	tidddƒ}nj|ioÇky°nti
|itiƒ}o|ddfjo{pti|itiƒqtidƒrti
|itiƒ}s|ddfjotti|itiƒnnWn
uvnXnxtidƒo’ytitiƒƒ}zttidƒƒ}{ttidƒƒ}|titi|}|||tii|ƒ|iƒ
|gƒ|_n2€titi|�|||iƒ
gƒ|_dS(s?
        Private method to start a remote interpreter.
        sCustomPythonInterpretersPythonInterpreterssDebugClientTypeiisDebuggersDebugClient.pyisDebugClientThreads.pyisDebugClientNoQt.pysDebugClientsRemoteDbgEnabledsRemoteExecutions
RemoteHostN( sPreferencessgetDebuggersstrsinterpreterssyss
executablesdebugClientTypesosspathsjoinsdebugClientsselfs	clientPIDswaitpidsWNOHANGsstatusskillssignalsSIGTERMstimessleepsSIGKILLssockets
gethostbynamesgethostnamesipaddrsrexecsrhostsspawnvsP_NOWAITsabspathsport(sselfsstatussipaddrsdebugClientTypesdebugClientsrexecsrhostsinterpreter((sB/home/detlev/Development/Python/Eric/eric3/Debugger/DebugServer.pysstartRemoteSsF&&&&
%8cs䃊‹tƒ}Œ|i|ƒ�|itj	o‘dSn“|i|tdƒ|i	ƒ”|i|tdƒ|i
ƒ–||_™x'|iD™]}š|ii
|ƒq—Wœg|_ž|ioŸd|_ndS(s‹
        Reimplemented to handle a new connection.
        
        Arguments
        
            sockfd -- the socket descriptor
        NsreadyRead()sconnectionClosed()i(sQSocketssocks	setSocketssockfdsselfsqsocksNonesconnectsSIGNALs
handleLinesstartClientsqueuescmds
writeBlockspassives
progLoaded(sselfssockfdscmdssock((sB/home/detlev/Development/Python/Eric/eric3/Debugger/DebugServer.pys
newConnectionƒs
	
csÄ¡§¨|itjo©dSn¬|i|itdƒ|iƒ­|i|itdƒ|iƒ°|idtƒ±|ii	ƒ³|ii
ƒ¶t|_·d|_¸g|_dS(s—
        Public method to cleanly shut down.
        
        It closes our socket and shuts down
        the debug client. (Needed on Win OS)
        NsconnectionClosed()sreadyRead()s%s
i(
sselfsqsocksNones
disconnectsSIGNALsstartClients
handleLinessendCommandsRequestShutdownsflushscloses
progLoadedsqueue(sself((sB/home/detlev/Development/Python/Eric/eric3/Debugger/DebugServer.pysshutdownServer¡s""cs”ºÅÇ|ioÈ|idƒnÊ|idtt|ƒttii	t|ƒƒƒt|ƒfƒÍd|_Îd|_Ï|i
ƒdS(sF
        Public method to load a new program to debug.
        
        Arguments
        
            fn -- the filename to debug (string)
            
            argv -- the commandline arguments to pass to the program (list of strings)
            
            wd -- the working directory for the program (string)
        is%s%s|%s|%s
iN(sselfs
progLoadedsstartClientssendCommandsRequestLoadsstrswdsosspathsabspathsfnsargvs	debuggingsrestoreBreakpoints(sselfsfnsargvswd((sB/home/detlev/Development/Python/Eric/eric3/Debugger/DebugServer.pys
remoteLoadºs
Dcs‡ÑÜÞ|ioß|idƒná|idtt|ƒttii	t|ƒƒƒt|ƒfƒäd|_åd|_dS(sB
        Public method to load a new program to run.
        
        Arguments
        
            fn -- the filename to run (string)
            
            argv -- the commandline arguments to pass to the program (list of strings)
            
            wd -- the working directory for the program (string)
        is%s%s|%s|%s
iN(
sselfs
progLoadedsstartClientssendCommands
RequestRunsstrswdsosspathsabspathsfnsargvs	debugging(sselfsfnsargvswd((sB/home/detlev/Development/Python/Eric/eric3/Debugger/DebugServer.pys	remoteRunÑs
DcsŠçôö|io÷|idƒnù|idtt|ƒttii	t|ƒƒƒt|ƒ|fƒüd|_ýd|_
dS(s»
        Public method to load a new program to collect coverage data.
        
        Arguments
        
            fn -- the filename to run (string)
            
            argv -- the commandline arguments to pass to the program (list of strings)
            
            wd -- the working directory for the program (string)
            
            erase -- flag indicating that coverage info should be cleared first (boolean)
        is%s%s|%s|%s|%d
iN(sselfs
progLoadedsstartClientssendCommandsRequestCoveragesstrswdsosspathsabspathsfnsargvserases	debugging(sselfsfnsargvswdserase((sB/home/detlev/Development/Python/Eric/eric3/Debugger/DebugServer.pysremoteCoverageçs

GcsŠÿ|io|idƒn|idtt|ƒttii	t|ƒƒƒt|ƒ|fƒd|_d|_
dS(sº
        Public method to load a new program to collect profiling data.
        
        Arguments
        
            fn -- the filename to run (string)
            
            argv -- the commandline arguments to pass to the program (list of strings)
            
            wd -- the working directory for the program (string)
            
            erase -- flag indicating that timing info should be cleared first (boolean)
        is%s%s|%s|%s|%d
iN(sselfs
progLoadedsstartClientssendCommandsRequestProfilesstrswdsosspathsabspathsfnsargvserases	debugging(sselfsfnsargvswdserase((sB/home/detlev/Development/Python/Eric/eric3/Debugger/DebugServer.pys
remoteProfileÿs

Gcs2 |id|ƒ!|itdƒdS(s×
        Public method to execute a Python statement.  
        
        Arguments
        
            stmt -- the Python statement to execute (string). It
              should not have a trailing newline.
        s%s
s
N(sselfssendCommandsstmts	RequestOK(sselfsstmt((sB/home/detlev/Development/Python/Eric/eric3/Debugger/DebugServer.pysremoteStatementscs#&'|itdƒdS(sD
        Public method to single step the debugged program.
        s
N(sselfssendCommandsRequestStep(sself((sB/home/detlev/Development/Python/Eric/eric3/Debugger/DebugServer.pys
remoteStep#scs),-|itdƒdS(sB
        Public method to step over the debugged program.
        s
N(sselfssendCommandsRequestStepOver(sself((sB/home/detlev/Development/Python/Eric/eric3/Debugger/DebugServer.pysremoteStepOver)scs/23|itdƒdS(sA
        Public method to step out the debugged program.
        s
N(sselfssendCommandsRequestStepOut(sself((sB/home/detlev/Development/Python/Eric/eric3/Debugger/DebugServer.pys
remoteStepOut/scs589|itdƒdS(s=
        Public method to stop the debugged program.
        s
N(sselfssendCommandsRequestStepQuit(sself((sB/home/detlev/Development/Python/Eric/eric3/Debugger/DebugServer.pysremoteStepQuit5scs;>?|itdƒdS(sA
        Public method to continue the debugged program.
        s
N(sselfssendCommandsRequestContinue(sself((sB/home/detlev/Development/Python/Eric/eric3/Debugger/DebugServer.pysremoteContinue;scs×ANO|ofPy'Q|it|ƒi||fƒWn5Rtj
o&S||fg|it|ƒ<nXn;Uy'V|it|ƒi	||fƒWn
WXnXY|i
dt||||fƒdS(s…
        Public method to set or clear a breakpoint.
        
        Arguments
        
            fn -- filename the breakpoint belongs to (string)
            
            line -- linenumber of the breakpoint (int)
            
            set -- flag indicating setting or resetting a breakpoint (boolean)
            
            cond -- condition of the breakpoint (string)
        s%s%s,%d,%d,%s
N(ssetsselfsbreakssstrsfnsappendslinescondsKeyErrorsremovessendCommandsRequestBreak(sselfsfnslinessetscond((sB/home/detlev/Development/Python/Eric/eric3/Debugger/DebugServer.pysremoteBreakpointAs

'('cs7[bc|i|dƒd|itdƒfƒdS(sš
        Public method to send the raw input to the debugged program.
        
        Arguments
        
            s -- the raw input (string)
        s
sclientRawInputSentN(sselfssendCommandsssemitsPYSIGNAL(sselfss((sB/home/detlev/Development/Python/Eric/eric3/Debugger/DebugServer.pysremoteRawInput[sics0fqr|idt||t|ƒfƒdS(sf
        Public method to request the variables of the debugged program.
        
        Arguments
        
            scope -- the scope of the variables (0 = local, 1 = global)
            
            filter -- list of variable types to filter out (list of int)
            
            framenr -- framenumber of the variables to retrieve (int)
        s
%s%d, %d, %s
N(sselfssendCommandsRequestVariablessframenrsscopesstrsfilter(sselfsscopesfiltersframenr((sB/home/detlev/Development/Python/Eric/eric3/Debugger/DebugServer.pysremoteClientVariablesfscs$t{||idt|fƒdS(s¹
        Public method to evaluate arg in the current context of the debugged program.
        
        Arguments
        
            arg -- the arguments to evaluate (string)
        s%s%s
N(sselfssendCommandsRequestEvalsarg(sselfsarg((sB/home/detlev/Development/Python/Eric/eric3/Debugger/DebugServer.pys
remoteEvaltscs$~…†|idt|fƒdS(sµ
        Public method to execute stmt in the current context of the debugged program.
        
        Arguments
        
            stmt -- statement to execute (string)
        s%s%s
N(sselfssendCommandsRequestExecsstmt(sselfsstmt((sB/home/detlev/Development/Python/Eric/eric3/Debugger/DebugServer.pys
remoteExec~scsˆ‹Œ|itdƒdS(sJ
        Public slot to get the banner info of the remote client.
        s
N(sselfssendCommands
RequestBanner(sself((sB/home/detlev/Development/Python/Eric/eric3/Debugger/DebugServer.pysremoteBannerˆscs¤Ž‘’x”’|iiƒo€“t|iiƒƒ}—|idƒd}�|idƒ}ž|djo$Ÿ|i	t
dƒ|| fƒn¢|djo
||joϤ|||!}¦|tjow§t
||d!ƒ}¨|d}©|i	t
dƒ|dt|dƒfƒª|i	t
dƒ|fƒ«d	Sn­|tjo.®|i	t
d
ƒ||d!fƒ¯d	Sn±|tjo'²|i	t
dƒdfƒ³d	Snµ|tjo'¶|i	t
dƒdfƒ·d	Sn¹|tjo.º|i	t
dƒ||d!fƒ»d	Sn½|tjo.¾|i	t
d
ƒ||d!fƒ¿d	SnÁ|tjoLÂ|i	t
dƒ||d!fƒÃ|ioÄ|iƒnÅd	SnÇ|tjo.È|i	t
dƒ||d!fƒÉd	SnË|tjo:Ìt
||d!ƒ}Í|i	t
dƒ|ƒÎd	SnÐ|tjoÑ|iƒÒd	SnnÔ|i	t
dƒ|fƒqWd	S(s@
        Private method to handle data from the client.
        s<is>isclientOutputiÿÿÿÿs
clientLinesclientStackNsclientVariablessclientStatementsclientExceptionsclientSyntaxErrors
clientExitsclientRawInputsclientBanner(sselfsqsockscanReadLinesstrsreadLineslinesfindseocsbocsemitsPYSIGNALsrespsResponseLinesevalsstackscfsintsResponseVariabless
ResponseOKsResponseContinuesResponseExceptionsResponseSyntaxsResponseExitspassivespassiveShutDownsResponseRawsResponseBannersbisPassiveStartupspassiveStartUp(sselfsrespscfslinesstackseocsbisboc((sB/home/detlev/Development/Python/Eric/eric3/Debugger/DebugServer.pys
handleLineŽs^$
-####
#
csSÖÙÚt|idƒƒGHÛd|_Ü|iƒÝ|itdƒfƒdS(sF
        Private method to handle a passive debug connection.
        s!Passive debug connection receivedispassiveDebugStartedN(sstrsselfstrUtf8spassiveClientExitedsrestoreBreakpointssemitsPYSIGNAL(sself((sB/home/detlev/Development/Python/Eric/eric3/Debugger/DebugServer.pyspassiveStartUpÖs

cs:ßâãd|_ä|iƒåt|idƒƒGHdS(sI
        Private method to shut down a passive debug connection.
        isPassive debug connection closedN(sselfspassiveClientExitedsshutdownServersstrstrUtf8(sself((sB/home/detlev/Development/Python/Eric/eric3/Debugger/DebugServer.pyspassiveShutDownßs
ics�çîï|ip|ioKð|itj	o4ñ|iƒò|itdƒ||i	@fƒnnô|ioõ|i
ƒndS(sŸ
        Private method to start a debug client.
        
        Arguments
        
            unplanned -- flag indicating that the client has died
        s
clientGoneN(sselfspassivespassiveClientExitedsqsocksNonesshutdownServersemitsPYSIGNALs	unplanneds	debuggingsstartRemote(sselfs	unplanned((sB/home/detlev/Development/Python/Eric/eric3/Debugger/DebugServer.pysstartClientçs
+csG÷þÿ|itj	o|ii|ƒn|ii|ƒdS(s±
        Private method to send a single line command to the client.
        
        Arguments
        
            cmd -- command to send to the debug client (string)
        N(sselfsqsocksNones
writeBlockscmdsqueuesappend(sselfscmd((sB/home/detlev/Development/Python/Eric/eric3/Debugger/DebugServer.pyssendCommand÷sc	swxg|iiƒD]S\}}	xA|i|D	]/\}}
|idt||d|fƒq9WqWdS(sM
        Private method to restore the break points after a restart.
        s%s%s,%d,%d,%s
iN(	sselfsbreakssitemssfnsbpsslinescondssendCommandsRequestBreak(sselfsbpsscondslinesfn((sB/home/detlev/Development/Python/Eric/eric3/Debugger/DebugServer.pysrestoreBreakpointsscsh|_dS(sN
        Public method (slot) to clear the local list of breakpoints.
        N(sselfsbreaks(sself((sB/home/detlev/Development/Python/Eric/eric3/Debugger/DebugServer.pysclearAllBreakpointsscs4y|it|ƒ=Wn
nXdS(s»
        Public method to clear the local list of breakpoints for a file.
        
        Arguments
        
            fn -- filename of the breakpoints to be cleared (string)
        N(sselfsbreakssstrsfn(sselfsfn((sB/home/detlev/Development/Python/Eric/eric3/Debugger/DebugServer.pysclearFileBreakpointss
cs&'|iSdS(s�
        Public method to get all breakpoints set in the server.
        
        Returns
        
            list of all breakpoints
        N(sselfsbreaks(sself((sB/home/detlev/Development/Python/Eric/eric3/Debugger/DebugServer.pysgetAllBreakpointsscs9)45y6|it|ƒSWn78gSnXdS(s
        Public method to get all breakpoints of a specific file.
        
        Arguments
        
            filename -- the filename of the breakpoints to retrieve (string)
            
        Returns
        
            list of all breakpoints belonging to filename
        N(sselfsbreakssstrsfilename(sselfsfilename((sB/home/detlev/Development/Python/Eric/eric3/Debugger/DebugServer.pysgetFileBreakpoints)s
csv:EFh}G|tj	oLHxB|DH]7}IyJ|it|ƒ||<Wn
KLnXq)WnM|SdS(s'
        Public method to get all breakpoints of the current project.
        
        Arguments
        
            filelist -- list of filenames belonging to the current project
            
        Returns
        
            list of all breakpoint belonging to the current project
        N(sbpDictsfilelistsNonesfnsselfsbreakssstr(sselfsfilelistsbpDictsfn((sB/home/detlev/Development/Python/Eric/eric3/Debugger/DebugServer.pysgetProjectBreakpoints:s	
	("s__name__s
__module__s__doc__s__init__sstartRemotes
newConnectionsshutdownServers
remoteLoads	remoteRunsremoteCoverages
remoteProfilesremoteStatements
remoteStepsremoteStepOvers
remoteStepOutsremoteStepQuitsremoteContinuesremoteBreakpointsremoteRawInputsremoteClientVariabless
remoteEvals
remoteExecsremoteBanners
handleLinespassiveStartUpspassiveShutDownsstartClientssendCommandsrestoreBreakpointssclearAllBreakpointssclearFileBreakpointssgetAllBreakpointssgetFileBreakpointssgetProjectBreakpoints(((sB/home/detlev/Development/Python/Eric/eric3/Debugger/DebugServer.pysDebugServers@$0

H	


(s__doc__ssyssosssocketstimessignalsqtsSIGNALsPYSIGNALs	qtnetworks
QServerSocketsQSockets
DebugProtocolsPreferencessDebugServer(sPYSIGNALssocketsQSocketsSIGNALs
QServerSocketsPreferencesssysstimesosssignalsDebugServer((sB/home/detlev/Development/Python/Eric/eric3/Debugger/DebugServer.pys?	s


Table of Contents

This document was automatically generated by HappyDoc version 2.1