Ë
    Öùdyu  ã                   ó´  — d dl Z d dlmZ ddlmZmZmZmZ ddlm	Z	m
Z
 ddlmZ ddlmZ dd	l­  G d
„ de«      Zd„ Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z edd«      ZdZdZi Z e e«       jA                  «       «      D ]!  Z!e!jE                  d«      sŒe!e e«       e!   <   Œ# y) é    N)Ú
namedtupleé   )Ústruct_parseÚdwarf_assertÚpreserve_stream_posÚ	iterbytes)ÚStructÚSwitché   )ÚDW_EH_encoding_flags)ÚDWARFStructs)Ú*c                   ó`   — e Zd ZdZ	 dd„Zd„ Zd„ Zd„ Zd„ Zd„ Z	d„ Z
d	„ Zd
„ Zd„ Zed„ «       Zy)ÚCallFrameInfoaÿ   DWARF CFI (Call Frame Info)

    Note that this also supports unwinding information as found in .eh_frame
    sections: its format differs slightly from the one in .debug_frame. See
    <http://www.airs.com/blog/archives/460>.

        stream, size:
            A stream holding the .debug_frame section, and the size of the
            section in it.

        address:
            Virtual address for this section. This is used to decode relative
            addresses.

        base_structs:
            The structs to be used as the base for parsing this section.
            Eventually, each entry gets its own structs based on the initial
            length field it starts with. The address_size, however, is taken
            from base_structs. This appears to be a limitation of the DWARFv3
            standard, fixed in v4.
            A discussion I had on dwarf-discuss confirms this.
            So for DWARFv4 we'll take the address size from the CIE header,
            but for earlier versions will use the elfclass of the containing
            file; more sophisticated methods are used by libdwarf and others,
            such as guessing which CU contains which FDEs (based on their
            address ranges) and taking the address_size from those CUs.
    c                 óf   — || _         || _        || _        || _        d | _        i | _        || _        y ©N)ÚstreamÚsizeÚaddressÚbase_structsÚentriesÚ_entry_cacheÚfor_eh_frame)Úselfr   r   r   r   r   s         ú:/usr/lib/python3/dist-packages/elftools/dwarf/callframe.pyÚ__init__zCallFrameInfo.__init__/   s:   € àˆŒØˆŒ	ØˆŒØ(ˆÔØˆŒð
 ˆÔð
 )ˆÕó    c                 ó\   — | j                   €| j                  «       | _         | j                   S )z« Get a list of entries that constitute this CFI. The list consists
            of CIE or FDE objects, in the order of their appearance in the
            section.
        )r   Ú_parse_entries©r   s    r   Úget_entrieszCallFrameInfo.get_entriesA   s(   € ð
 �<‰<ÐØ×.Ñ.Ó0ˆDŒLØ�|‰|Ðr   c                 óÀ   — g }d}|| j                   k  rJ|j                  | j                  |«      «       | j                  j	                  «       }|| j                   k  rŒJ|S )Nr   )r   ÚappendÚ_parse_entry_atr   Útell)r   r   Úoffsets      r   r   zCallFrameInfo._parse_entriesL   sV   € ØˆØˆØ�t—y‘yÒ Ø�N‰N˜4×/Ñ/°Ó7Ô8Ø—[‘[×%Ñ%Ó'ˆFð �t—y‘yÓ ð ˆr   c           	      ó¸  — || j                   v r| j                   |   S t        | j                  j                  d«      | j                  |«      }| j
                  r|dk(  rt        |«      S |dk(  rdnd}t        | j                  j                  || j                  j                  ¬«      }t        |j                  d«      | j                  «      }| j
                  r|dk(  }n|dk(  xr |dk(  xs |dk(  }|r<| j
                  r|j                  n|j                  }t        || j                  |«      }n| j                  ||«      }| j
                  s;|j                  dk\  r,t        |j                  |j                  |j                  ¬«      }|r| j!                  ||«      \  }	}
n�| j#                  |||«      }| j%                  |«      }	|j&                  j)                  d	t*        d
   «      }|t*        d
   k7  r8| j-                  || j                  j/                  «       t1        |	«      z
  |«      }nd}||j2                  z   |j5                  «       z   }| j7                  || j                  j/                  «       |«      }|rt9        |||
|	|¬«      | j                   |<   n2| j#                  |||«      }t;        ||||||	¬«      | j                   |<   | j                   |   S )z¨ Parse an entry from self.stream starting with the given offset.
            Return the entry object. self.stream will point right after the
            entry.
        Ú r   l   ÿÿ é@   é    )Úlittle_endianÚdwarf_formatÚaddress_sizel   ÿÿÿÿ é   ÚLSDA_encodingÚDW_EH_PE_omitN)ÚheaderÚinstructionsr&   Úaugmentation_dictÚaugmentation_bytesÚstructs)r1   r2   r&   r5   Úcier4   Úlsda_pointer)r   r   r   ÚDwarf_uint32r   r   ÚZEROr   r+   r-   ÚDwarf_offsetÚEH_CIE_headerÚDwarf_CIE_headerÚ_parse_fde_headerÚdwarf_versionr,   Ú_parse_cie_augmentationÚ_parse_cie_for_fdeÚ_read_augmentation_datar3   Úgetr   Ú_parse_lsda_pointerr%   ÚlenÚlengthÚinitial_length_field_sizeÚ_parse_instructionsÚCIEÚFDE)r   r&   Úentry_lengthr,   Úentry_structsÚCIE_idÚis_CIEÚheader_structr1   Ú	aug_bytesÚaug_dictr6   Úlsda_encodingr7   Ú
end_offsetr2   s                   r   r$   zCallFrameInfo._parse_entry_atT   sö  € ð
 �T×&Ñ&Ñ&Ø×$Ñ$ VÑ,Ð,ä#Ø×Ñ×*Ñ*¨2Ó.°·±¸VóEˆð ×Ò °Ò!2Ü˜“<Ðà)¨ZÒ7‘r¸Rˆä$Ø×+Ñ+×9Ñ9Ø%Ø×*Ñ*×7Ñ7ô9ˆô Ø×&Ñ& rÓ*¨D¯K©Kó9ˆð ×ÒØ˜q‘[‰Fð  Ñ#Ò<¨°*Ñ(<ò -ØÐ,Ñ,ð ñ à $× 1Ò 1ð +×8Ò8à*×;Ñ;ð ô "Ø˜tŸ{™{¨Fó4‰Fð ×+Ñ+¨M¸6ÓBˆFð
 × Ò  ]×%@Ñ%@ÀAÒ%EÜ(Ø+×9Ñ9Ø*×7Ñ7Ø#×0Ñ0ô2ˆMñ Ø"&×">Ñ">Ø˜Mó#+ÑˆI‘xð ×)Ñ)¨&°&¸-ÓHˆCØ×4Ñ4°]ÓCˆIØ×1Ñ1×5Ñ5°oÔG[Ð\kÑGlÓmˆMØÔ 4°_Ñ EÒEà#×7Ñ7¸Ø8<¿¹×8HÑ8HÓ8JÌSÐQZË^Ñ8[Ø8Eó G‘ð  $�ð �V—]‘]Ñ"Ø×3Ñ3Ó5ñ6ð 	ð ×/Ñ/Ø˜4Ÿ;™;×+Ñ+Ó-¨zó;ˆñ Ü(+Ø¨LÀØ"*Ø#,Ø%ô	)'ˆD×Ñ˜fÒ%ð ×)Ñ)¨&°&¸-ÓHˆCÜ(+Ø¨LÀØ%¨3Ø#,Ø)ô	)ˆD×Ñ˜fÑ%ð × Ñ  Ñ(Ð(r   c                 óN  — g }||k  �rœt        |j                  d«      | j                  |«      }g }|t        z  }|t        z  }|t
        k(  r|g}�n|t        k(  r)|t        |j                  d«      | j                  «      g}�nå|t        k(  r|g}�n×|t        t        t        fv rg }�nÀ|t        k(  r(t        |j                  d«      | j                  «      g}�n�|t        k(  r(t        |j                  d«      | j                  «      g}�n^|t        k(  r(t        |j!                  d«      | j                  «      g}�n-|t"        k(  r(t        |j%                  d«      | j                  «      g}�nü|t&        t(        t*        t,        fv rLt        |j                  d«      | j                  «      t        |j                  d«      | j                  «      g}�n˜|t.        t0        t2        t4        t6        fv r(t        |j                  d«      | j                  «      g}�nS|t8        k(  r(t        |j;                  d«      | j                  «      g}�n"|t<        k(  r%t        |j>                  d   | j                  «      g}nô|t@        tB        fv rIt        |j                  d«      | j                  «      t        |j>                  d   | j                  «      g}n�|tD        tF        tH        fv rKt        |j                  d«      | j                  «      t        |j;                  d«      | j                  «      g}n?|tJ        k(  r't        |j                  d«      | j                  «      g}ntM        dd|z  «       |jO                  tQ        ||¬«      «       | j                  jS                  «       }||k  r�Œœ|S )zÂ Parse a list of CFI instructions from self.stream, starting with
            the offset and until (not including) end_offset.
            Return a list of CallFrameInstruction objects.
        r(   ÚDW_FORM_blockFzUnknown CFI opcode: 0x%x©ÚopcodeÚargs)*r   ÚDwarf_uint8r   Ú_PRIMARY_MASKÚ_PRIMARY_ARG_MASKÚDW_CFA_advance_locÚDW_CFA_offsetÚDwarf_uleb128ÚDW_CFA_restoreÚ
DW_CFA_nopÚDW_CFA_remember_stateÚDW_CFA_restore_stateÚDW_CFA_set_locÚDwarf_target_addrÚDW_CFA_advance_loc1ÚDW_CFA_advance_loc2ÚDwarf_uint16ÚDW_CFA_advance_loc4r8   ÚDW_CFA_offset_extendedÚDW_CFA_registerÚDW_CFA_def_cfaÚDW_CFA_val_offsetÚDW_CFA_restore_extendedÚDW_CFA_undefinedÚDW_CFA_same_valueÚDW_CFA_def_cfa_registerÚDW_CFA_def_cfa_offsetÚDW_CFA_def_cfa_offset_sfÚDwarf_sleb128ÚDW_CFA_def_cfa_expressionÚDwarf_dw_formÚDW_CFA_expressionÚDW_CFA_val_expressionÚDW_CFA_offset_extended_sfÚDW_CFA_def_cfa_sfÚDW_CFA_val_offset_sfÚDW_CFA_GNU_args_sizer   r#   ÚCallFrameInstructionr%   )	r   r5   r&   rR   r2   rV   rW   ÚprimaryÚprimary_args	            r   rG   z!CallFrameInfo._parse_instructions´   sL  € ð
 ˆØ�zÓ!Ü! '×"5Ñ"5°bÓ"9¸4¿;¹;ÈÓOˆFØˆDàœ}Ñ,ˆGØ Ô#4Ñ4ˆKØÔ,Ò,Ø#�}’ØœMÒ)àÜ  ×!6Ñ!6°rÓ!:¸D¿K¹KÓHðJ’ð œNÒ*Ø#�}’àœJÔ(=Ü0ð2ñ 2à’Øœ>Ò)ä  ×!:Ñ!:¸2Ó!>ÀÇÁÓLðN’àÔ.Ò.Ü$ W×%8Ñ%8¸Ó%<¸d¿k¹kÓJÐK’ØÔ.Ò.Ü$ W×%9Ñ%9¸"Ó%=¸t¿{¹{ÓKÐL’ØÔ.Ò.Ü$ W×%9Ñ%9¸"Ó%=¸t¿{¹{ÓKÐL’ØÔ2´OÜ*Ô,=ð?ñ ?ô ! ×!6Ñ!6°rÓ!:¸D¿K¹KÓHÜ  ×!6Ñ!6°rÓ!:¸D¿K¹KÓHðJ’ð Ô3Ô5EÜ-Ô/FÜ1ð3ñ 3ô % W×%:Ñ%:¸2Ó%>ÀÇÁÓLÐM’ØÔ3Ò3Ü$ W×%:Ñ%:¸2Ó%>ÀÇÁÓLÐM’ØÔ4Ò4Ü$Ø×)Ñ)¨/Ñ:¸D¿K¹KóIð J‘àÔ-Ô/DÐEÑEä  ×!6Ñ!6°rÓ!:¸D¿K¹KÓHÜ Ø×-Ñ-¨oÑ>ÀÇÁóMðN‘ð Ô5Ü-Ô/CðEñ Eô ! ×!6Ñ!6°rÓ!:¸D¿K¹KÓHÜ  ×!6Ñ!6°rÓ!:¸D¿K¹KÓHðJ‘ð Ô/Ò/Ü$ W×%:Ñ%:¸2Ó%>ÀÇÁÓLÐM‘ä˜UÐ$>ÀÑ$GÔHà×ÑÔ 4¸FÈÔ NÔOØ—[‘[×%Ñ%Ó'ˆFðs �zÔ!ðt Ðr   c                 óÒ   — | j                   r|d   }||j                  dz  z   |z
  }n|d   }t        | j                  «      5  | j	                  |«      cddd«       S # 1 sw Y   yxY w)z3 Parse the CIE that corresponds to an FDE.
        ÚCIE_pointeré   N)r   r,   r   r   r$   )r   Ú
fde_offsetÚ
fde_headerrK   Úcie_displacementÚ
cie_offsets         r   r@   z CallFrameInfo._parse_cie_for_fdeö   st   € ð ×Òð  *¨-Ñ8ÐØ$ }×'AÑ'AÀQÑ'FÑFØ,ñ-‰Jð $ MÑ2ˆJô ! §¡Ó-ñ 	4Ø×'Ñ'¨
Ó3÷	4÷ 	4ò 	4ús   ÁAÁA&c                 óB  — |j                  d«      }|sdi fS |j                  d«      sJ dj                  t        |«      «      «       ‚|j	                  d«      |j                  d«      |j                  d«      dt        d	|j                  d
«      t        dd„ | j                  |«      j                  «       D ��ci c]  \  }}| |d«      “Œ c}}«      «      dœ}g }i }t        |«      D ]#  }		 ||	   }
|
du rd||
<   Œ|j                  |
«       Œ% | j                  j                  «       }t        dg|¢­Ž }|j                  t!        || j                  |«      «       | j                  j#                  |«       | j%                  |«      }||fS c c}}w # t        $ r Y  ŒŽw xY w)zã Parse CIE augmentation data from the annotation string in `header`.

        Return a tuple that contains 1) the augmentation data as a string
        (without the length field) and 2) the augmentation data as a dict.
        Úaugmentationr(   ó   zz!Unhandled augmentation string: {}rE   r/   ÚFDE_encodingTÚpersonalityÚencodingÚfunctionc                 ó    — | j                   dz  S )Né   )rŠ   )Úctxs    r   ú<lambda>z7CallFrameInfo._parse_cie_augmentation.<locals>.<lambda>  s   € ¨s¯|©|¸dÑ/B€ r   )r‡   ó   Ló   Ró   Só   PÚAugmentation_Data)rB   Ú
startswithÚformatÚreprr]   rX   r	   r
   Ú_eh_encoding_to_fieldÚitemsr   ÚKeyErrorr#   r   r%   Úupdater   ÚseekrA   )r   r1   rK   r†   ÚencÚfld_consÚavailable_fieldsÚfieldsrP   ÚbÚfldr&   ÚstructrO   s                 r   r?   z%CallFrameInfo._parse_cie_augmentation  sÀ  € ð —z‘z .Ó1ˆÙØ˜�8ˆOð ×&Ñ& tÔ,ð 	LØ/×6Ñ6´t¸LÓ7IÓJó	LÐ,ð  ×-Ñ-¨hÓ7Ø×+Ñ+¨OÓ<Ø×+Ñ+¨NÓ;ØÜØØ×)Ñ)¨*Ó5Ü�zÑ#Bð ×1Ñ1°-Ó@×FÑFÓH÷EJá%˜˜Xð ™ *Ó-Ñ-óEJó KóLñ
Ðð  ˆØˆä˜<Ó(ò 		#ˆAðØ& qÑ)�ð �d‰{Ø $�˜’à—‘˜cÕ"ð		#ð  —‘×!Ñ!Ó#ˆÜÐ+Ð5¨fÒ5ˆØ�‰œ V¨T¯[©[¸&ÓAÔBØ�‰×Ñ˜Ô Ø×0Ñ0°Ó?ˆ	Ø˜8Ð$Ð$ùóAEJøô ò Úðús   Â9FÃ-FÆ	FÆFc                 ó¶   — | j                   syt        t        d|j                  d«      «      | j                  «      d   }| j                  j                  |«      S )z¿ Read augmentation data.

        This assumes that the augmentation string starts with 'z', i.e. that
        augmentation data is prefixed by a length field, which is not returned.
        r   ÚDummy_Augmentation_DatarE   )r   r   r	   r]   r   Úread)r   rK   Úaugmentation_data_lengths      r   rA   z%CallFrameInfo._read_augmentation_dataA  s]   € ð × Ò Øä#/ÜÐ,Ø ×.Ñ.¨xÓ8ó:à�K‰Kó$ð "ñ$#Ð ð �{‰{×ÑÐ 8Ó9Ð9r   c                 ó:  — |t         d   k7  sJ ‚|dz  }|dz  }| j                  |«      }t        t        d ||   d«      «      | j                  |¬«      d   }|t         d   k(  r	 |S |t         d   k(  r|| j
                  |z   z  }|S J d	j                  |«      «       ‚)
a}   Parse bytes to get an LSDA pointer.

        The basic encoding (lower four bits of the encoding) describes how the values are encoded in a CIE or an FDE.
        The modifier (upper four bits of the encoding) describes how the raw values, after decoded using a basic
        encoding, should be modified before using.

        Ref: https://www.airs.com/blog/archives/460
        r0   r�   éð   r”   ÚLSDA_pointer)Ú
stream_posÚDW_EH_PE_absptrÚDW_EH_PE_pcrelz5Unsupported encoding modifier for LSDA pointer: {:#x})r   r˜   r   r	   r   r   r–   )r   r5   Ústream_offsetrŠ   Úbasic_encodingÚmodifierÚformatsÚptrs           r   rC   z!CallFrameInfo._parse_lsda_pointerP  sÓ   € ð Ô/°Ñ@Ò@Ð@Ð@Ø! D™ˆØ˜d‘?ˆà×,Ñ,¨WÓ5ˆäÜÐ&Ø*�7˜>Ñ*¨>Ó:ó<à�K‰K Mô3ð 4BñCˆð
 Ô+Ð,=Ñ>Ò>Øð ˆ
ð Ô-Ð.>Ñ?Ò?Ø�4—<‘< -Ñ/Ñ/ˆCð
 ˆ
ð cÐQ×XÑXÐYaÓbÓb�5r   c                 óâ  — | j                   s!t        |j                  | j                  |«      S |j	                  d«      |j                  d«      g}t        t        dg|¢­Ž | j                  |«      }| j                  |||«      }| j                  j                  «       }|j                  d   }|t        d   k7  sJ ‚|dz  }|dz  }	| j                  |«      }
|j                   |
|   d«      «       |j                   |
|   d	«      «       t        t        d
g|¢­Ž | j                  |«      }|	dk(  r	 |S |	t        d   k(  r|dxx   | j                  |z   z  cc<   |S J dj                  |«      «       ‚)zB Compute a struct to parse the header of the current FDE.
        rE   r   Úeh_frame_minimal_headerrˆ   r0   r�   r©   Úinitial_locationÚaddress_rangeÚDwarf_FDE_headerr   r­   zUnsupported encoding: {:#x})r   r   r·   r   ÚDwarf_initial_lengthr:   r	   r@   r%   r3   r   r˜   r#   r   r–   )r   rK   r&   r    Úminimal_headerr6   Úinitial_location_offsetrŠ   r¯   Úencoding_modifierr±   Úresults               r   r=   zCallFrameInfo._parse_fde_headero  s¢  € ð × Ò Ü × >Ñ >ÀÇÁØ &ó(ð (ð  ×4Ñ4°XÓ>Ø×,Ñ,¨]Ó;ð=ˆô
 &¤fÐ-Fð '6Ø.4ò'6Ø7;·{±{ÀFóLˆà×%Ñ% f¨n¸mÓLˆØ"&§+¡+×"2Ñ"2Ó"4Ðð
 ×(Ñ(¨Ñ8ˆØÔ/°Ñ@Ò@Ð@Ð@Ø! D™ˆØ$ t™OÐð ×,Ñ,¨]Ó;ˆØ�‰Ð-�g˜nÑ-Ð.@ÓAÔBØ�‰Ð-�g˜nÑ-¨oÓ>Ô?äœfÐ%7ÐA¸&ÒAØ"Ÿk™k¨6ó3ˆð  Ò!Øð ˆð Ô"6Ð7GÑ"HÒHð Ð%Ó&Ø—‘Ð6Ñ6ñ8Ó&ð
 ˆð IÐ7×>Ñ>¸xÓHÓH�5r   c                 ó\  — t         d   | j                  t         d   | j                  t         d   | j                  t         d   | j                  t         d   | j
                  t         d   | j                  t         d   | j                  t         d   | j                  t         d	   | j                  i	S )
z®
        Return a mapping from basic encodings (DW_EH_encoding_flags) the
        corresponding field constructors (for instance
        entry_structs.Dwarf_uint32).
        r¬   ÚDW_EH_PE_uleb128ÚDW_EH_PE_udata2ÚDW_EH_PE_udata4ÚDW_EH_PE_udata8ÚDW_EH_PE_sleb128ÚDW_EH_PE_sdata2ÚDW_EH_PE_sdata4ÚDW_EH_PE_sdata8)
r   rc   r]   rf   r8   ÚDwarf_uint64rr   ÚDwarf_int16ÚDwarf_int32ÚDwarf_int64)rK   s    r   r˜   z#CallFrameInfo._eh_encoding_to_field�  s°   € ô !Ð!2Ñ3Ø×/Ñ/Ü Ð!3Ñ4Ø×+Ñ+Ü Ð!2Ñ3Ø×*Ñ*Ü Ð!2Ñ3Ø×*Ñ*Ü Ð!2Ñ3Ø×*Ñ*ä Ð!3Ñ4Ø×+Ñ+Ü Ð!2Ñ3Ø×)Ñ)Ü Ð!2Ñ3Ø×)Ñ)Ü Ð!2Ñ3Ø×)Ñ)ð'
ð 	
r   N)F)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r!   r   r$   rG   r@   r?   rA   rC   r=   Ústaticmethodr˜   © r   r   r   r      sX   „ ñð8 $ó)ò$òò^)ò@@òD4ò$7%òr:òò>,ð\ ñ
ó ñ
r   r   c                 óB   — | t         z  }|dk(  r	t        |    S t        |   S )z3 Given an opcode, return the instruction name.
    r   )rY   Ú_OPCODE_NAME_MAP)rV   r|   s     r   Úinstruction_namerÒ   »  s+   € ð ”}Ñ$€GØ�!‚|Ü Ñ'Ð'ä Ñ(Ð(r   c                   ó   — e Zd ZdZd„ Zd„ Zy)r{   a   An instruction in the CFI section. opcode is the instruction
        opcode, numeric - as it appears in the section. args is a list of
        arguments (including arguments embedded in the low bits of some
        instructions, when applicable), decoded from the stream.
    c                 ó    — || _         || _        y r   rU   )r   rV   rW   s      r   r   zCallFrameInstruction.__init__Ë  s   € ØˆŒØˆ�	r   c                 ó`   — dt        | j                  «      | j                  | j                  fz  S )Nz%s (0x%x): %s)rÒ   rV   rW   r    s    r   Ú__repr__zCallFrameInstruction.__repr__Ï  s/   € ØÜ˜TŸ[™[Ó)¨4¯;©;¸¿	¹	ð"Cñ Cð 	Cr   N©rÊ   rË   rÌ   rÍ   r   rÖ   rÏ   r   r   r{   r{   Å  s   „ ñò
óCr   r{   c                   ó,   — e Zd ZdZ	 dd„Zd„ Zd„ Zd„ Zy)ÚCFIEntryaX   A common base class for CFI entries.
        Contains a header and a list of instructions (CallFrameInstruction).
        offset: the offset of this entry from the beginning of the section
        cie: for FDEs, a CIE pointer is required
        augmentation_dict: Augmentation data as a parsed struct (dict): see
            CallFrameInfo._parse_cie_augmentation and
            http://www.airs.com/blog/archives/460.
        augmentation_bytes: Augmentation data as a chain of bytes: see
            CallFrameInfo._parse_cie_augmentation and
            http://www.airs.com/blog/archives/460.
    Nc                 ó|   — || _         || _        || _        || _        || _        d | _        |r|ni | _        || _        y r   )r1   r5   r2   r&   r6   Ú_decoded_tabler3   r4   )r   r1   r5   r2   r&   r3   r4   r6   s           r   r   zCFIEntry.__init__à  sC   € àˆŒØˆŒØ(ˆÔØˆŒØˆŒØ"ˆÔÙ6GÑ!2ÈRˆÔØ"4ˆÕr   c                 ó\   — | j                   €| j                  «       | _         | j                   S )zÙ Decode the CFI contained in this entry and return a
            DecodedCallFrameTable object representing it. See the documentation
            of that class to understand how to interpret the decoded table.
        )rÛ   Ú_decode_CFI_tabler    s    r   Úget_decodedzCFIEntry.get_decodedë  s-   € ð
 ×ÑÐ&Ø"&×"8Ñ"8Ó":ˆDÔØ×"Ñ"Ð"r   c                 ó    — | j                   |   S )z6 Implement dict-like access to header entries
        )r1   )r   Únames     r   Ú__getitem__zCFIEntry.__getitem__ô  s   € ð �{‰{˜4Ñ Ð r   c                 ó‚  ‡— t        | t        «      r| }t        dt        dd¬«      ¬«      }g Šnª| j                  }|j                  «       }t        |j                  «      dkD  r8t        j                  |j                  d   «      }t        j                  |«      }nt        t        dd¬«      ¬«      }| d   |d<   t        j                  |j                  «      Šg }g }ˆfd	„}| j                  D �]”  }t        |j                  «      }	|	d
k(  r7|j                  t        j                  |«      «       |j                  d   |d<   ŒU|	dv rE|j                  t        j                  |«      «       |dxx   |j                  d   |d   z  z  cc<   Œž|	dk(  r+t        |j                  d   |j                  d   ¬«      |d<   ŒÎ|	dk(  r2t        |j                  d   |j                  d   |d   z  ¬«      |d<   �Œ|	dk(  r,t        |j                  d   |d   j                  ¬«      |d<   �Œ6|	dk(  r,t        |d   j                   |j                  d   ¬«      |d<   �Œg|	dk(  rt        |j                  d   ¬«      |d<   �ŒŠ|	dk(  r@ ||j                  d   «       t#        t"        j$                  «      ||j                  d   <   �ŒÏ|	dk(  r@ ||j                  d   «       t#        t"        j&                  «      ||j                  d   <   �Œ|	dv rT ||j                  d   «       t#        t"        j(                  |j                  d   |d   z  «      ||j                  d   <   �Œl|	dv rT ||j                  d   «       t#        t"        j*                  |j                  d   |d   z  «      ||j                  d   <   �ŒÄ|	dk(  rN ||j                  d   «       t#        t"        j,                  |j                  d   «      ||j                  d   <   �Œ|	dk(  rN ||j                  d   «       t#        t"        j.                  |j                  d   «      ||j                  d   <   �Œj|	dk(  rN ||j                  d   «       t#        t"        j0                  |j                  d   «      ||j                  d   <   �Œ½|	dv rˆ ||j                  d   «       t3        t        | t4        «      d|	z  «       |j                  d   v r$||j                  d      ||j                  d   <   �Œ(|j7                  |j                  d   d«       �ŒI|	dk(  r&|j                  t        j8                  |«      «       �Œt|	d k(  s�Œ{|d   }
|j7                  «       }|
|d<   �Œ— |d   j                   €t        |«      d!kD  r|j                  |«       t;        |‰¬"«      S )#zr Decode the instructions contained in the given CFI entry and return
            a DecodedCallFrameTable.
        r   N)Úregr&   )ÚpcÚcfaéÿÿÿÿ)rå   rµ   rä   c                 ó2   •— | ‰vr‰j                  | «       y y r   )r#   )ÚregnumÚ	reg_orders    €r   Ú_add_to_orderz1CFIEntry._decode_CFI_table.<locals>._add_to_order  s    ø€ ð ˜YÑ&Ø× Ñ  Õ(ð 'r   rb   )rd   re   rg   r[   Úcode_alignment_factorrj   r   rå   rx   ro   rp   rs   )Úexprrm   rn   )r\   rh   rw   Údata_alignment_factor)rk   ry   ri   ru   rv   )r^   rl   z%s instruction must be in a FDEr`   ra   r   )Útableré   )Ú
isinstancerH   ÚdictÚCFARuler6   rÞ   rD   rî   Úcopyré   r2   rÒ   rV   r#   rW   r&   rã   ÚRegisterRuleÚ	UNDEFINEDÚ
SAME_VALUEÚOFFSETÚ
VAL_OFFSETÚREGISTERÚ
EXPRESSIONÚVAL_EXPRESSIONr   rI   ÚpopÚdeepcopyÚDecodedCallFrameTable)r   r6   Úcur_lineÚcie_decoded_tableÚlast_line_in_CIErî   Ú
line_stackrê   Úinstrrà   rä   ré   s              @r   rÝ   zCFIEntry._decode_CFI_tableù  s0  ø€ ô �dœCÔ àˆCÜ˜q¤g°$¸qÔ&AÔBˆHØ‰Ið
 —(‘(ˆCØ #§¡Ó 1ÐÜÐ$×*Ñ*Ó+¨aÒ/Ü#'§9¡9Ð->×-DÑ-DÀRÑ-HÓ#IÐ ÜŸ9™9Ð%5Ó6‘ä¤G°¸QÔ$?Ô@�Ø!Ð"4Ñ5ˆH�T‰NÜŸ	™	Ð"3×"=Ñ"=Ó>ˆIàˆð ˆ
ô	)ð ×&Ñ&ó N	$ˆEô
 $ E§L¡LÓ1ˆDàÐ'Ò'Ø—‘œTŸY™Y xÓ0Ô1Ø!&§¡¨A¡�˜’Øð Iñ Ià—‘œTŸY™Y xÓ0Ô1Ø˜“ %§*¡*¨Q¡-°#Ð6MÑ2NÑ"NÑN”ØÐ)Ò)Ü")ØŸ
™
 1™Ø Ÿ:™: a™=ô#*�˜’ð Ð,Ò,Ü")ØŸ
™
 1™Ø Ÿ:™: a™=¨3Ð/FÑ+GÑGô#I�˜“ð Ð2Ò2Ü")ØŸ
™
 1™Ø# E™?×1Ñ1ô#3�˜“ð Ð0Ò0Ü")Ø  ™×+Ñ+Ø Ÿ:™: a™=ô#*�˜“ð Ð4Ò4Ü")¨u¯z©z¸!©}Ô"=�˜“ØÐ+Ò+Ù˜eŸj™j¨™mÔ,Ü*6´|×7MÑ7MÓ*N�˜Ÿ™ A™Ó'ØÐ,Ò,Ù˜eŸj™j¨™mÔ,Ü*6´|×7NÑ7NÓ*O�˜Ÿ™ A™Ó'Øð 9ñ 9á˜eŸj™j¨™mÔ,Ü*6Ü ×'Ñ'Ø—J‘J˜q‘M CÐ(?Ñ$@Ñ@ó+B�˜Ÿ™ A™Ó'ð ÐFÑFÙ˜eŸj™j¨™mÔ,Ü*6Ü ×+Ñ+Ø—J‘J˜q‘M CÐ(?Ñ$@Ñ@ó+B�˜Ÿ™ A™Ó'ð Ð*Ò*Ù˜eŸj™j¨™mÔ,Ü*6Ü ×)Ñ)Ø—J‘J˜q‘Mó+#�˜Ÿ™ A™Ó'ð Ð,Ò,Ù˜eŸj™j¨™mÔ,Ü*6Ü ×+Ñ+Ø—J‘J˜q‘Mó+#�˜Ÿ™ A™Ó'ð Ð0Ò0Ù˜eŸj™j¨™mÔ,Ü*6Ü ×/Ñ/Ø—J‘J˜q‘Mó+#�˜Ÿ™ A™Ó'ð ÐFÑFÙ˜eŸj™j¨™mÔ,ÜÜ˜t¤SÓ)Ø5¸Ñ<ô>ð —:‘:˜a‘=Ð$4Ñ4Ø.>¸u¿z¹zÈ!¹}Ñ.M�H˜UŸZ™Z¨™]Ó+à—L‘L §¡¨A¡°Ö5ØÐ0Ò0Ø×!Ñ!¤$§-¡-°Ó"9Ö:ØÐ/Ô/Ø˜d‘^�Ø%Ÿ>™>Ó+�Ø!#�˜“ð]N	$ðd �E‰?×ÑÐ*¬c°(«m¸aÒ.?Ø�L‰L˜Ô"ä$¨5¸IÔFÐFr   )Nr   N)rÊ   rË   rÌ   rÍ   r   rÞ   rá   rÝ   rÏ   r   r   rÙ   rÙ   Ô  s$   „ ñ
ð AEó	5ò#ò!ó
xGr   rÙ   c                   ó   — e Zd Zy)rH   N)rÊ   rË   rÌ   rÏ   r   r   rH   rH   y  s   „ Ør   rH   c                   ó    ‡ — e Zd Zdˆ fd„	Zˆ xZS )rI   c                 óF   •— t         t        | �  ||||||¬«       || _        y )N)r4   r6   )ÚsuperrI   r   r7   )	r   r1   r5   r2   r&   r4   r6   r7   Ú	__class__s	           €r   r   zFDE.__init__~  s)   ø€ ÜŒc�4Ñ! &¨'°<ÀÐ\nÐtwÐ!ÔxØ(ˆÕr   ©NNN)rÊ   rË   rÌ   r   Ú__classcell__)r  s   @r   rI   rI   }  s   ø„ ÷)ñ )r   rI   c                   ó   — e Zd ZdZd„ Zy)r9   zÚ End marker for the sequence of CIE/FDE.

    This is specific to `.eh_frame` sections: this kind of entry does not exist
    in pure DWARF. `readelf` displays these as "ZERO terminator", hence the
    class name.
    c                 ó   — || _         y r   )r&   )r   r&   s     r   r   zZERO.__init__Š  s	   € Øˆ�r   N)rÊ   rË   rÌ   rÍ   r   rÏ   r   r   r9   r9   ƒ  s   „ ñór   r9   c                   ó>   — e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zdd„Zd„ Zy
)ró   zÈ Register rules are used to find registers in call frames. Each rule
        consists of a type (enumeration following DWARFv3 section 6.4.1)
        and an optional argument to augment the type.
    rô   rõ   rö   r÷   rø   rù   rú   ÚARCHITECTURALNc                 ó    — || _         || _        y r   ©ÚtypeÚarg)r   r  r  s      r   r   zRegisterRule.__init__œ  s   € ØˆŒ	Øˆ�r   c                 ó<   — d| j                   ›d| j                  ›d�S )NzRegisterRule(z, ú)r  r    s    r   rÖ   zRegisterRule.__repr__   s   � Ø)-¯«°D·H³HÐ=Ð=r   r   )rÊ   rË   rÌ   rÍ   rô   rõ   rö   r÷   rø   rù   rú   r  r   rÖ   rÏ   r   r   ró   ró   Ž  s;   „ ñð €IØ€JØ€FØ€JØ€HØ€JØ%€NØ#€Móó>r   ró   c                   ó   — e Zd ZdZdd„Zd„ Zy)rñ   z† A CFA rule is used to compute the CFA for each location. It either
        consists of a register+offset, or a DWARF expression.
    Nc                 ó.   — || _         || _        || _        y r   ©rã   r&   rì   )r   rã   r&   rì   s       r   r   zCFARule.__init__¨  s   € ØˆŒØˆŒØˆ�	r   c                 óV   — d| j                   ›d| j                  ›d| j                  ›d�S )NzCFARule(reg=z	, offset=z, expr=r  r  r    s    r   rÖ   zCFARule.__repr__­  s   � à�H‹H�d—k“k 4§9£9ð.ð 	.r   r  r×   rÏ   r   r   rñ   rñ   ¤  s   „ ñóó
.r   rñ   rý   ztable reg_orderéÀ   é?   ÚDW_CFA)#rò   Úcollectionsr   Úcommon.utilsr   r   r   r   Ú	constructr	   r
   Úenumsr   r5   r   Ú	constantsÚobjectr   rÒ   r{   rÙ   rH   rI   r9   ró   rñ   rý   rY   rZ   rÑ   ÚlistÚglobalsÚkeysrà   r•   rÏ   r   r   ú<module>r$     s÷   ðó Ý "÷@ó @ç &Ý 'Ý !Ü ôe
�Fô e
òP)ôC˜6ô Cô]Gˆvô ]GôJ	ˆ(ô 	ô)ˆ(ô )ôˆ6ô ô>�6ô >ô,.ˆfô .ñB #ØÐ.ó0Ð ð €ØÐ ð
 Ð Ù‘“—‘Ó!Ó"ò 1€DØ‡��xÕ Ø,0Ð™› 4™Ò)ñ1r   