This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Selective Mudflap


"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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]