Sindbad~EG File Manager

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

�

��gA����ddlZddlZddlmZmZddlmZmZdaia	ia
edd���Zed���Zed��ed��d	�����Z
ed
��dd�defd
���ZdS)�N�)�
capability�request)�DAPException�
in_gdb_threadc��|tvrt|}nr|�tj�|��}||d�}tj�|��s#t
|d<|tt
<t
dz
a|t|<|S)z�Return the Source for a given file name.

    FULLNAME is the full name.  This is used as the key.
    FILENAME is the base name; if None (the default), then it is
    computed from FULLNAME.
    N)�name�path�sourceReferencer)�_source_map�osr
�basename�exists�_next_source�_id_map)�fullname�filename�results   �./gdb/dap/sources.py�make_sourcer"s����;����X�&������w�'�'��1�1�H���
�
��
�w�~�~�h�'�'�	�(4�F�$�%�%+�G�L�!��A��L� &��H���M�c���d|vr|dSd|vrtd���|d}|tvrtdt|��z���t|dS)zUDecode a Source object.

    Finds and returns the filename of a given Source object.r
rz8either 'path' or 'sourceReference' must appear in Sourcezno sourceReference )rr�str)�source�refs  r�
decode_sourcerBsr��
�����f�~����&�&��U�V�V�V�
�"�
#�C�
�'����0�3�s�8�8�;�<�<�<��3�<���r�
loadedSources�supportsLoadedSourcesRequestc��g}tjd��dD]1}|�t|d|d�����2d|iS)Nz-file-list-exec-source-files�filesr�file�sources)�gdb�
execute_mi�appendr)�extrar�elts   r�loaded_sourcesr(Rs`���F��~�<�=�=�g�F�A�A���
�
�k�#�j�/�3�v�;�?�?�@�@�@�@��6��rr)rrc��|�d|i}t|��}t|��5}|���}ddd��n#1swxYwYd|iS)Nr�content)r�open�read)rrr&r�fr*s      rrr]s���
�~�#�_�5���V�$�$�H�	
�h����1��&�&�(�(��������������������	�7��s�A�A
�
A
)N)r
r#�serverrr�startuprrrrrrrr(�intr�rr�<module>r2s�� 
�	�	�	�
�
�
�
�'�'�'�'�'�'�'�'�0�0�0�0�0�0�0�0�����
���������>� � ��� �	�������*�+�+���,�+����	���������C��������r

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