|
From: <sv...@va...> - 2005-08-28 19:34:45
|
Author: njn
Date: 2005-08-28 20:34:39 +0100 (Sun, 28 Aug 2005)
New Revision: 4555
Log:
Now that --tool=3D is working via the wrapper again, revert to the previo=
us
method of finding the toolname. This is required for the loading of
vgpreload_<tool>.so. Memcheck's malloc replacements now work again,
and so the regtests are almost working fully again.
Modified:
branches/ASPACEM/coregrind/m_main.c
Modified: branches/ASPACEM/coregrind/m_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_main.c 2005-08-28 19:08:09 UTC (rev 4554=
)
+++ branches/ASPACEM/coregrind/m_main.c 2005-08-28 19:34:39 UTC (rev 4555=
)
@@ -1032,9 +1032,9 @@
} else if (VG_CLO_STREQ(vg_argv[i], "--help-debug")) {
*need_help =3D 2;
=20
+ // The tool has already been determined, but we need to know it he=
re.
} else if (VG_CLO_STREQN(7, vg_argv[i], "--tool=3D")) {
- /* *tool =3D &vg_argv[i][7]; */
- /* ignore this, since by now it is way too late to change */
+ *tool =3D &vg_argv[i][7];
=20
} else if (VG_CLO_STREQN(7, vg_argv[i], "--exec=3D")) {
*exec =3D &vg_argv[i][7];
@@ -2050,7 +2050,7 @@
Int main(Int argc, HChar **argv, HChar **envp)
{
HChar** cl_argv;
- HChar* tool =3D NULL; // will acquire tool name later
+ HChar* tool =3D "memcheck"; // default to Memcheck
HChar* exec =3D NULL;
HChar* preload =3D NULL; /* tool-specific LD_PRELOAD .so */
HChar** env;
@@ -2170,33 +2170,11 @@
//=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=20
//--------------------------------------------------------------
- // Figure out the tool name by looking at the executable name
- // eg /path/to/valgrind_memcheck --> memcheck
- // p: none, except the ability to bomb out if nothing
- // sensible can be determined
- //--------------------------------------------------------------
- VG_(debugLog)(1, "main", "Deducing tool name from argv[0]\n");
- {=20
- HChar *p0, *p1;
- tool =3D "CANNOT_DETERMINE_TOOL_NAME";
- /* scan to the end the the exe name */
- p0 =3D argv[0];
- for (p1 =3D p0; *p1; p1++)
- ;
- /* scan bwds to find '_' */
- for (; p1 > p0 && *p1 !=3D '_'; p1--)
- ;
- if (p1 > p0 && *p1 =3D=3D '_')
- tool =3D p1 + 1;
- }
- VG_(debugLog)(1, "main", "Deduced tool name =3D '%s'\n", tool);
-
- //--------------------------------------------------------------
// With client padded out, map in tool
// p: set-libdir [for VG_(libdir)]
// p: pre_process_cmd_line_options() [for 'tool']
//--------------------------------------------------------------
- VG_(debugLog)(1, "main", "Loading tool\n");
+ VG_(debugLog)(1, "main", "Loading tool '%s'\n", tool);
load_tool(tool, &toolinfo, &preload);
=20
//=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
|