z Bdb.stop_herecCs�|�|jj�}||jkrdS|j}||j|krJ|jj}||j|krJdSt|||�\}}|r�|j|_|r�|j r�|� t|j��dSdSdSrE)rr8�co_filenamerrJ�co_firstlineno� effective�numberZ currentbp� temporary�do_clear�str)rr/r�lineno�bp�flagrrrr2�s
zBdb.break_herecCstd��dS)Nz)subclass of bdb must implement do_clear())�NotImplementedError)rr0rrrrP�szBdb.do_clearcCs|�|jj�|jkSr )rr8rKrr4rrrr6�szBdb.break_anywherecCsdSr r)rr/Z argument_listrrrr;sz Bdb.user_callcCsdSr rr4rrrr3sz Bdb.user_linecCsdSr r)rr/Zreturn_valuerrrr? szBdb.user_returncCsdSr r)rr/�exc_inforrrrC szBdb.user_exceptionrcCs||_||_d|_||_dS�NF)r7r>r'r@)rr7r>r@rrrr#szBdb._set_stopinfocCs$|dkr|jd}|�|||�dS)Nr)rJr#)rr/rRrrr� set_until"s z Bdb.set_untilcCs0|jr |jj}|r |js |j|_|�dd�dSr )rr5�f_tracer,r#)rZcaller_framerrr�set_step*s
zBdb.set_stepcCs|�|d�dSr )r#r4rrr�set_next6szBdb.set_nextcCs.|jjt@r|�|dd�n|�|j|�dSr=)r8r9r:r#r5r4rrr� set_return:szBdb.set_returncCsL|dkrt��j}|��|r4|j|_||_|j}q|��t�|j�dSr ) �sys� _getframer5r$r,rYr"rZ�settracer4rrr� set_traceAs z Bdb.set_tracecCsH|�|jdd�|jsDt�d�t��j}|rD||jk rD|`|j}q*dSr=)r#r"rr]r_r^r5rYr4rrr�set_continuePs
zBdb.set_continuecCs"|j|_d|_d|_t�d�dS�NT)r"r7r>r'r]r_�rrrr�set_quit_szBdb.set_quitFc Csb|�|�}ddl}|�||�}|s.d||fS|j�|g�}||krN|�|�t|||||�} dS)NrzLine %s:%d does not exist)rr �getliner� setdefault�appendr) rrrRrO�cond�funcnamer r%�listrSrrr� set_breakps
z Bdb.set_breakcCs4||ftjkr|j|�|�|j|s0|j|=dSr )r�bplistr�remove�rrrRrrr� _prune_breaks�s zBdb._prune_breakscCsj|�|�}||jkrd|S||j|kr6d||fStj||fdd�D]}|��qL|�||�dS)N�There are no breakpoints in %szThere is no breakpoint at %s:%d)rrrrl�deleteMero)rrrRrSrrr�clear_break�s
zBdb.clear_all_file_breakscCs,|js dStjD]}|r|��qi|_dS)NzThere are no breakpoints)rr� bpbynumberrq)rrSrrr�clear_all_breaks�s
zBdb.clear_all_breakscCs�|std��zt|�}Wn"tk r:td|�d�YnXztj|}Wn"tk rltd|�d�YnX|dkr�td|��|S)NzBreakpoint number expectedz Non-numeric breakpoint number %sz!Breakpoint number %d out of rangezBreakpoint %d already deleted)rt�intrry� IndexError)rr0rNrSrrrrs�szBdb.get_bpbynumbercCs"|�|�}||jko ||j|kSr �rrrnrrr� get_break�s
zBreakpoint.deleteMecCs d|_dSrb�r�rcrrr�enable�szBreakpoint.enablecCs d|_dSrWr�rcrrr�disable�szBreakpoint.disablecCs"|dkrtj}t|��|d�dS)N)ru)r]�stdoutr-�bpformat)r�outrrr�bpprint�szBreakpoint.bpprintcCs�|jrd}nd}|jr |d}n|d}d|j||j|jf}|jrT|d|jf7}|jrj|d|jf7}|jr�|jdkr�d }nd }|d|j|f7}|S)Nzdel zkeep zyes zno z%-4dbreakpoint %s at %s:%dz stop only if %sz ignore next %d hitsrr��z" breakpoint already hit %d time%s)rOr�rNrur%rhr�r�)rZdispZretZssrrrr��s( � zBreakpoint.bpformatcCsd|j|j|jfS)Nzbreakpoint %s at %s:%s)rNrur%rcrrr�__str__�szBreakpoint.__str__)FNN)N) rr r r�rlryrrqr�r�r�r�r�rrrrr�s