This jumbo-checkin is the Full Virtualization checkin.  This eliminates
Valgrind's dependency on the dynamic linker for getting started, and
instead takes things into its own hands.

This checkin doesn't add much in the way of new functionality, but it
is the basis for all future work on Valgrind.  It allows us much more
flexibility in implementation, and well as increasing the reliability
of Valgrind by protecting it more from its clients.

This patch requires some changes to tools to update them to the changes
in the tool API, but they are straightforward.  See the posting "Heads
up: Full Virtualization" on valgrind-developers for a more complete
description of this change and its effects on you.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2118 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/vg_default.c b/coregrind/vg_default.c
index b15aef7..30807d6 100644
--- a/coregrind/vg_default.c
+++ b/coregrind/vg_default.c
@@ -44,8 +44,8 @@
 /* If the tool fails to define one or more of the required functions,
  * make it very clear what went wrong! */
 
-static __attribute__ ((noreturn))
-void fund_panic ( const Char* fn )
+__attribute__ ((noreturn))
+void VG_(missing_tool_func) ( const Char* fn )
 {
    VG_(printf)(
       "\nTool error:\n"
@@ -56,17 +56,6 @@
 }
 
 static __attribute__ ((noreturn))
-void non_fund_panic ( const Char* fn )
-{
-   VG_(printf)(
-      "\nTool error:\n"
-      "  The tool you have selected is missing the function `%s'\n"
-      "  required by one of its needs.\n\n",
-      fn);
-   VG_(skin_panic)("Missing tool function");
-}
-
-static __attribute__ ((noreturn))
 void malloc_panic ( const Char* fn )
 {
    VG_(printf)(
@@ -77,20 +66,6 @@
    VG_(skin_panic)("Missing tool function");
 }
 
-#define FUND(proto)                       \
-__attribute__((weak))                     \
-proto                                     \
-{                                         \
-   fund_panic(__PRETTY_FUNCTION__);       \
-}
-
-#define NON_FUND(proto)                   \
-__attribute__((weak))                     \
-proto                                     \
-{                                         \
-   non_fund_panic(__PRETTY_FUNCTION__);   \
-}
-
 #define MALLOC(proto)                     \
 __attribute__((weak))                     \
 proto                                     \
@@ -102,57 +77,6 @@
    Default functions
    ------------------------------------------------------------------ */
 
-/* Fundamental template functions */
-FUND( void        SK_(pre_clo_init) (void) );
-FUND( void        SK_(post_clo_init)(void) );
-FUND( UCodeBlock* SK_(instrument)   (UCodeBlock* cb, Addr not_used) );
-FUND( void        SK_(fini)         (Int exitcode) );
-
-/* For error reporting and suppression handling */
-NON_FUND( Bool  SK_(eq_SkinError)(VgRes res, Error* e1, Error* e2) );
-NON_FUND( void  SK_(pp_SkinError)(Error* err) );
-NON_FUND( UInt  SK_(update_extra)(Error* err) );
-NON_FUND( Bool  SK_(recognised_suppression)(Char* name, Supp* su) );
-NON_FUND( Bool  SK_(read_extra_suppression_info)(Int fd, Char* buf, Int nBuf,
-                                                 Supp* su) );
-NON_FUND( Bool  SK_(error_matches_suppression)(Error* err, Supp* su) );
-NON_FUND( Char* SK_(get_error_name)(Error* err) );
-NON_FUND( void  SK_(print_extra_suppression_info)(Error* err) );
-
-/* For throwing out basic block level info when code is invalidated */
-NON_FUND( void SK_(discard_basic_block_info)(Addr a, UInt size) );
-
-/* For throwing out basic block level info when code is invalidated */
-NON_FUND( void SK_(written_shadow_regs_values)(UInt* gen_reg, UInt* eflags) );
-
-/* Command line arg handling functions */
-NON_FUND( Bool SK_(process_cmd_line_option)(Char* argv) );
-NON_FUND( void SK_(print_usage)(void) );
-NON_FUND( void SK_(print_debug_usage)(void) );
-
-/* Client request template function */
-NON_FUND( Bool SK_(handle_client_request)(ThreadId tid, UInt* arg_block,
-                                          UInt *ret) );
-
-/* UCode extension */
-NON_FUND( void  SK_(emit_XUInstr)  (UInstr* u, RRegSet regs_live_before) );
-NON_FUND( Bool  SK_(sane_XUInstr)  (Bool beforeRA, Bool beforeLiveness, 
-                                    UInstr* u) );
-NON_FUND( Char* SK_(name_XUOpcode) (Opcode opc) );
-NON_FUND( void  SK_(pp_XUInstr)    (UInstr* u) );
-NON_FUND( Int   SK_(get_Xreg_usage)(UInstr* u, Tag tag, Int* regs,
-                                    Bool* isWrites) );               
-
-/* Syscall wrapping */
-NON_FUND( void* SK_(pre_syscall) (ThreadId tid, UInt syscallno,
-                                  Bool is_blocking) );
-NON_FUND( void  SK_(post_syscall)(ThreadId tid, UInt syscallno,
-                                 void* pre_result, Int res, Bool is_blocking) );
-
-/* Sanity checks */
-NON_FUND( Bool SK_(cheap_sanity_check)(void) );
-NON_FUND( Bool SK_(expensive_sanity_check)(void) );
-
 /*------------------------------------------------------------*/
 /*--- Replacing malloc et al                               ---*/
 /*------------------------------------------------------------*/
@@ -188,15 +112,6 @@
       malloc_panic(__PRETTY_FUNCTION__);
 }
 
-MALLOC( void* SK_(__builtin_new)    ( Int size ) );
-MALLOC( void* SK_(__builtin_vec_new)( Int size ) );
-MALLOC( void* SK_(memalign)         ( Int align, Int size ) );
-MALLOC( void* SK_(calloc)           ( Int nmemb, Int size ) );
-
-MALLOC( void  SK_(__builtin_delete)     ( void* p ) );
-MALLOC( void  SK_(__builtin_vec_delete) ( void* p ) );
-MALLOC( void* SK_(realloc)              ( void* p, Int new_size ) );
-
 /*--------------------------------------------------------------------*/
 /*--- end                                            vg_defaults.c ---*/
 /*--------------------------------------------------------------------*/