This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: ia64 eh, part 2


On Sat, May 12, 2001 at 11:30:55AM -0700, Mark Mitchell wrote:
> Would you add some comments to all of these functions?  

Done.


r~



Index: unwind-pe.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/unwind-pe.h,v
retrieving revision 1.1
diff -u -p -r1.1 unwind-pe.h
--- unwind-pe.h	2001/05/12 06:03:20	1.1
+++ unwind-pe.h	2001/05/12 18:42:16
@@ -42,7 +42,12 @@
 #define DW_EH_PE_funcrel        0x40
 
 #define DW_EH_PE_indirect	0x80
+
 
+/* Given an encoding, return the number of bytes the format occupies.
+   This is only defined for fixed-size encodings, and so does not 
+   include leb128.  */
+
 static unsigned int
 size_of_encoded_value (unsigned char encoding)
 {
@@ -63,6 +68,11 @@ size_of_encoded_value (unsigned char enc
   abort ();
 }
 
+/* Given an encoding and an _Unwind_Context, return the base to which
+   the encoding is relative.  This base may then be passed to 
+   read_encoded_value_with_base for use when the _Unwind_Context is
+   not available.  */
+
 static _Unwind_Ptr
 base_of_encoded_value (unsigned char encoding, _Unwind_Context *context)
 {
@@ -85,6 +95,10 @@ base_of_encoded_value (unsigned char enc
   abort ();
 }
 
+/* Load an encoded value from memory at P.  The value is returned in VAL;
+   The function returns P incremented past the value.  BASE is as given
+   by base_of_encoded_value for this encoding in the appropriate context.  */
+
 static const unsigned char *
 read_encoded_value_with_base (unsigned char encoding, _Unwind_Ptr base,
 			      const unsigned char *p, _Unwind_Ptr *val)
@@ -186,6 +200,9 @@ read_encoded_value_with_base (unsigned c
   return p;
 }
 
+/* Like read_encoded_value_with_base, but get the base from the context
+   rather than providing it directly.  */
+
 static inline const unsigned char *
 read_encoded_value (_Unwind_Context *context, unsigned char encoding,
 		    const unsigned char *p, _Unwind_Ptr *val)
@@ -195,11 +212,16 @@ read_encoded_value (_Unwind_Context *con
 		p, val);
 }
 
+/* Read an unsigned leb128 value from P, store the value in VAL, return
+   P incremented past the value.  */
+
 static inline const unsigned char *
 read_uleb128 (const unsigned char *p, _Unwind_Ptr *val)
 {
   return read_encoded_value_with_base (DW_EH_PE_uleb128, 0, p, val);
 }
+
+/* Similar, but read a signed leb128 value.  */
 
 static inline const unsigned char *
 read_sleb128 (const unsigned char *p, _Unwind_Ptr *val)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]