From: Nicholas Nethercote Date: Fri, 27 Feb 2009 03:38:28 +0000 (+0000) Subject: Remove dead code relating to interface versions. X-Git-Tag: svn/VALGRIND_3_5_0~909 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=74b79037110b96782f8fc52252d9ce1f52bdd035;p=thirdparty%2Fvalgrind.git Remove dead code relating to interface versions. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9289 --- diff --git a/callgrind/dump.c b/callgrind/dump.c index 27257019f4..3ae31f3afc 100644 --- a/callgrind/dump.c +++ b/callgrind/dump.c @@ -1640,7 +1640,6 @@ void init_cmdbuf(void) Int i,j,size = 0; HChar* argv; -#if VG_CORE_INTERFACE_VERSION > 8 if (VG_(args_the_exename)) size = VG_(sprintf)(cmdbuf, " %s", VG_(args_the_exename)); @@ -1651,15 +1650,6 @@ void init_cmdbuf(void) for(j=0;argv[j]!=0;j++) if (size < BUF_LEN) cmdbuf[size++] = argv[j]; } -#else - for(i = 0; i < VG_(client_argc); i++) { - argv = VG_(client_argv)[i]; - if (!argv) continue; - if ((size>0) && (size < BUF_LEN)) cmdbuf[size++] = ' '; - for(j=0;argv[j]!=0;j++) - if (size < BUF_LEN) cmdbuf[size++] = argv[j]; - } -#endif if (size == BUF_LEN) size--; cmdbuf[size] = 0; diff --git a/coregrind/m_main.c b/coregrind/m_main.c index f8258d4157..4cf70b614f 100644 --- a/coregrind/m_main.c +++ b/coregrind/m_main.c @@ -1585,7 +1585,7 @@ Int valgrind_main ( Int argc, HChar **argv, HChar **envp ) // p: setup_file_descriptors() [for 'VG_(fd_xxx_limit)'] //-------------------------------------------------------------- VG_(debugLog)(1, "main", "Initialise the tool part 1 (pre_clo_init)\n"); - (VG_(tool_info).tl_pre_clo_init)(); + VG_(tl_pre_clo_init)(); //-------------------------------------------------------------- // If --tool and --help/--help-debug was given, now give the core+tool diff --git a/include/pub_tool_libcproc.h b/include/pub_tool_libcproc.h index f0f7cfca75..8b44a59125 100644 --- a/include/pub_tool_libcproc.h +++ b/include/pub_tool_libcproc.h @@ -35,9 +35,7 @@ Command-line and environment stuff ------------------------------------------------------------------ */ -/* Client args and environment. Note that VG_(client_argv)[] can be written - to by the client, so you should check each entry is non-NULL before - printing. VG_(client_envp) can be inspected with VG_(getenv)(). */ +/* Client environment. */ extern Char** VG_(client_envp); /* Looks up VG_(client_envp) */ diff --git a/include/pub_tool_tooliface.h b/include/pub_tool_tooliface.h index 10c9a855fa..7ab042e0a1 100644 --- a/include/pub_tool_tooliface.h +++ b/include/pub_tool_tooliface.h @@ -37,38 +37,22 @@ /* ------------------------------------------------------------------ */ /* The interface version */ -/* The version number indicates binary-incompatible changes to the - interface; if the core and tool versions don't match, Valgrind - will abort. */ -#define VG_CORE_INTERFACE_VERSION 11 - -typedef struct _ToolInfo { - Int sizeof_ToolInfo; - Int interface_version; - - /* Initialise tool. Must do the following: - - initialise the `details' struct, via the VG_(details_*)() functions - - register any helpers called by generated code - - May do the following: - - initialise the `needs' struct to indicate certain requirements, via - the VG_(needs_*)() functions - - initialize all the tool's entrypoints via the VG_(init_*)() functions - - register any tool-specific profiling events - - any other tool-specific initialisation - */ - void (*tl_pre_clo_init) ( void ); -} ToolInfo; - -extern const ToolInfo VG_(tool_info); - -/* Every tool must include this macro somewhere, exactly once. */ -#define VG_DETERMINE_INTERFACE_VERSION(pre_clo_init) \ - const ToolInfo VG_(tool_info) = { \ - .sizeof_ToolInfo = sizeof(ToolInfo), \ - .interface_version = VG_CORE_INTERFACE_VERSION, \ - .tl_pre_clo_init = pre_clo_init, \ - }; +/* Initialise tool. Must do the following: + - initialise the `details' struct, via the VG_(details_*)() functions + - register the basic tool functions, via VG_(basic_tool_funcs)(). + May do the following: + - initialise the `needs' struct to indicate certain requirements, via + the VG_(needs_*)() functions + - any other tool-specific initialisation +*/ +extern void (*VG_(tl_pre_clo_init)) ( void ); + +/* Every tool must include this macro somewhere, exactly once. The + interface version is no longer relevant, but we kept the same name + to avoid requiring changes to tools. +*/ +#define VG_DETERMINE_INTERFACE_VERSION(pre_clo_init) \ + void (*VG_(tl_pre_clo_init)) ( void ) = pre_clo_init; /* ------------------------------------------------------------------ */ /* Basic tool functions */