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));
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;
// 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
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) */
/* ------------------------------------------------------------------ */
/* 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 */