]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Make the Supp and Error types local to vg_errcontext.h; they don't need to be
authorNicholas Nethercote <n.nethercote@gmail.com>
Mon, 2 Aug 2004 12:21:09 +0000 (12:21 +0000)
committerNicholas Nethercote <n.nethercote@gmail.com>
Mon, 2 Aug 2004 12:21:09 +0000 (12:21 +0000)
global.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2545

coregrind/vg_errcontext.c
coregrind/vg_include.h
coregrind/vg_needs.c

index b4338a8c0642bce8e37d8eb8a07d855d9b3215ef..646cebc8a151e662a12c68a9e175ecb5ad4f9e4a 100644 (file)
@@ -52,6 +52,139 @@ static UInt vg_n_errs_suppressed = 0;
 static Supp* is_suppressible_error ( Error* err );
 
 
+/*------------------------------------------------------------*/
+/*--- Error type                                           ---*/
+/*------------------------------------------------------------*/
+
+/* Note: it is imperative this doesn't overlap with (0..) at all, as skins
+ * effectively extend it by defining their own enums in the (0..) range. */
+typedef
+   enum { 
+      PThreadErr      = -1,   // Pthreading error
+   }
+   CoreErrorKind;
+
+/* Errors.  Extensible (via the 'extra' field).  Tools can use a normal
+   enum (with element values in the normal range (0..)) for `ekind'. 
+   Functions for getting/setting the tool-relevant fields are in
+   include/vg_skin.h.
+
+   When errors are found and recorded with VG_(maybe_record_error)(), all
+   the tool must do is pass in the four parameters;  core will
+   allocate/initialise the error record.
+*/
+struct _Error {
+   struct _Error* next;
+   // NULL if unsuppressed; or ptr to suppression record.
+   Supp* supp;
+   Int count;
+   ThreadId tid;
+
+   // The tool-specific part
+   ExeContext* where;      // Initialised by core
+   Int ekind;              // Used by ALL.  Must be in the range (0..)
+   Addr addr;              // Used frequently
+   Char* string;           // Used frequently
+   void* extra;            // For any tool-specific extras
+};
+
+ExeContext* VG_(get_error_where) ( Error* err )
+{
+   return err->where;
+}
+
+ErrorKind VG_(get_error_kind) ( Error* err )
+{
+   return err->ekind;
+}
+
+Addr VG_(get_error_address) ( Error* err )
+{
+   return err->addr;
+}
+
+Char* VG_(get_error_string) ( Error* err )
+{
+   return err->string;
+}
+
+void* VG_(get_error_extra)  ( Error* err )
+{
+   return err->extra;
+}
+
+/*------------------------------------------------------------*/
+/*--- Suppression type                                     ---*/
+/*------------------------------------------------------------*/
+
+/* Note: it is imperative this doesn't overlap with (0..) at all, as tools
+ * effectively extend it by defining their own enums in the (0..) range. */
+typedef
+   enum {
+      PThreadSupp = -1,    /* Matches PThreadErr */
+   }
+   CoreSuppKind;
+
+/* For each caller specified for a suppression, record the nature of
+   the caller name.  Not of interest to tools. */
+typedef
+   enum { 
+      ObjName,    /* Name is of an shared object file. */
+      FunName     /* Name is of a function. */
+   }
+   SuppLocTy;
+
+/* Suppressions.  Tools can get/set tool-relevant parts with functions
+   declared in include/vg_skin.h.  Extensible via the 'extra' field. 
+   Tools can use a normal enum (with element values in the normal range
+   (0..)) for `skind'. */
+struct _Supp {
+   struct _Supp* next;
+   Int count;     // The number of times this error has been suppressed.
+   Char* sname;   // The name by which the suppression is referred to.
+   /* First two (name of fn where err occurs, and immediate caller)
+    * are mandatory;  extra two are optional. */
+   SuppLocTy caller_ty[VG_N_SUPP_CALLERS];
+   Char*     caller   [VG_N_SUPP_CALLERS];
+
+   /* The tool-specific part */
+   SuppKind skind;   // What kind of suppression.  Must use the range (0..).
+   Char* string;     // String -- use is optional.  NULL by default.
+   void* extra;      // Anything else -- use is optional.  NULL by default.
+};
+
+SuppKind VG_(get_supp_kind) ( Supp* su )
+{
+   return su->skind;
+}
+
+Char* VG_(get_supp_string) ( Supp* su )
+{
+   return su->string;
+}
+
+void* VG_(get_supp_extra)  ( Supp* su )
+{
+   return su->extra;
+}
+
+
+void VG_(set_supp_kind)   ( Supp* su, SuppKind skind )
+{
+   su->skind = skind;
+}
+
+void VG_(set_supp_string) ( Supp* su, Char* string )
+{
+   su->string = string;
+}
+
+void VG_(set_supp_extra)  ( Supp* su, void* extra )
+{
+   su->extra = extra;
+}
+
+
 /*------------------------------------------------------------*/
 /*--- Helper fns                                           ---*/
 /*------------------------------------------------------------*/
index 9be483e67f192c0a77a67714627b9c19b8b08722..fbb4e00be0cc1e084e77a6c55396f68e9b7d67db 100644 (file)
@@ -1215,85 +1215,6 @@ extern ExeContext* VG_(get_ExeContext2) ( Addr eip, Addr ebp,
    Exports of vg_errcontext.c.
    ------------------------------------------------------------------ */
 
-/* Note: it is imperative this doesn't overlap with (0..) at all, as skins
- * effectively extend it by defining their own enums in the (0..) range. */
-typedef
-   enum {
-      PThreadSupp = -1,    /* Matches PThreadErr */
-   }
-   CoreSuppKind;
-
-/* For each caller specified for a suppression, record the nature of
-   the caller name.  Not of interest to skins. */
-typedef
-   enum { 
-      ObjName,    /* Name is of an shared object file. */
-      FunName     /* Name is of a function. */
-   }
-   SuppLocTy;
-
-/* Suppressions.  Skins can get/set skin-relevant parts with functions
-   declared in include/vg_skin.h.  Extensible via the 'extra' field. 
-   Skins can use a normal enum (with element values in the normal range
-   (0..)) for `skind'. */
-struct _Supp {
-   struct _Supp* next;
-   /* The number of times this error has been suppressed. */
-   Int count;
-   /* The name by which the suppression is referred to. */
-   Char* sname;
-   /* First two (name of fn where err occurs, and immediate caller)
-    * are mandatory;  extra two are optional. */
-   SuppLocTy caller_ty[VG_N_SUPP_CALLERS];
-   Char*     caller   [VG_N_SUPP_CALLERS];
-
-   /* The skin-specific part */
-   /* What kind of suppression.  Must use the range (0..) */
-   SuppKind skind;
-   /* String -- use is optional.  NULL by default. */
-   Char* string;
-   /* Anything else -- use is optional.  NULL by default. */
-   void* extra;
-};
-
-/* Note: it is imperative this doesn't overlap with (0..) at all, as skins
- * effectively extend it by defining their own enums in the (0..) range. */
-typedef
-   enum { 
-      PThreadErr      = -1,   /* Pthreading error */
-   }
-   CoreErrorKind;
-
-/* Errors.  Extensible (via the 'extra' field).  Skins can use a normal
-   enum (with element values in the normal range (0..)) for `ekind'. 
-   Functions for getting/setting the skin-relevant fields are in
-   include/vg_skin.h.
-
-   When errors are found and recorded with VG_(maybe_record_error)(), all
-   the skin must do is pass in the four parameters;  core will
-   allocate/initialise the error record.
-*/
-struct _Error {
-   struct _Error* next;
-   /* NULL if unsuppressed; or ptr to suppression record. */
-   Supp* supp;
-   Int count;
-   ThreadId tid;
-
-   /* The skin-specific part */
-   /* Initialised by core */
-   ExeContext* where;
-   /* Used by ALL.  Must be in the range (0..) */
-   Int ekind;
-   /* Used frequently */
-   Addr addr;
-   /* Used frequently */
-   Char* string;
-   /* For any skin-specific extras */
-   void* extra;
-};
-
-
 extern void VG_(load_suppressions)    ( void );
 
 extern void VG_(record_pthread_error) ( ThreadId tid, Char* msg );
index f41328d657bd13697d1e37032eb4a290521b51d8..cef8a15695f448edc512a6b23a395ae52ec802e6 100644 (file)
@@ -190,68 +190,6 @@ UInstr* VG_(get_last_instr) ( UCodeBlock* cb )
    return & cb->instrs[cb->used-1];
 }
    
-/*--------------------------------------------------------------------*/
-/* Suppressions */
-
-SuppKind VG_(get_supp_kind) ( Supp* su )
-{
-   return su->skind;
-}
-
-Char* VG_(get_supp_string) ( Supp* su )
-{
-   return su->string;
-}
-
-void* VG_(get_supp_extra)  ( Supp* su )
-{
-   return su->extra;
-}
-
-
-void VG_(set_supp_kind)   ( Supp* su, SuppKind skind )
-{
-   su->skind = skind;
-}
-
-void VG_(set_supp_string) ( Supp* su, Char* string )
-{
-   su->string = string;
-}
-
-void VG_(set_supp_extra)  ( Supp* su, void* extra )
-{
-   su->extra = extra;
-}
-
-/*--------------------------------------------------------------------*/
-/* Errors */
-
-ExeContext* VG_(get_error_where) ( Error* err )
-{
-   return err->where;
-}
-
-ErrorKind VG_(get_error_kind) ( Error* err )
-{
-   return err->ekind;
-}
-
-Addr VG_(get_error_address) ( Error* err )
-{
-   return err->addr;
-}
-
-Char* VG_(get_error_string) ( Error* err )
-{
-   return err->string;
-}
-
-void* VG_(get_error_extra)  ( Error* err )
-{
-   return err->extra;
-}
-
 /*--------------------------------------------------------------------*/
 /*--- end                                               vg_needs.c ---*/
 /*--------------------------------------------------------------------*/