Print this page
5688 ELF tools need to be more careful with dwarf data

@@ -245,18 +245,26 @@
 typedef enum _LANG {
         LANG_UNK = 0,
         LANG_ANSI_C_V1 = 1
 } LANG;
 
+typedef enum {
+        DW_SUCCESS = 0,
+        DW_BAD_ENCODING,
+        DW_OVERFLOW,
+} dwarf_error_t;
+
 /*
  * Little Endian Base 128 (leb128) encoding/decoding routines
  */
-extern  uint64_t        uleb_extract(unsigned char *, uint64_t *);
-extern  int64_t         sleb_extract(unsigned char *, uint64_t *);
-extern  uint64_t        dwarf_ehe_extract(unsigned char *, uint64_t *,
-                            uint_t, unsigned char *, boolean_t, uint64_t,
-                            uint64_t, uint64_t);
+extern  dwarf_error_t   uleb_extract(unsigned char *, uint64_t *, size_t,
+                            uint64_t *);
+extern  dwarf_error_t   sleb_extract(unsigned char *, uint64_t *, size_t,
+                            int64_t *);
+extern  dwarf_error_t   dwarf_ehe_extract(unsigned char *, size_t, uint64_t *,
+                            uint64_t *, uint_t, unsigned char *, boolean_t,
+                            uint64_t, uint64_t, uint64_t);
 
 #ifdef  __cplusplus
 }
 #endif