|
From: <sv...@va...> - 2008-06-01 16:33:43
|
Author: bart
Date: 2008-06-01 17:33:37 +0100 (Sun, 01 Jun 2008)
New Revision: 8170
Log:
Changed _Spec::mandatory from HChar* into const HChar*. If no symbol information is found in ld.so during startup of the exp-drd tool, let Valgrind abort and print an informative error message.
Modified:
trunk/coregrind/m_redir.c
Modified: trunk/coregrind/m_redir.c
===================================================================
--- trunk/coregrind/m_redir.c 2008-06-01 14:32:23 UTC (rev 8169)
+++ trunk/coregrind/m_redir.c 2008-06-01 16:33:37 UTC (rev 8170)
@@ -222,7 +222,7 @@
HChar* from_fnpatt; /* from fnname pattern */
Addr to_addr; /* where redirecting to */
Bool isWrap; /* wrap or replacement? */
- HChar* mandatory; /* non-NULL ==> abort V and print the
+ const HChar* mandatory; /* non-NULL ==> abort V and print the
string if from_sopatt is loaded but
from_fnpatt cannot be found */
/* VARIABLE PARTS -- used transiently whilst processing redirections */
@@ -807,7 +807,7 @@
__attribute__((unused)) /* not used on all platforms */
static void add_hardwired_spec ( HChar* sopatt, HChar* fnpatt,
Addr to_addr,
- HChar* mandatory )
+ const HChar* const mandatory )
{
Spec* spec = dinfo_zalloc(sizeof(Spec));
vg_assert(spec);
@@ -878,13 +878,14 @@
);
# elif defined(VGP_ppc32_linux)
+ {
+ static const HChar croakage[]
+ = "Possible fix: install glibc's debuginfo package on this machine.";
+
/* If we're using memcheck, use these intercepts right from
the start, otherwise ld.so makes a lot of noise. */
if (0==VG_(strcmp)("Memcheck", VG_(details).name)) {
- static HChar* croakage = "Possible fix: install glibc's debuginfo "
- "package on this machine.";
-
/* this is mandatory - can't sanely continue without it */
add_hardwired_spec(
"ld.so.1", "strlen",
@@ -903,16 +904,27 @@
NULL /* not mandatory - so why bother at all? */
/* glibc-2.6.1 (openSUSE 10.3, ppc32) seems fine without it */
);
+ } else if (0 == VG_(strcmp)("exp-drd", VG_(details).name)) {
+ /* Only continue if symbol information in ld.so.1 is present, */
+ /* because otherwise exp-drd's suppression patterns on ld.so do */
+ /* not have any effect. */
+ add_hardwired_spec(
+ "ld.so.1", "strlen",
+ (Addr)(&VG_(ppc32_linux_REDIR_FOR_strlen)),
+ croakage
+ );
}
+ }
# elif defined(VGP_ppc64_linux)
+ {
+ static const HChar croakage[]
+ = "Possible fix: install glibc's debuginfo package on this machine.";
+
/* If we're using memcheck, use these intercepts right from
the start, otherwise ld.so makes a lot of noise. */
if (0==VG_(strcmp)("Memcheck", VG_(details).name)) {
- static HChar* croakage = "Possible fix: install glibc's debuginfo "
- "package on this machine.";
-
/* this is mandatory - can't sanely continue without it */
add_hardwired_spec(
"ld64.so.1", "strlen",
@@ -927,7 +939,17 @@
/* glibc-2.5 (FC6, ppc64) seems fine without it */
);
+ } else if (0 == VG_(strcmp)("exp-drd", VG_(details).name)) {
+ /* Only continue if symbol information in ld64.so.1 is present, */
+ /* because otherwise exp-drd's suppression patterns on ld.so do */
+ /* not have any effect. */
+ add_hardwired_spec(
+ "ld64.so.1", "strlen",
+ (Addr)VG_(fnptr_to_fnentry)( &VG_(ppc64_linux_REDIR_FOR_strlen) ),
+ croakage
+ );
}
+ }
# elif defined(VGP_ppc32_aix5)
/* nothing so far */
|