HEX
Server: LiteSpeed
System: Linux br-asc-web1845.main-hosting.eu 5.14.0-611.42.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 24 05:30:20 EDT 2026 x86_64
User: u790421558 (790421558)
PHP: 8.2.30
Disabled: system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //lib/python3.9/site-packages/elftools/dwarf/__pycache__/lineprogram.cpython-39.pyc
a

�#�_/�@s^ddlZddlZddlmZddlmZddlTedd�ZGd	d
�d
e�Z	Gdd�de�Z
dS)
�N)�
namedtuple�)�struct_parse�)�*�LineProgramEntryzcommand is_extended args statec@s eZdZdZdd�Zdd�ZdS)�	LineStatez� Represents a line program state (or a "row" in the matrix
        describing debug location information for addresses).
        The instance variables of this class are the "state machine registers"
        described in section 6.2.2 of DWARFv3
    cCsLd|_d|_d|_d|_d|_||_d|_d|_d|_d|_	d|_
d|_dS)NrrF)�address�file�line�column�op_index�is_stmt�basic_block�end_sequence�prologue_end�epilogue_begin�isa�
discriminator)�self�default_is_stmt�r�>/usr/lib/python3.9/site-packages/elftools/dwarf/lineprogram.py�__init__1szLineState.__init__cCsNdt|�g}|�d|j�dD]}|�d|t||�f�q"d�|�dS)Nz<LineState %x:z  address = 0x%x)
r
rrrrrrrrrz	  %s = %s�
z>
)�id�appendr	�getattr�join)r�a�attrrrr�__repr__?s
zLineState.__repr__N)�__name__�
__module__�__qualname__�__doc__rr!rrrrr+src@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�LineProgramz� Builds a "line table", which is essentially the matrix described
        in section 6.2 of DWARFv3. It's a list of LineState objects,
        sorted by increasing address, so it can be used to obtain the
        state information for each address.
    cCs(||_||_||_||_||_d|_dS)a�
            header:
                The header of this line program. Note: LineProgram may modify
                its header by appending file entries if DW_LNE_define_file
                instructions are encountered.

            stream:
                The stream this program can be read from.

            structs:
                A DWARFStructs instance suitable for this line program

            program_{start|end}_offset:
                Offset in the debug_line section stream where this program
                starts (the actual program, after the header), and where it
                ends.
                The actual range includes start but not end: [start, end - 1]
        N)�stream�header�structs�program_start_offset�program_end_offset�_decoded_entries)rr(r'r)r*r+rrrrOszLineProgram.__init__cCs|jdur|��|_|jS)a� Get the decoded entries for this line program. Return a list of
            LineProgramEntry objects.
            Note that this contains more information than absolutely required
            for the line table. The line table can be easily extracted from
            the list of entries by looking only at entries with non-None
            state. The extra information is mainly for the purposes of display
            with readelf and debugging.
        N)r,�_decode_line_program)rrrr�get_entriesjs	

zLineProgram.get_entriescCs
|j|S)z6 Implement dict-like access to header entries
        )r()r�namerrr�__getitem__yszLineProgram.__getitem__c
sBg�t|jd��d��fdd�	}d�fdd�	}|j}||jk�r>t|j�d�|j|�}||jdkr�|d	}||d}||d
}|d�j||}�j	|7_	�j||�_|d||d
}	�j
|	7_
|||	|�jg��n@|d
k�rt|j�d�|j�}
t|j�d�|j�}|tk�rRd�_
||gdd�t|jd��n�|tk�r�t|j�d�|j�}|�_	|||gdd�nt|tk�r�t|jj|j�}|d�|�|||gdd�n:|tk�r�t|j�d�|j�}|�_n|j�|
dtj��n2|tk�r||g��n|tk�rbt|j�d�|j�}||jd}�j	|7_	|||g��n�|tk�r�t|j�d�|j�}�j
|7_
�n�|tk�r�t|j�d�|j�}|�_|||g��nl|tk�r�t|j�d�|j�}|�_|||g��n8|t k�r�j!�_!||g��n|t"k�r8d�_#||g�n�|t$k�r~d|d}||d
|d}�j	|7_	|||g�n�|t%k�r�t|j�&d�|j�}�j	|7_	|||g�nz|t'k�r�d�_(||g�n^|t)k�r�d�_*||g�nB|t+k�r"t|j�d�|j�}|�_,|||g�nt-dd|f�|j�.�}q6�S)NrFc	s6��t|||t�����d�_d�_d�_d�_dS)NrF)rr�copyrrrr��cmd�args�is_extended��entries�staterr�add_entry_new_state�s�z=LineProgram._decode_line_program.<locals>.add_entry_new_statecs��t|||d��dS)N)rrr2)r7rr�add_entry_old_state�sz=LineProgram._decode_line_program.<locals>.add_entry_old_state�Zopcode_base�"maximum_operations_per_instructionZ
line_rangeZminimum_instruction_lengthZ	line_baserT)r5Z
file_entryr�z(Invalid standard line program opcode: %s)F)F)/rr(r*r+rr)ZDwarf_uint8r'r
r	rZ
Dwarf_uleb128ZDW_LNE_end_sequencerZDW_LNE_set_addressZDwarf_target_addrZDW_LNE_define_fileZDwarf_lineprog_file_entryrZDW_LNE_set_discriminatorr�seek�os�SEEK_CURZDW_LNS_copyZDW_LNS_advance_pcZDW_LNS_advance_lineZ
Dwarf_sleb128ZDW_LNS_set_filer
ZDW_LNS_set_columnrZDW_LNS_negate_stmtrZDW_LNS_set_basic_blockrZDW_LNS_const_add_pcZDW_LNS_fixed_advance_pcZDwarf_uint16ZDW_LNS_set_prologue_endrZDW_LNS_set_epilogue_beginrZDW_LNS_set_isarZdwarf_assert�tell)
rr9r:�offsetZopcoder<Zadjusted_opcodeZoperation_advanceZaddress_addendZline_addendZinst_lenZ	ex_opcode�operandrr6rr-~s�

�
����
��

�

�
�

��
�
�
�




�
�


��z LineProgram._decode_line_programN)r"r#r$r%rr.r0r-rrrrr&Is
r&)r?r1�collectionsrZcommon.utilsrZ	constantsr�objectrr&rrrr�<module>	s�