>I'm not sure where this conclusion is coming from. The case in question 
>was about "debug" but as stated earlier and/or in the JBS issue this is 
>potentially an issue for any symbol exported from one of the JDK 
>libraries that clashes with a symbol from the application native code.


Hi David, I think we were running with exported debug-helper functions on 
Windows for some years without complains .
And on Linux , there was only this single issue about "debug" .  So in practice 
it was not THAT bad.

However you are correct, that it *could*  clash in some scenarios .  (but all 
our other exported functions without nice prefix  could clash too)

So we have at least two option :
- prefix the names from debug.cpp  (jvm_debug_   or something like this, maybe 
there are better suggestions)
- use an exported "helper" that references all those little functions , so that 
elimination is avoided , e.g. 

// just an exported helper; to avoid link time elimination of the referenced 
functions
extern "C" JNIEXPORT void JVM_debug_helpers_keeper(void* p1, void* p2, void* 
p3, intptr_t ip, oop oh, address adr) {
  blob((CodeBlob*)p1);
  dump_vtable(adr);
  nm(ip);
  disnm(ip);
  printnm(ip);
  universe();
  verify();
     ...........
}


This one is not there to be ever called, just for keeping the nm/pp/debug etc. 
functions.
What do you think ?
Would that  JVM_debug_helpers_keeper(...) approach  also work on Windows ?


Best regards, Matthias


Reply via email to