Current File : //proc/self/root/kunden/usr/share/gdb/python/gdb/dap/__pycache__/evaluate.cpython-39.opt-1.pyc
a

ɱZh��@srddlZddlmZddlmZddlmZmZmZddl	m
Z
ddlmZm
Z
mZGdd	�d	e
�Ze
d
d��Ze
dd
��ZGdd�de
�Ze
dd��Ze
dd��Zed�ed�ed�dddd�eeeed�dd����Ze
dd��Zed�dddd�eeed�d d��Zed!�ed"�ddd#�eeeed$�d%d&���Ze
d'd(��Zed)�ed*�dd+�eeed,�d-d.���ZdS)/�N)�Optional�)�select_frame)�
capability�request�client_bool_capability)�
in_gdb_thread)�
find_variable�VariableReference�apply_formatcseZdZ�fdd�Z�ZS)�EvaluateResultcst��d|d�dS)N�result��super�__init__��self�value��	__class__��)/usr/share/gdb/python/gdb/dap/evaluate.pyrszEvaluateResult.__init__��__name__�
__module__�__qualname__r�
__classcell__rrrrrsrcCsbt|��Fd}|dur"t|�d}tj||d�}t|�}|��Wd�S1sT0YdS�NTF)�global_context)rr�gdb�parse_and_evalr�	to_object)�expr�frame_id�value_formatr�val�refrrr�	_evaluate!s
r'c
Cs�t�dd���t�dd��dt�dd��8t|||�Wd�Wd�Wd�S1sf0YWd�n1s�0YWd�n1s�0YdS)Nzmay-write-registersZoffzmay-write-memoryzmay-call-functions)rZwith_parameterr')r"r#r$rrr�_eval_for_hover/sr(cseZdZ�fdd�Z�ZS)�
_SetResultcst��d|d�dS)Nrrrrrrr8sz_SetResult.__init__rrrrrr)7sr)cCsvt|��Zd}|dur"t|�d}tj||d�}tj||d�}|�|�t|���Wd�S1sh0YdSr)rrrr �assignr)r!)�
expressionrr#r$r�lhs�rhsrrr�_set_expression=s

r.cCs*|durt|�tj|ddd�}|dd�S)NT)Zfrom_ttyZ	to_stringr)r
�variablesReference)rrZexecute)Zcommandr#r%rrr�_replKs�r0ZevaluateZsupportsEvaluateForHoversZsupportsValueFormattingOptions�	variables)�frameId�context�format)r+r2r3cKsN|dvrt|||�S|dkr(t|||�S|dkr:t||�Std|d��dS)N)Zwatchr1Zhover�replzunknown evaluate context "�")r'r(r0�	Exception)r+r2r3r4�argsrrr�eval_requestVs
r9cCsNt|��2t|�}|�||�}dd�|D�Wd�S1s@0YdS)NcSsg|]}|���qSr)r!)�.0�xrrr�
<listcomp>r�z_variables.<locals>.<listcomp>)rr	Zfetch_children)r&�start�countr$�varZchildrenrrr�
_variablesms
rA)r>r?r4)r/r>r?cKs"td�sd}d}dt||||�iS)NZsupportsVariablePagingrr1)rrA)r/r>r?r4r8rrrr1usZsupportsSetExpressionZ
setExpression)r2r4)r+rr2cKst||||�S�N)r.)r+rr2r4r8rrr�set_expression�srCcCsZt|��>t|�}|�|�}t�|�}|�|�|��Wd�S1sL0YdSrB)rr	Zfind_child_by_namerr r*r!)r&�namerr$r@r,r-rrr�
_set_variable�s



rEZsupportsSetVariableZsetVariable)r4)r/rDrcKst||||�SrB)rE)r/rDrr4r8rrr�set_variable�srF)r�typingrZframesrZserverrrrZstartuprZvarrefr	r
rrr'r(r)r.r0�str�intr9rAr1rCrErFrrrr�<module>s^






��
���
�
	��