@@ -1077,7 +1077,7 @@ pub struct Augmentation {
10771077 /// > represents the pointer encoding used for the second argument, which is
10781078 /// > the address of a personality routine handler. The size of the
10791079 /// > personality routine pointer is specified by the pointer encoding used.
1080- personality : Option < Pointer > ,
1080+ personality : Option < ( constants :: DwEhPe , Pointer ) > ,
10811081
10821082 /// > A 'R' may be present at any position after the first character of the
10831083 /// > string. This character may only be present if 'z' is the first character
@@ -1134,7 +1134,7 @@ impl Augmentation {
11341134 } ;
11351135
11361136 let personality = parse_encoded_pointer ( encoding, & parameters, rest) ?;
1137- augmentation. personality = Some ( personality) ;
1137+ augmentation. personality = Some ( ( encoding , personality) ) ;
11381138 }
11391139 b'R' => {
11401140 let encoding = parse_pointer_encoding ( rest) ?;
@@ -1391,10 +1391,29 @@ impl<R: Reader> CommonInformationEntry<R> {
13911391 self . augmentation . map_or ( false , |a| a. lsda . is_some ( ) )
13921392 }
13931393
1394+ /// Return the encoding of the LSDA address for this CIE's FDEs.
1395+ pub fn lsda_encoding ( & self ) -> Option < constants:: DwEhPe > {
1396+ self . augmentation . and_then ( |a| a. lsda )
1397+ }
1398+
1399+ /// Return the encoding and address of the personality routine handler
1400+ /// for this CIE's FDEs.
1401+ pub fn personality_with_encoding ( & self ) -> Option < ( constants:: DwEhPe , Pointer ) > {
1402+ self . augmentation . as_ref ( ) . and_then ( |a| a. personality )
1403+ }
1404+
13941405 /// Return the address of the personality routine handler
13951406 /// for this CIE's FDEs.
13961407 pub fn personality ( & self ) -> Option < Pointer > {
1397- self . augmentation . as_ref ( ) . and_then ( |a| a. personality )
1408+ self . augmentation
1409+ . as_ref ( )
1410+ . and_then ( |a| a. personality )
1411+ . map ( |( _, p) | p)
1412+ }
1413+
1414+ /// Return the encoding of the addresses for this CIE's FDEs.
1415+ pub fn fde_address_encoding ( & self ) -> Option < constants:: DwEhPe > {
1416+ self . augmentation . and_then ( |a| a. fde_address_encoding )
13981417 }
13991418
14001419 /// True if this CIE's FDEs are trampolines for signal handlers.
@@ -6204,7 +6223,7 @@ mod tests {
62046223 let aug_str = & mut EndianSlice :: new ( b"zP" , LittleEndian ) ;
62056224
62066225 let mut augmentation = Augmentation :: default ( ) ;
6207- augmentation. personality = Some ( Pointer :: Direct ( 0xf00d_f00d ) ) ;
6226+ augmentation. personality = Some ( ( constants :: DW_EH_PE_udata8 , Pointer :: Direct ( 0xf00d_f00d ) ) ) ;
62086227
62096228 assert_eq ! (
62106229 Augmentation :: parse( aug_str, & bases, address_size, & section, input) ,
@@ -6290,7 +6309,7 @@ mod tests {
62906309
62916310 let augmentation = Augmentation {
62926311 lsda : Some ( constants:: DW_EH_PE_uleb128 ) ,
6293- personality : Some ( Pointer :: Direct ( 0x1bad_f00d ) ) ,
6312+ personality : Some ( ( constants :: DW_EH_PE_udata8 , Pointer :: Direct ( 0x1bad_f00d ) ) ) ,
62946313 fde_address_encoding : Some ( constants:: DW_EH_PE_uleb128 ) ,
62956314 is_signal_trampoline : true ,
62966315 } ;
0 commit comments