Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
bdb.cpython-314.pyc363 linesDownload Raw Back to __pycache__
1+
2��i���2�Rt^RIt^RIt^RIt^RIt^RIt^RIHt^RIH	t	H3t4Ht.ROt]	]5,],t
!RR]4t]P P"t!RR	4t!R6R4tRt!RR4tR
tRt!RR]4tRtRtRtR#)zDebugger basicsN)�contextmanager)�CO_GENERATOR�CO_COROUTINE�CO_ASYNC_GENERATOR�BdbQuit�Bdb�7Breakpointc��]tRt^tRtRtR#)rz Exception to give up completely.�N)�__name__�8__module__�__qualname__�__firstlineno__�__doc__�__static_attributes__r9��10Lib\bdb.pyrrs��*rc��a�]tRt^to]P11R]PR]PR]PR]PR]PR]PR]PR]PR]PR]PR/t]P12]P,]P,]P,]P,t]P]P,]P,]P,]P,tRtR	tR13tRtRtR
tRtRtRtRtRtRtRtRRlt Rt!Rt"Vt#R#)�_MonitoringTracer�call�line�jump�return�unwind�	exception�opcodec��\PPVnRVnRVnRVnRVnRVnR#)�	bdbtracerNF)	�sys�14monitoring�DEBUGGER_ID�_tool_id�_name�15_tracefunc�_disable_current_event�_tracing_thread�_enabled��selfs&r�__init__�_MonitoringTracer.__init__(s8�����2�2��
� ��16����&+��#�#�����
rc�l�Wn\P!4Vn\P17P
VP4pVf6\P18PVPVP4MEW P8Xd+\P19PVP4M\R4h\P20Pp^pVPP4FgwrVVP\!WR24V4p\P21P#VPWW4WSP$8wgK_WE,pKi	VP'4\P22P)VPVP*4RVnR#)Nz-Another debugger is using the monitoring tool�	_callbackT)r#�	threading�current_threadr%rr�get_toolr!�use_tool_idr"�
clear_tool_id�23ValueError�events�EVENT_CALLBACK_MAP�items�callback_wrapper�getattr�register_callback�INSTRUCTION�update_local_events�24set_events�
GLOBAL_EVENTSr&)r(�	tracefunc�	curr_tool�E�25all_events�event�cb_name�callbacks&&      r�start_trace�_MonitoringTracer.start_trace0s)��#��(�7�7�9����N�N�+�+�D�M�M�:�	����N�N�&�&�t�}�}�d�j�j�A�
�*�*�
$��N�N�(�(����7��L�M�M��N�N�!�!���26�"�5�5�;�;�=�N�E��,�,�W�T�Y�i�;P�-Q�SX�Y�H��N�N�,�,�T�]�]�E�L��
�
�%��#�27�	>�28	
� � �"����!�!�$�-�-��1C�1C�D���
rc�<�RVnRVn\PP	VP294pWP8wdR#\PPVP304\PPVP314R#)FN)	r&r%rrr/r!r"r1�free_tool_id)r(r>s& r�32stop_trace�_MonitoringTracer.stop_traceEsb����
�#����N�N�+�+�D�M�M�:�	��33�34�"�����$�$�T�]�]�3����#�#�D�M�M�2rc��RVnR#)TN)r$r's&r�disable_current_event�'_MonitoringTracer.disable_current_eventNs35��&*��#rc��\PPVP4VP8Xd!\PP4R#R#�N)rrr/r!r"�restart_eventsr's&rrO� _MonitoringTracer.restart_eventsQs7���>�>�"�"�4�=�=�1�T�Z�Z�?��N�N�)�)�+�@rc�Laaa�^RIpVPS4VVV3Rl4pV#)�Nc�<�SP\P!48wdR#\P!4P36pS!V.VO5!pSP'd#VP'dSP4SP'dVS\P\P\P39d"\PPRSn	#VRSn	# \ d7SP#4R\P!4P37nhi;i RSn	i;i)NF)r%r-r.r�	_getframe�f_backr&�f_tracer:r$r?�PY_THROW�	PY_UNWIND�RAISEr�DISABLE�
BaseExceptionrH)�args�frame�retrA�funcr(s*  ���r�wrapper�3_MonitoringTracer.callback_wrapper.<locals>.wrapperXs�����#�#�y�'?�'?�'A�A��
4��
�
��.�.���5�(�4�(���=�=�=�U�]�]�]��,�,�.��/�/�/��a�j�j�!�+�+�q�w�w�%G�G��>�>�1�1�/4��+�
�/4��+��!�
����!�15��
�
��&�&�.��
��38/4��+�s,�AC6�6!C6�A
C6�-C6�6AD7�7D:�:	E)�	functools�wraps)r(r_rArbr`sfff  rr6�"_MonitoringTracer.callback_wrapperUs(����	����	�	4�39�	4�,�rc���VPVRR4pVeQWAnVP'd7\PPVPW P4R#R#R#)rN)r#rVr&rr�set_local_eventsr!�LOCAL_EVENTS)r(r]�coder\�local_tracefuncs&&&* r�
call_callback�_MonitoringTracer.call_callbackqsP���/�/�%���>���&�+�M��}�}�}����/�/��
�
�t�EV�EV�W��'rc�T�VP'dVPVRV4R#R#�rN�rV)r(r]rh�offset�retvals&&&&&r�return_callback�!_MonitoringTracer.return_callbackxs ���=�=�=��M�M�%��6�2�rc�T�VP'dVPVRR4R#R#rmrn�r(r]rhr\s&&&*r�unwind_callback�!_MonitoringTracer.unwind_callback|s ���=�=�=��M�M�%��4�0�rc�|�VP'd*VP'dVPVRR4R#R#R#�rN)rV�
f_trace_linesrts&&&*r�
line_callback�_MonitoringTracer.line_callback�s-���=�=�=�U�0�0�0��M�M�%���.�1�=rc�@�WC8�d\PP#VPW#4pVPW$4pWV8wd\PP#VP'd*VP40'dVP	VRR4R#R#R#rx)rrrZ�_get_linenorVry)r(r]rh�inst_offset�dest_offset�inst_lineno�dest_linenos&&&&&  r�
jump_callback�_MonitoringTracer.jump_callback�sy���$��>�>�)�)�)��&�&�t�9���&�&�t�9���%��>�>�)�)�)��=�=�=�U�0�0�0��M�M�%���.�1�=rc�t�VP'd�VP'dj\VPR4'dNVPpV'd:VPPPR4VJdR#VPpKAVPVR\V4WDP34R#R#)�tb_framer(Nr)rV�
__traceback__�hasattrr��f_locals�get�tb_next�type)r(r]rhro�exc�tbs&&&&& r�exception_callback�$_MonitoringTracer.exception_callback�s����=�=�=�� � � �W�S�->�->�41�%K�%K��&�&����{�{�+�+�/�/��7�4�?�����B��M�M�%��t�C�y�#�?P�?P�.Q�R�rc�|�VP'd*VP'dVPVRR4R#R#R#)rN)rV�f_trace_opcodes)r(r]rhros&&&&r�opcode_callback�!_MonitoringTracer.opcode_callback�s-���=�=�=�U�2�2�2��M�M�%��4�0�3�=rNc���\PPVP4VP8wdR#Vf \P42!4PpVe�VPevVP'd#VP\P,pMVPp\PPVPVPV4VPpK�R#rN)rrr/r!r"rTrUrVr�rgr?r9rf�f_code)r(r]r3s&& rr:�%_MonitoringTracer.update_local_events�s����>�>�"�"�4�=�=�1�T�Z�Z�?���=��M�M�O�*�*�E����}�}�(��(�(�(�!�.�.����>�F�!�.�.�F����/�/��
�
�u�|�|�V�T��L�L�E� rc�^�^RIpRpVPV4FwrVW%8dVu#TpK	V#)rRN)�dis�findlinestarts)r(rhror��last_lineno�start�linenos&&&    rr}�_MonitoringTracer._get_lineno�s9����� �/�/��5�M�E��~�"�"� �K�6��r)r$r&r"r!r#r%rN)$rrr
rr?�PY_START�	PY_RESUMErW�LINE�JUMP�	PY_RETURN�PY_YIELDrXrY�STOP_ITERATIONr9r4r<rgr)rDrHrKrOr6rjrqrurzr�r�r�r:r}r�__classdictcell__��
__classdict__s@rrrs!����	�43�44�F�	���V�	�45�46�F�	����	����	���X�	�47�48�H�	���X�	����	���+�	�
�
�x����J�J����,�q�z�z�9�A�K�K�G�!�'�'�Q�M��6�6�A�F�F�?�Q�[�[�0�1�:�:�=��@P�@P�P�L���*3�+�,��8X�3�1�/�/�S�1�!��rrc�a�]tRt^�toRtR;RltRtRtRtRt	]49R4tR	tR50t
RtRtR
tRtRtRtRtRtRtRtRtRtRtRtRtRtR<RltRtR=Rlt Rt!Rt"R t#R!t$R=R"lt%R#t&R$t'R%t(R>R&lt)R't*R(t+R)t,R*t-R+t.R,t/R-t0R.t1R/t2R0t3R1t4R2t5R?R3lt6R4t7R5t8R@R6lt9R@R7lt:R8t;R9t<R:t=Vt>R#)Ara�Generic Python debugger base class.51 52This class takes care of details of the trace facility;53a derived class should implement user interaction.54The standard debugger class (pdb.Pdb) is an example.55 56The optional skip argument must be an iterable of glob-style57module name patterns.  The debugger will not step into frames58that originate in a module that matches one of these patterns.59Whether a frame is considered to originate in a certain module60is determined by the __name__ in the frame globals.61Nc�t�V'd\V4MRVn/Vn/Vn/VnRVnRVnRVnRVnRVn	\P!4VnW n
VR8Xd\4VnMVR8Xd	RVnM\!RVR24hVP#4R#)NFr�settracezInvalid backend '�')�set�skip�breaks�fncache�frame_trace_lines_opcodes�frame_returning�
trace_opcodes�62enterframe�cmdframe�	cmdlineno�weakref�WeakKeyDictionary�code_linenos�backendr�monitoring_tracerr2�_load_breaks)r(r�r�s&&&rr)�Bdb.__init__�s���!%�C��I�4��	�������)+��&�#���"��������
����#�5�5�7������l�"�%6�%8�D�"�
�63�
"�%)�D�"��0��	��;�<�<����rc��VRV^R,R,8XdV#VPPV4pV'gM\PP	V4p\PPV4pW PV&V#)z�Return canonical form of filename.64 65For real filenames, the canonical form is a case-normalized (on66case insensitive filesystems) absolute path.  'Filenames' with67angle brackets, such as "<stdin>", generated in interactive68mode, are returned unchanged.69�<�>�����)r�r��os�path�abspath�normcase)r(�filename�canonics&& rr��Bdb.canonic�so���s�X�a��^�+�c�1�1��O��,�,�"�"�8�,����g�g�o�o�h�/�G��g�g�&�&�w�/�G�%,�L�L��"��rc��VP'd(VPPVP4R#\P!VP4R#rN)r�rD�trace_dispatchrr�r's&rrD�Bdb.start_trace�s:���!�!�!��"�"�.�.�t�/B�/B�C��L�L��,�,�-rc��VP'dVPP4R#\P!R4R#rN)r�rHrr�r's&rrH�Bdb.stop_trace�s,���!�!�!��"�"�-�-�/��L�L��rc�`�^RIpVP4RVnVPRR4R#)z5Set values of attributes as ready to start debugging.N)�	linecache�70checkcache�botframe�
_set_stopinfo)r(r�s& r�reset�	Bdb.reset�s(���������
����4��&rc#�0"�WnRx�RVnR#5irN)r��r(r]s&&r�set_enterframe�Bdb.set_enterframe�s�����
����s�c���VPV4;_uu_4VP'dRRR4R#VR8XdVPV4uuRRR4#VR8XdVPW4uuRRR4#VR8XdVP	W4uuRRR4#VR8XdVPW4uuRRR4#VR8XdVPuuRRR4#VR8XdVPuuRRR4#VR8XdVPuuRRR4#VR	8XdVPW4uuRRR4#\R71\V44VPuuRRR4# +'giR#;i)a�Dispatch a trace function for debugged frames based on the event.72 73This function is installed as the trace function for debugged74frames. Its return value is the new trace function, which is75usually itself. The default implementation decides how to76dispatch a frame, depending on the type of event (passed in as a77string) that is about to be executed.78 79The event can be one of the following:80    line: A new line of code is going to be executed.81    call: A function is about to be called or another code block82          is entered.83    return: A function or other code block is about to return.84    exception: An exception has occurred.85    c_call: A C function is about to be called.86    c_return: A C function has returned.87    c_exception: A C function has raised an exception.88 89For the Python events, specialized functions (see the dispatch_*()90methods) are called.  For the C events, no action is taken.91 92The arg parameter depends on the previous event.93Nrrrr�c_call�c_exception�c_returnrz*bdb.Bdb.dispatch: unknown debugging event:)94r��quitting�
dispatch_line�
dispatch_call�dispatch_return�dispatch_exceptionr��dispatch_opcode�print�repr)r(r]rA�args&&&&rr��Bdb.trace_dispatchsA��2�
 �
 ��
'�
'��}�}�}��(�
'�����)�)�%�0�	(�
'�95����)�)�%�5�
(�
'��� ��+�+�E�7�(�
'���#��.�.�u�:�(�
'��� ��*�*�(�
'��
�%��*�*�(�
'��96�"��*�*�!(�
'�"�� ��+�+�E�7�%(�
'�&
�>��U��L��&�&�)(�
'�
'�
'�s@�E$�E$�E$�<E$�E$�E$�E$�:E$�E$�9 E$�$E5	c���VPV4'gVPV4'dsVPV8XdVPVP8XgGVPV4VP
4VP'd\hVP#VPVPPVP4'gVP4VP#)z�Invoke user function and return trace function for line event.97 98If the debugger stops on the current line, invoke99self.user_line(). Raise BdbQuit if self.quitting is set.100Return self.trace_dispatch to continue tracing in this scope.101)�	stop_here�102break_herer�r��f_lineno�	user_linerOr�r�	get_breakr��co_filenamerKr�r�s&&rr��Bdb.dispatch_line0s���
�N�N�5�!�!�T�_�_�U�%;�%;��M�M�U�"�t�~�~����'G��N�N�5�!����!��}�}�}�G�m�}��"�"�"������� 8� 8�%�.�.�I�I��&�&�(��"�"�"rc���VPfVPVnVP#VPV4'g*VP	V4'gVP4R#VP'd4VPP\,'d
VP#VPW4VP4VP'd\hVP#)z�Invoke user function and return trace function for call event.103 104If the debugger stops on this function call, invoke105self.user_call(). Raise BdbQuit if self.quitting is set.106Return self.trace_dispatch to continue tracing in this scope.107N)r�rUr�r��break_anywhererK�	stopframer��co_flags�GENERATOR_AND_COROUTINE_FLAGS�	user_callrOr�r�r(r]r�s&&&rr��Bdb.dispatch_callDs����=�=� �!�L�L�D�M��&�&�&����u�%�%��)<�)<�U�)C�)C�
�&�&�(���>�>�>�e�l�l�3�3�6S�S�S��&�&�&����u�"������=�=�=��-��"�"�"rc�d�VPV4'gWP8Xd�VP'dEVPP\108,'dVP
V4VP#WnVPW4VP4RVnVP'd\hVPVJd$VPR8wdVPRR4VPR8wdVP
V4VP# RTni;i)z�Invoke user function and return trace function for return event.109 110If the debugger stops on this function return, invoke111self.user_return(). Raise BdbQuit if self.quitting is set.112Return self.trace_dispatch to continue tracing in this scope.113Nr�)r��returnframer�r�r�r��_set_caller_tracefuncr�r��user_returnrOr�r�114stoplinenor�r�s&&&rr��Bdb.dispatch_return`s����>�>�%� � �E�-=�-=�$=��~�~�~�%�,�,�"7�"7�:W�"W�"W��*�*�5�1��*�*�*�
,�',�$�� � ��,��#�#�%�'+��$��}�}�}�G�m��~�~��&�4�?�?�b�+@��"�"�4��.����"�$��*�*�5�1��"�"�"��(,��$�s�?'D&�&	D/c��VPV4'd�VPP\,'dV^,\JdV^,e:VPW4VP
4VP'd\hVP#VP'd�WPJd�VPPP\,'dRV^,\\39d:VPW4VP
4VP'd\hVP#)z�Invoke user function and return trace function for exception event.115 116If the debugger stops on this exception, invoke117self.user_exception(). Raise BdbQuit if self.quitting is set.118Return self.trace_dispatch to continue tracing in this scope.119)r�r�r�r��
StopIteration�user_exceptionrOr�rr��
GeneratorExitr�r�s&&&rr��Bdb.dispatch_exceptions����>�>�%� � ��L�L�)�)�,I�I�I��A��-�/�C��F�N��#�#�E�/��#�#�%��=�=�=��-��"�"�"��n�n�n��n�n�!<��N�N�)�)�2�2�5R�R�R���F�}�m�<�<�����+����!��}�}�}�G�m��"�"�"rc��VPV4VP4VP'd\hVP#)a�Invoke user function and return trace function for opcode event.120If the debugger stops on the current opcode, invoke121self.user_opcode(). Raise BdbQuit if self.quitting is set.122Return self.trace_dispatch to continue tracing in this scope.123 124Opcode event will always trigger the user callback. For now the only125opcode event is from an inline set_trace() and we want to stop there126unconditionally.127)�user_opcoderOr�rr�r�s&&&rr��Bdb.dispatch_opcode�s7��	
����������=�=�=��-��"�"�"rc�v�VfR#VPF"p\P!W4'gK!R#	R#)z4Return True if module_name matches any skip pattern.FT)r��fnmatch)r(�module_name�patterns&& r�is_skipped_module�Bdb.is_skipped_module�s0������y�y�G����{�4�4��!�rc�,�VP'd3VPVPPR44'dR#WPJd-VP128R8XdR#VPVP1298�#VP'gR#R#)z>Return True if frame is below the starting frame in the stack.rFTr�)r�r�	f_globalsr�r�r�r�r�s&&rr��
Bdb.stop_here�sk���9�9�9��%�%�e�o�o�&9�&9�*�&E�F�F���N�N�"����"�$���>�>�T�_�_�4�4��~�~�~��rc���VPVPP4pW P9dR#VPpW0PV,9d0VPP130pW0PV,9dR#\
W#V4wrEV'dRVPVnV'd7VP'd%VP\VP44R#R#)z�Return True if there is an effective breakpoint for this line.131 132Check for line or function breakpoint and if in effect.133Delete temporary breakpoints if effective() says to.134FT)r�r�r�r�r��co_firstlineno�	effective�number�	currentbp�	temporary�do_clear�str)r(r]r�r��bp�flags&&    rr��Bdb.break_here�s����<�<���� 8� 8�9���;�;�&���������X�.�.��\�\�0�0�F��[�[��2�2���x��7�135��
��Y�Y�D�N�������
�
�c�"�)�)�n�-��rc��\R4h)z\Remove temporary breakpoint.136 137Must implement in derived classes or get NotImplementedError.138z)subclass of bdb must implement do_clear())�NotImplementedError)r(r�s&&rr�Bdb.do_clear�s��139"�"M�N�Nrc���VPVPP4pW P9dR#VPV,FpVP	W14'gKR#	R#)z=Return True if there is any breakpoint in that frame140        FT)r�r�r�r��_lineno_in_frame)r(r]r�r�s&&  rr��Bdb.break_anywhere�sX���<�<���� 8� 8�9���;�;�&���k�k�(�+�+�F��$�$�V�3�3��,�rc���VPpWP8dR#W0P9d.\RVP	444VPV&WPV,9#)zFReturn True if the line number is in the frame's code object.141        Fc3�,"�TF142wrVx�K	R#5irNr143)�.0�_r�s&  r�	<genexpr>�'Bdb._lineno_in_frame.<locals>.<genexpr>�s���)U�_�\�Q��&�_�s�)r�rr�r��co_lines)r(r�r]rhs&&& rr�Bdb._lineno_in_frame�s]���|�|���'�'�'���(�(�(�&)�)U�T�]�]�_�)U�&U�D���d�#��*�*�4�0�0�0rc��R#)z&Called if we might stop in a function.Nr144)r(r]�
argument_lists&&&rr��
Bdb.user_call���rc��R#)z'Called when we stop or break at a line.Nr145r�s&&rr��
Bdb.user_liner)rc��R#)z&Called when a return trap is set here.Nr146)r(r]�return_values&&&rr��Bdb.user_return	r)rc��R#)z$Called when we stop on an exception.Nr147)r(r]�exc_infos&&&rr��Bdb.user_exception
r)rc��R#)z.Called when we are about to execute an opcode.Nr148r�s&&rr�Bdb.user_opcoder)rc���WP8wdkWnVPpVe%WnW PJdMVPpK(VP149'dVP150P
4R#R#R#rN)r�r�r�r�rUr�r:)r(r�r]s&& r�_set_trace_opcodes�Bdb._set_trace_opcodessg���.�.�.�!.���O�O�E��#�(5�%��M�M�)�������%�%�%��&�&�:�:�<�&�/rc�r�WnW nRVnW0nWPnW`nVP
V4R#)z�Set the attributes for stopping.151 152If stoplineno is greater than or equal to 0, then stop at line153greater than or equal to the stopline.  If stoplineno is -1, then154don't stop at all.155FN)r�r�r�r�r�r�r5)r(r�r�r�rr�r�s&&&&&&&rr��Bdb._set_stopinfo!s7��#��&����
�%��!�
�"������'rc��VPpV'd9VP'g%W PJdVPVnR#R#R#R#rN)rUrVr�r�)r(�
current_frame�caller_frames&& rr��Bdb._set_caller_tracefunc5s?��%�+�+���� 4� 4� 4��]�]�9Z�#'�#6�#6�L� �:[� 4�<rc�X�VfVP^,pVPWV4R#)zpStop when the line with the lineno greater than the current one is156reached or when returning from current frame.N)r�r�)r(r]r�s&&&r�	set_until�
Bdb.set_untilBs'���>��^�^�a�'�F����5��0rc157�n�VPRRVP\VPRR4R7R#)zStop after one line of code.Nr��r�r�)r�r�r7r's&r�set_step�Bdb.set_stepJs2��	
���4�����%,�T�_�_�j�$�%O�	�	Qrc�.�VPRRRR7R#)z!Stop before the next instruction.NT)r)r�r's&r�
set_stepinstr�Bdb.set_stepinstrPs�����4��d��3rc�B�VPVRWPR7R#)z2Stop on the next line in or below the given frame.NrA)r�r�r�s&&r�set_next�Bdb.set_nextTs�����5�$��.�.��Qrc��VPP\,'dVPWR4R#VPVPV4R#)z)Stop when returning from the given frame.Nr�)r�r�r�r�rUr�s&&r�158set_return�Bdb.set_returnXs<���<�<� � �#@�@�@����u�R�0����u�|�|�U�3rc���VP4Vf \P!4PpVP	4VPV4;_uu_4V'dRVPVnWnVPVP3VPV&RVn	VPpKYVP4RVn
RRR4VP4R# +'giL";i)z^Start debugging from frame.159 160If frame is not specified, debugging starts from caller's frame.161NT)rHrrTrUr�r�r�rVr�ryr�r�rEr�rDr�s&&r�	set_trace�
Bdb.set_trace_s���162	
�����=��M�M�O�*�*�E��163�164��
�
 �
 ��
'�
'�� $� 3� 3��
� %�
�9>�9L�9L�e�Nc�Nc�8d��.�.�u�5�&*��#�������� �"�D�O�(�	
����(�
'�s�C(�&A(C(�(C8	c���VPVPRR4VP'g�VP4\P165!4PpV'd WPJdV=VPpK'VPP4Fwpwr#W#uVn166VnK	VPR8XdVPP4/VnR#R#)zpStop only at breakpoints or when finished.167 168If there are no breakpoints, set the system trace function to None.169Nrr�)r�r�r�rHrrTrUrVr�r5ryr�r�r�r:)r(r]�trace_linesr�s&   r�set_continue�Bdb.set_continuets���	
���4�=�=�$��3��{�{�{��O�O���M�M�O�*�*�E��E���6��M�����7;�7U�7U�7[�7[�7]�3��3��=H�:��#�U�%:�8^��|�|�|�+��&�&�:�:�<�-/�D�*�rc�d�VPVnRVnRVnVP	4R#)zeSet quitting attribute to True.170 171Raises BdbQuit exception in the next call to a dispatch_*() method.172NT)r�r�r�r�rHr's&r�set_quit�Bdb.set_quit�s(��173����������
����rc�p�VPPV.4pW#9dVPV4R#R#)z/Add breakpoint to breaks, if not already there.N)r��174setdefault�append)r(r�r��175bp_linenoss&&& r�_add_to_breaks�Bdb._add_to_breaks�s1���[�[�+�+�H�b�9�176��#����f�%�$rc�F�VPV4p^RIpVPW4pV'gRW3,#VPW4\	WW4V4pVP177p	V	'd7VP
V	4'dVPV	nV	Pp	K>R#)z�Set a new breakpoint for filename:lineno.178 179If lineno doesn't exist for the filename, return an error message.180The filename should be in canonical form.181NzLine %s:%d does not exist)182r�r��getliner[rr�r�r�rVrU)183r(r�r�r�cond�funcnamer�rrr]s184&&&&&&    r�	set_break�
Bdb.set_break�s����<�<��)���� � ��2���.�(�1C�C�C����H�-�
��)�8�
D��������"�"�5�)�)� $� 3� 3��
��L�L�E�rc�v�\PP4FwrVPW4K	R#)a'Apply all breakpoints (set in other instances) to this one.185 186Populates this instance's breaks list from the Breakpoint class's187list, which can have breakpoints set by another Bdb instance. This188is necessary for interactive sessions to keep the breakpoints189active across multiple calls to run().190N)r�bplist�keysr[�r(r�r�s&  rr��Bdb._load_breaks�s.��#-�"3�"3�"8�"8�":��X�����1�#;rc���W3\P9d#VPV,PV4VPV,'gVPVR#R#)z�Prune breakpoints for filename:lineno.191 192A list of breakpoints is maintained in the Bdb instance and in193the Breakpoint class.  If a breakpoint in the Bdb instance no194longer exists in the Breakpoint class, then it's removed from the195Bdb instance.196N)rrdr��removerfs&&&r�
_prune_breaks�Bdb._prune_breaks�sL��
��Z�%6�%6�6��K�K��!�(�(��0��{�{�8�$�$����H�%�%rc�*�VPV4pWP9d197RV,#W PV,9dRW3,#\PW3,R,FpVP	4K	VPW4R#)z^Delete breakpoints for filename:lineno.198 199If no breakpoints were set, return an error message.200�There are no breakpoints in %szThere is no breakpoint at %s:%d:NNNN)r�r�rrd�deleteMerj)r(r�r�rs&&& r�clear_break�Bdb.clear_break�s���201�<�<��)���;�;�&�3�h�>�>����X�.�.�4��7I�I�I��#�#�H�$4�5�a�8�8�B��K�K�M�9����8�,�rc���VPV4pTP4TP	TP202TP4R# \dp\T4uRp?#Rp?ii;i)zhDelete a breakpoint by its index in Breakpoint.bpbynumber.203 204If arg is invalid, return an error message.205N)�get_bpbynumberr2rrnrj�filer)r(r�r�errs&&  r�clear_bpbynumber�Bdb.clear_bpbynumber�sX��206	��$�$�S�)�B�	���
����2�7�7�B�G�G�,���	�	��s�8�O��	�s�A�A+�207A&� A+�&A+c�208�VPV4pWP9d209RV,#VPV,F4p\PW3,pVFpVP	4K	K6	VPVR#)zPDelete all breakpoints in filename.210 211If none were set, return an error message.212rmN)r�r�rrdrn)r(r�r�blistrs&&   r�clear_all_file_breaks�Bdb.clear_all_file_breaks�ss��213�<�<��)���;�;�&�3�h�>�>��K�K��)�)�D��%�%�h�n�5�E������
��*�
�K�K��!�rc��VP'gR#\PFpV'gK
VP4K	/VnR#)zMDelete all existing breakpoints.214 215If none were set, return an error message.216zThere are no breakpointsN)r�r�217bpbynumberrn)r(rs& r�clear_all_breaks�Bdb.clear_all_breaks�s:��218�{�{�{�-��'�'�B��r����
�(����rc�(�V'g\R4h\V4p\PT,pTf\RT,4hT# \d\RT,4Rhi;i \d\RT,4Rhi;i)z�Return a breakpoint by its index in Breakpoint.bybpnumber.219 220For invalid arg values or if the breakpoint doesn't exist,221raise a ValueError.222zBreakpoint number expectedz Non-numeric breakpoint number %sNz!Breakpoint number %d out of rangezBreakpoint %d already deleted)r2�intrr|�223IndexError)r(r�rrs&&  rrr�Bdb.get_bpbynumber	s�����9�:�:�	Q���X�F�	U��&�&�v�.�B��:��<�v�E�F�F��	���	Q��?�#�E�F�D�P�	Q���	U��@�6�I�J�PT�T�	U�s�A�A2�A/�2Bc�z�VPV4pWP9;'dW PV,9#)z9Return True if there is a breakpoint for filename:lineno.�r�r�rfs&&&rr��
Bdb.get_breaks8���<�<��)���;�;�&�,�,��k�k�(�+�+�	,rc���VPV4pWP9;'d>W PV,9;'d!\PW3,;'g.#)z^Return all breakpoints for filename:lineno.224 225If no breakpoints are set, return an empty list.226)r�r�rrdrfs&&&r�227get_breaks�Bdb.get_breaks#sb��228�<�<��)���;�;�&�0�0��k�k�(�+�+�0�0����h�.�/�6�6�35�	6rc�n�VPV4pWP9dVPV,#.#)zbReturn all lines with breakpoints for filename.229 230If no breakpoints are set, return an empty list.231r�)r(r�s&&r�get_file_breaks�Bdb.get_file_breaks-s0��232�<�<��)���{�{�"��;�;�x�(�(��Irc��VP#)z$Return all breakpoints that are set.)r�r's&r�get_all_breaks�Bdb.get_all_breaks8s���{�{�rc���.pV'dVPVJd
VPpVe;VPWP34WPJdMVP233pK>VP
4\^\V4^,2344pVe6VPVPVP34VPpK9Vf\^\V4^,2354pW43#)z�Return a list of (frame, lineno) in a stack trace and a size.236 237List starts with original calling frame, if there is one.238Size may be number of frames above or below f.239)240r�r�rYr�r�rU�reverse�max�len�	tb_lineno)r(�f�t�stack�is&&&  r�	get_stack�
Bdb.get_stack?s���������q���	�	�A��m��L�L�!�Z�Z��)��M�M�!�����A�
�
�
����3�u�:��>�"���m��L�L�!�*�*�a�k�k�2�3��	�	�A��9��A�s�5�z�A�~�&�A��x�rc�>�^RIp^RIpVwrVVPVPP4pV:RV:R2pVPP241'dW�PP242,
pM	VR,
pVR,
pRVP9d4VPR,p	VR,
pW�PV	4,
pVeDVPWvVP4p243V244'dW�V245P4,,
pV#W�R2,
pV#)	aReturn a string with information about a stack entry.246 247The stack entry frame_lineno is a (frame, lineno) tuple.  The248return string contains the canonical filename, the function name249or '<lambda>', the input arguments, the return value, and the250line of code (if it exists).251 252N�(�)z<lambda>z()�253__return__z->zWarning: lineno is None)r��reprlibr�r�r��co_namer�r�r^r�strip)r(�frame_lineno�lprefixr�r�r]r�r��s�rvrs&&&        r�format_stack_entry�Bdb.format_stack_entryVs���	"�$�
���<�<���� 8� 8�9�� �&�)���<�<����
���%�%�%�A�
��O�A�	�T�	���5�>�>�)�����-�B�
��I�A�
���b�!�!�A����$�$�X�u���G�D���t�z�z�|�+�+����
�9�3�4�4�A��rc�`�VPR8XdVPP4R#R#)zDisable the current event.rN)r�r�rKr's&rrK�Bdb.disable_current_eventts%���<�<�<�'��"�"�8�8�:�(rc�`�VPR8XdVPP4R#R#)zRestart all events.rN)r�r�rOr's&rrO�Bdb.restart_eventsys%���<�<�<�'��"�"�1�1�3�(rc�b�Vf^RIpVPpVfTpVP4\V\4'd\VRR4pVP
4\WV4RVn	VP4R# \dL&i;i RTn	TP4i;i)ztDebug a statement executed via the exec() function.254 255globals defaults to __main__.dict; locals defaults to globals.256Nz<string>�execT)�__main__�__dict__r��257isinstancer�compilerDr�rr�rH)r(�cmd�globals�localsr�s&&&& r�run�Bdb.run�s���258�?���'�'�G��>��F��259�260���c�3����#�z�6�2�C�����	���v�&�!�D�M��O�O���	�	��	��!�D�M��O�O��s$�B�B�B�B�B�B.c�L�Vf^RIpVPpVfTpVP4VP4\	WV4RVnVP
4# \dMi;iRTnTP
4R# RTnTP
4i;i)zvDebug an expression executed via the eval() function.261 262globals defaults to __main__.dict; locals defaults to globals.263NT)r�r�r�rD�evalr�rHr)r(�exprr�r�r�s&&&& r�runeval�Bdb.runeval�s���264�?���'�'�G��>��F��265�266������	���v�.�!�D�M��O�O���	�	��	��� �D�M��O�O���!�D�M��O�O��s#�A�A-�*B267�,A-�-B268�269B#c�*�VPWV4R#)z.For backwards-compatibility.  Defers to run().N)r�)r(r�r�r�s&&&&r�runctx�270Bdb.runctx�s��	
����v�&rc���VP4VP4RpV!V/VBpRVnVP	4V# \dL&i;i RTnTP	4i;i)zGDebug a single function call.271 272Return the result of the function call.273NT)r�rDrr�rH)r(r_r\�kwds�ress""*, r�runcall�Bdb.runcall�sr��274	
�275�276��������	���%��%�C�!�D�M��O�O���277���	��	��!�D�M��O�O��s#�A�A�A�A�A�A/)r�r�r�r�r�r�rr�r�r�r�r�r�r�r�r�r�r�)Nr�)rRFNNrN�FNN)z: �NN)?rrr
rrr)r�rDrHr�rr�r�r�r�r�r�r�rr�r�rr�rr�r�r�r�rr5r�r�r>rBrErHrKrNrRrUr[rar�rjroruryr}rrr�r�r�r�r�r�rKrOr�r�r�r�rr�r�s@rrr�s5������*�".��'�����278-'�^#�(#�8#�>#�:
#�&�
��6O�	�1�
�
�
�
�
�279=�(�(7�1�Q�4�R�4��*0�(�"&��0	2�&��"�
���(,�6�	���.�<;�2804��,�('��rc�6�\4P4R#)z<Start debugging with a Bdb instance from the caller's frame.N)rrNr281rrrNrN�s���E�O�O�rc�ta�]tRtRtoRt^t/tR.tR
Rlt]	R4t282RtRtRt
RR	ltR283tRtRtVtR#)ri�adBreakpoint class.284 285Implements temporary breakpoints, ignore counts, disabling and286(re)-enabling, and conditionals.287 288Breakpoints are indexed by number through bpbynumber and by289the (file, line) tuple using bplist.  The former points to a290single instance of class Breakpoint.  The latter points to a291list of such instances since there may be more than one292breakpoint per line.293 294When creating a breakpoint, its associated filename should be295in canonical form.  If funcname is defined, a breakpoint hit will be296counted when the first line of that function is executed.  A297conditional breakpoint always counts a hit.298Nc��WPnRVnWnW nW0nW@nRVn^Vn^Vn\PVn\;P^,
un299VPPV4W3VP9d&VPW3,PV4R#V.VPW3&R#)NT)r`�func_first_executable_linersrrr_�enabled�ignore�hitsr�nextrr|rYrd)r(rsrrr_r`s&&&&&&rr)�Breakpoint.__init__�s��� �
�*.��'��	��	�"���	���������	� �o�o������1��������t�$��<�4�;�;�&��K�K��300�#�*�*�4�0�'+�f�D�K�K��301�#rc�J�^\n/\nR.\nR#)�N)rr�rdr|r302rr�clearBreakpoints�Breakpoint.clearBreakpoints�s���303���304��!%��305�rc���VPVP3pRVPVP&VPV,PV4VPV,'gVPVR#R#)z�Delete the breakpoint from the list associated to a file:line.306 307If it is the last breakpoint in that position, it also deletes308the entry for the file:line.309N)rsrr|rrdri)r(�indexs& rrn�Breakpoint.deleteMe�s_�����D�I�I�&��'+�������$����E��!�!�$�'��{�{�5�!�!����E�"�"rc��RVnR#)zMark the breakpoint as enabled.TN�r�r's&r�enable�Breakpoint.enable
s	����rc��RVnR#)z Mark the breakpoint as disabled.FNr�r's&r�disable�Breakpoint.disables	����rc�d�Vf\Pp\VP4VR7R#)z}Print the output of bpformat().310 311The optional out argument directs where the output is sent312and defaults to standard output.313N)rs)r�stdoutr��bpformat)r(�outs&&r�bpprint�Breakpoint.bpprints"���;��*�*�C�
�d�m�m�o�C�(rc��VP'dRpMRpVP'dVR,pM	VR,pRVPVVPVP3,pVP314'dVRVP315:2,
pVP'dVRVP3,,
pVP'd3VP^8�dRpMR	pVR316VPV3,,
pV#)z�Return a string with information about the breakpoint.317 318The information includes the breakpoint number, temporary319status, file:line position, break condition, number of times to320ignore, and number of times hit.321 322zdel  zkeep zyes  zno   z%-4dbreakpoint   %s at %s:%dz323	stop only if z324	ignore next %d hitsr��z"325	breakpoint already hit %d time%s)rr�rrsrr_r�r�)r(�dispr^�sss&   rr��Breakpoint.bpformats����>�>�>��D��D��<�<�<��'�>�D��'�>�D�,����T�04�	�	�4�9�9�0F�F���9�9�9��D�I�I�7�7�C��;�;�;��,����~�=�=�C��9�9�9��y�y�1�}������9�T�Y�Y��O�K�K�C��326rc�Z�RVP:RVP:RVP:2#)z1Return a condensed description of the breakpoint.zbreakpoint z at �:)rrsrr's&r�__str__�Breakpoint.__str__=s��+/�;�;��	�	�4�9�9�M�Mr)327r_r�rsr�r`r�r�rrrr�rN)rrr
rrr�rdr|r)�staticmethodr�rnr�r�r�r�r�rr�r�s@rrr�s[�����(
�D�
�F���J�-�(�'��'�328#���)��<N�Nrc�6�VP'g VPVP8wdR#R#VPPVP8wdR#VP329'gVPVnVP330VP8wdR#R#)aBReturn True if break should happen here.331 332Whether a break should happen depends on the way that b (the breakpoint)333was set.  If it was set via line number, check if b.line is the same as334the one in the frame.  If it was set via function name, check if this is335the right function and if it is on the first executable line.336FT)r`rr�r�r�r�)�br]s&&r�
checkfuncnamer�Dsr��
�:�:�:��6�6�U�^�^�#���
�|�|���q�z�z�)��
�'�'�'�',�~�~��$��#�#�u�~�~�5��rc�6�\PW3,pVF�pVP'gK\WB4'gK*V;P^,
unVP337'g3VP^8�dV;P^,unK�VR3u#\VP338VPVP4pV'd3VP^8�dV;P^,unK�VR3u#K�	R# TR3uu#;i)aReturn (active breakpoint, delete temporary flag) or (None, None) as339breakpoint to act upon.340 341The "active breakpoint" is the first entry in bplist[line, file] (which342must exist) that is enabled, for which checkfuncname is True, and that343has neither a False condition nor a positive ignore count.  The flag,344meaning that a temporary breakpoint should be deleted, is False only345when the condiion cannot be evaluated (in which case, ignore count is346ignored).347 348If no such entry exists, then (None, None) is returned.349TFr�)350rrdr�r�r�r_r�r�rr�)rsrr]�	possiblesr��vals&&&   rrrds����!�!�$�*�-�I�
���y�y�y���Q�&�&��	���!����v�v�v��x�x�!�|����A�
����4�y� �351
"��1�6�6�5�?�?�E�N�N�C����x�x�!�|����A�
��!"�4�y�(��+�D���
"��5�z�!�s�#AD�D�Dc�8a�]tRtRtoRtRtRtRtRtVt	R#)�Tdbi�c�^�VPPpV'gRp\RW24R#)�???z+++ callN)r�r�r�)r(r]r\�names&&& rr��
Tdb.user_call�s"���|�|�#�#���E�T�
�j�$�%rc	�2�^RIpVPPpV'gRpVPVPP4pVPWAPVP4p\RWAPVRVP44R#)rRNr�z+++r�)352r�r�r�r�r�r^r�rr�r�)r(r]r�r��fnrs&&    rr��
Tdb.user_line�sg����|�|�#�#���E�T�
�\�\�%�,�,�2�2�
3��� � ��^�^�U�_�_�E��
�e�R����s�D�J�J�L�Arc��\RV4R#)z353+++ returnN�r�)r(r]rps&&&rr��Tdb.user_return�s��
�l�F�#rc�>�\RV4VP4R#)z
+++ exceptionN)r�rR)r(r]�	exc_stuffs&&&rr��Tdb.user_exception�s��
�o�y�)����rr354N)355rrr
rr�r�r�r�rr�r�s@rr�r��s����&�B�$��rr�c�\�\RVR4\V^356,4p\RV4R#)zfoo(r�zbar returnedN)r��bar)�n�xs& r�foor�s%��	�&�!�S���A�b�D�	�A�	�.�!�rc�.�\RVR4V^,#)zbar(r�r�)�as&rrr�s��	�&�!�S���Q�3�Jrc�<�\4pVPR4R#)zimport bdb; bdb.foo(10)N)r�r�)r�s r�testr	�s����A��E�E�357#�$r)rrr)rrrr-r�r��358contextlibr�inspectrrr�__all__r��	Exceptionrrr3r?rrrNrr�rr�rrr	r359rr�<module>rs�����360��	��%�B�B�361*�� ,�|� ;�>P� P��+�i�+��N�N����[�[�|N�N�b�362uN�uN�t�@0�j�#��$�363�%r
codekingpro/portable-devtools · Team Ai