This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Selective Mudflap
- From: fche at redhat dot com (Frank Ch. Eigler)
- To: "Jon Levell" <jon at coralbark dot net>
- Cc: gcc at gcc dot gnu dot org
- Date: 01 Sep 2005 10:53:48 -0400
- Subject: Re: Selective Mudflap
- References: <E1EApXb-0008Q7-B7@may.uk-noc.com>
"Jon Levell" <jon@coralbark.net> writes:
> I'm trying to debug a large C application that (amongst other things)
> starts a JVM and uses Java's JDBC to connect to databases via JNI.
Brave!
> If I use the sourceforge bounds checking patch I get a sensible list
> of errors (none from the JVM). I'd also like to use Mudflap however
> running the program with mudflap generates huge numbers of errors
> caused by the (uninstrumented) libjvm.so. [...]
Do these errors arise from malloc-type operations performed by the
JVM? Or from your code's use of JVM-provided pointers? Sadly, there
is no valgrind-style exclusion facility around. However, if the JVM
interface is used predominantly in one direction (C code calling into
the JVM), it may be possible to programatically turn off mudflap
enforcement when your code is about to jump into the jvm. Maybe
something similar can be done for JVM-invoked C code too.
#ifdef _MUDFLAP
__mf_set_options("-mode-nop");
#endif
... invoke JVM
#ifdef _MUDFLAP
__mf_set_options("-mode-check"); /* IIRC */
#endif
- FChE