Sindbad~EG File Manager

Current Path : /usr/local/share/gdb/python/gdb/__pycache__/
Upload File :
Current File : /usr/local/share/gdb/python/gdb/__pycache__/__init__.cpython-311.pyc

�

��g�"��@�ddlZddlZddlZddlZddlZddlmZejdkrddlm	Z	nddl
m	Z	ddlZddlTddlZ
e
ejd<Gd�de��Zeej��e_eej��e_dZd	ge_gZgZgZiZgZgZd
�Zej�ej�e ����a!gd�Z"d�Z#e#��d
�Z$d�Z%d�Z&d�Z'd�Z(d�Z)d�Z*ed���Z+ed���Z,Gd�dej-��Z-d�Z.dS)�N)�contextmanager)��)�reload)�*z
gdb.eventsc�:�eZdZdZdZd�Zd�Zd�Zd�Zd�Z	d�Z
d	S)
�_GdbFilezUTF-8�strictc��||_dS�N��stream)�selfrs  �./gdb/__init__.py�__init__z_GdbFile.__init__0s
�������c��dSr��rs r�closez_GdbFile.close3s���trc��dS)NFrrs r�isattyz_GdbFile.isatty7s���urc�:�|D]}|�|���dSr)�write)r�iterable�lines   r�
writelinesz_GdbFile.writelines:s0���	�	�D��J�J�t�����	�	rc�:�tj|j���dS�Nr
)�_gdb�flushrrs rr!z_GdbFile.flush>s���
�$�+�&�&�&�&�&�&rc�<�tj||j���dSr)r rr)r�ss  rrz_GdbFile.writeAs���
�1�T�[�)�)�)�)�)�)rN)�__name__�
__module__�__qualname__�encoding�errorsrrrrr!rrrrr	r	+sx�������H�
�F�������������'�'�'�*�*�*�*�*rr	�c�:�t��D]-}|jD]#}|jr||��}|�
||jfccS�$�.t	��jD]!}|jr||��}|�||jfcS�"tD]!}|jr||��}|�||jfcS�"dS)a�Internal function called from GDB to execute all unwinders.

    Runs each currently enabled unwinder until it finds the one that
    can unwind given frame.

    Arguments:
        pending_frame: gdb.PendingFrame instance.

    Returns:
        Tuple with:

          [0] gdb.UnwindInfo instance
          [1] Name of unwinder that claimed the frame (type `str`)

        or None, if no unwinder has claimed the frame.
    N)�objfiles�frame_unwinders�enabled�name�current_progspace)�
pending_frame�objfile�unwinder�unwind_infos    r�_execute_unwindersr4^s���"�:�:�8�8���/�	8�	8�H���
8�&�h�}�5�5���*�'���7�7�7�7�7�7��		8�&�'�'�7�4�4����	4�"�(�=�1�1�K��&�#�X�]�3�3�3�3��#�4�4����	4�"�(�=�1�1�K��&�#�X�]�3�3�3�3���4r)�function�command�printerc	�Z�tD�]!}tj�tj�t
��|��}tj�|��r�td�tj|����}|D]�}t�d|�d|dd���}	|tjvrtt|����nt|���U#t$r6tj�t#j��dz��Y��wxYw��#dS)Nc�8�|�d��o|dkS)Nz.pyz__init__.py)�endswith)�xs r�<lambda>z%_auto_load_packages.<locals>.<lambda>�s��!�*�*�U�+�+�B��]�0B�r�.����
)�packages�os�path�join�dirname�__file__�exists�filter�listdirr$�sys�modulesr�
__import__�	Exception�stderrr�	traceback�
format_exc)�package�location�py_files�py_file�modnames     r�_auto_load_packagesrU�s0���D�D���7�<�<������ 9� 9�7�C�C��
�7�>�>�(�#�#�	D��B�B�B�J�x�DX�DX���H�$�

D�

D��(0���'�'�'�7�3�B�3�<�<�H��D��#�+�-�-��z�'�2�2�3�3�3�3�"�7�+�+�+��� �D�D�D��J�$�$�Y�%9�%;�%;�d�%B�C�C�C�C�C�D�����!D�Ds�+:C&�&=D&�%D&c��	tj�t��n#t$rYnwxYwtj�d|��|at
tt����t��dS)z3Update sys.path, reload gdb and auto-load packages.rN)
rIrB�remove�	PYTHONDIR�
ValueError�insertrrKr$rU)�dirs r�GdbSetPythonDirectoryr\�s���
�����	�"�"�"�"���
�
�
���
�����H�O�O�A�s�����I��:�h��� � � ������s�$'�
4�4c�2�tj��jS)zReturn the current Progspace.)r �selected_inferior�	progspacerrrr/r/�s���!�#�#�-�-rc�B�t�����S)z:Return a sequence of the current program space's objfiles.)r/r+rrrr+r+�s�����'�'�)�)�)rc�D�t���|��S)zdsolib_name (Long) -> String.
Return the name of the shared library holding a given address, or None.)r/�
solib_name)�addrs rrbrb�s�����)�)�$�/�/�/rc�D�t���|��S)z8Return the block containing the given pc value, or None.)r/�block_for_pc��pcs rrere�s�����+�+�B�/�/�/rc�D�t���|��S)znfind_pc_line (pc) -> Symtab_and_line.
    Return the gdb.Symtab_and_line object corresponding to the pc value.)r/�find_pc_linerfs rriri�s�����+�+�B�/�/�/rc��|�d}nt|t��r|rd}nd}tjd|zdzt	|��zd���dS)	z$Set the GDB parameter NAME to VALUE.N�	unlimited�on�offzset � T)�	to_string)�
isinstance�boolr �execute�str)r.�values  r�
set_parameterru�se��

�}����	�E�4�	 �	 ���	��E�E��E��L��$���$�s�5�z�z�1�T�B�B�B�B�B�Brc#�K�tj|��}t||��	dV�t||��dS#t||��wxYw)zYTemporarily set the GDB parameter NAME to VALUE.
    Note that this is a context manager.N)r �	parameterru)r.rt�	old_values   r�with_parameterry�sa������t�$�$�I��$�����'��
�
�
��d�I�&�&�&�&�&��
�d�I�&�&�&�&���s	�>�Ac#�jK�ttd��sdV�dStjtjtjtjh}tjtj|��}	dV�tjtj|��dS#tjtj|��wxYw)z3A helper function that blocks and unblocks signals.�pthread_sigmaskN)	�hasattr�signal�SIGCHLD�SIGINT�SIGALRM�SIGWINCHr{�	SIG_BLOCK�SIG_SETMASK)�to_block�old_masks  r�blocked_signalsr��s������6�,�-�-��
���������
�v�~�v��O�H��%�f�&6��A�A�H�=��
�
�
���v�1�8�<�<�<�<�<����v�1�8�<�<�<�<���s�,B�!B2c�"��eZdZdZ�fd�Z�xZS)�Threadz�A GDB-specific wrapper around threading.Thread

    This wrapper ensures that the new thread blocks any signals that
    must be delivered on GDB's main thread.c���t��5t�����ddd��dS#1swxYwYdSr)r��super�start)r�	__class__s �rr�zThread.start	s����
�
�
�	�	��G�G�M�M�O�O�O�	�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�	�	s�!>�A�A)r$r%r&�__doc__r��
__classcell__)r�s@rr�r�sB�������/�/�
��������rr�c��|j}|jD]}|jr||��}|�|cS�tD]}|jr||��}|�|cS�dS)a@Internal function called from GDB to execute missing debug
    handlers.

    Run each of the currently registered, and enabled missing debug
    handler objects for the current program space and then from the
    global list.  Stop after the first handler that returns a result
    other than None.

    Arguments:
        objfile: A gdb.Objfile for which GDB could not find any debug
                 information.

    Returns:
        None: No debug information could be found for objfile.
        False: A handler has done all it can with objfile, but no
               debug information could be found.
        True: Debug information might have been installed by a
              handler, GDB should check again.
        A string: This is the filename of a file containing the
                  required debug information.
    N)r_�missing_debug_handlersr-)r1�pspace�handler�results    r�_handle_missing_debuginfor�s���,�
�F��0�����?�	��W�W�%�%�F��!��
�
�
��)�����?�	��W�W�%�%�F��!��
�
�
���4r)/rAr}rI�	threadingrN�
contextlibr�version_info�	importlibr�impr �
_gdbevents�eventsrJ�objectr	�STDOUT�stdout�STDERRrM�prompt_hook�argv�pretty_printers�
type_printers�xmethods�
frame_filtersr,r�r4rBrDrErXr@rUr\r/r+rbreriruryr�r�r�rrr�<module>r�s��� 
�	�	�	�
�
�
�
�
�
�
�
���������%�%�%�%�%�%���v��� � � � � � � �������������������"���L��*�*�*�*�*�v�*�*�*�4�X�d�k�
"�
"��
�
�X�d�k�
"�
"��
���
�4������
�
���
�����$�$�$�P
�G�O�O�B�G�O�O�H�5�5�6�6�	�.�-�-��D�D�D�*��������$.�.�.�
*�*�*�
0�0�0�0�0�0�
0�0�0�C�C�C��	'�	'���	'��=�=���=������Y�
����$�$�$�$�$r

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists