Current File : //usr/share/gdb/python/gdb/dap/__pycache__/sources.cpython-39.pyc
a

ɱZh��@s�ddlZddlZddlmZmZddlmZdaiaia	edd��Z
edd��Zed	�ed
�dd���Zed
�dd�e
d�dd
��ZdS)�N�)�request�
capability)�
in_gdb_threadcCsL|tvrt|}n6||d�}tj�|�s@t|d<|tt<td7a|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.
    )�name�path�sourceReferencer)�_source_map�osr�exists�_next_source�_id_map)�fullname�filename�result�r�(/usr/share/gdb/python/gdb/dap/sources.py�make_source#s
�rcCsLd|vr|dSd|vr td��|d}|tvr@tdt|���t|dS)zUDecode a Source object.

    Finds and returns the filename of a given Source object.rrz8either 'path' or 'sourceReference' must appear in Sourcezno sourceReference )�	Exceptionr
�str)�source�refrrr�
decode_source?srZ
loadedSourcesZsupportsLoadedSourcesRequestcKs8g}t�d�dD]}|�t|d|d��qd|iS)Nz-file-list-exec-source-files�filesr�fileZsources)�gdbZ
execute_mi�appendr)�extrar�eltrrr�loaded_sourcesOs
�rr)r)rcKsP|durd|i}t|�}t|��}|��}Wd�n1s>0Yd|iS)Nr�content)r�open�read)rrrr�fr rrrrZs
&�)r
rZserverrrZstartuprrr	r
rrr�intrrrrr�<module>s