/
lib
/
python3.9
/
site-packages
/
elftools
/
construct
/
__pycache__
/
up file
home
a �#�_� � @ sx d Z ddlmZ ddlZddlZddlZddlZddlmZm Z ddl mZmZm Z G dd� de�ZG d d � d e �ZdS )z$ Debugging utilities for constructs � )�print_functionN� )� Construct�Subconstruct)� HexString� Container� ListContainerc @ sN e Zd ZdZg d�ZdZddd�Zd d � Zdd� Zd d� Z dd� Z dd� ZdS )�Probea� A probe: dumps the context, stack frames, and stream content to the screen to aid the debugging process. See also Debugger. Parameters: * name - the display name * show_stream - whether or not to show stream contents. default is True. the stream must be seekable. * show_context - whether or not to show the context. default is True. * show_stack - whether or not to show the upper stack frames. default is True. * stream_lookahead - the number of bytes to dump when show_stack is set. default is 100. Example: Struct("foo", UBInt8("a"), Probe("between a and b"), UBInt8("b"), ) )� printname�show_stream�show_context� show_stack�stream_lookaheadr NT�d c C sP t �| d � |d u r.t jd7 _dtjf }|| _|| _|| _|| _|| _d S )Nr z<unnamed %d>) r �__init__r �counterr r r r r )�self�namer r r r � r �</usr/lib/python3.9/site-packages/elftools/construct/debug.pyr * s zProbe.__init__c C s d| j j| jf S )Nz%s(%r))� __class__�__name__r )r r r r �__repr__6 s zProbe.__repr__c C s | � ||� d S �N��printout�r �stream�contextr r r �_parse8 s zProbe._parsec C s | � ||� d S r r �r �objr r r r r �_build: s zProbe._buildc C s dS )Nr r )r r r r r �_sizeof<