aboutsummaryrefslogtreecommitdiffstats
path: root/java/jni
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2020-10-14 21:46:14 +0200
committerSven Gothel <[email protected]>2020-10-14 21:46:14 +0200
commit659097801be56a7c7c06bf97e14416e1e6cb9725 (patch)
tree852e20d58da65321f3e639bddd5022269197e52a /java/jni
parent68ba75dc27817ac50cd1c9ae078bf36e09dedd76 (diff)
Add DBTEnv::DEBUG_JNI 'direct_bt.debug.jni' for JNI only related DBG_JNI_PRINT(); IRQ_PRINT(..) shall not print_backtrace().
Diffstat (limited to 'java/jni')
-rw-r--r--java/jni/JNIMem.cxx20
-rw-r--r--java/jni/direct_bt/DBTNativeDownlink.cxx5
2 files changed, 12 insertions, 13 deletions
diff --git a/java/jni/JNIMem.cxx b/java/jni/JNIMem.cxx
index 2edbf987..e5b3aaf5 100644
--- a/java/jni/JNIMem.cxx
+++ b/java/jni/JNIMem.cxx
@@ -94,7 +94,7 @@ void JNIEnvContainer::detach() {
JNIGlobalRef::JNIGlobalRef() noexcept {
this->object = nullptr;
- DBG_PRINT("JNIGlobalRef::def_ctor nullptr");
+ DBG_JNI_PRINT("JNIGlobalRef::def_ctor nullptr");
}
JNIGlobalRef::JNIGlobalRef(jobject object) {
@@ -102,7 +102,7 @@ JNIGlobalRef::JNIGlobalRef(jobject object) {
throw direct_bt::RuntimeException("JNIGlobalRef ctor null jobject", E_FILE_LINE);
}
this->object = jni_env->NewGlobalRef(object);
- DBG_PRINT("JNIGlobalRef::def_ctor %p -> %p", object, this->object);
+ DBG_JNI_PRINT("JNIGlobalRef::def_ctor %p -> %p", object, this->object);
}
JNIGlobalRef::JNIGlobalRef(const JNIGlobalRef &o) {
@@ -110,11 +110,11 @@ JNIGlobalRef::JNIGlobalRef(const JNIGlobalRef &o) {
throw direct_bt::RuntimeException("Other JNIGlobalRef jobject is null", E_FILE_LINE);
}
object = jni_env->NewGlobalRef(o.object);
- DBG_PRINT("JNIGlobalRef::copy_ctor %p -> %p", o.object, object);
+ DBG_JNI_PRINT("JNIGlobalRef::copy_ctor %p -> %p", o.object, object);
}
JNIGlobalRef::JNIGlobalRef(JNIGlobalRef &&o) noexcept
: object(o.object) {
- DBG_PRINT("JNIGlobalRef::move_ctor %p (nulled) -> %p", o.object, object);
+ DBG_JNI_PRINT("JNIGlobalRef::move_ctor %p (nulled) -> %p", o.object, object);
o.object = nullptr;
}
JNIGlobalRef& JNIGlobalRef::operator=(const JNIGlobalRef &o) {
@@ -129,12 +129,12 @@ JNIGlobalRef& JNIGlobalRef::operator=(const JNIGlobalRef &o) {
throw direct_bt::RuntimeException("Other JNIGlobalRef jobject is null", E_FILE_LINE);
}
object = jni_env->NewGlobalRef(o.object);
- DBG_PRINT("JNIGlobalRef::copy_assign %p -> %p", o.object, object);
+ DBG_JNI_PRINT("JNIGlobalRef::copy_assign %p -> %p", o.object, object);
return *this;
}
JNIGlobalRef& JNIGlobalRef::operator=(JNIGlobalRef &&o) noexcept {
object = o.object;
- DBG_PRINT("JNIGlobalRef::move_assign %p (nulled) -> %p", o.object, object);
+ DBG_JNI_PRINT("JNIGlobalRef::move_assign %p (nulled) -> %p", o.object, object);
o.object = nullptr;
return *this;
}
@@ -145,7 +145,7 @@ JNIGlobalRef::~JNIGlobalRef() noexcept {
if( nullptr == env ) {
ABORT("JNIGlobalRef dtor null JNIEnv");
}
- DBG_PRINT("JNIGlobalRef::dtor %p", object);
+ DBG_JNI_PRINT("JNIGlobalRef::dtor %p", object);
if( nullptr != object ) {
// due to move ctor and assignment, we accept nullptr object
env->DeleteGlobalRef(object);
@@ -156,16 +156,16 @@ JNIGlobalRef::~JNIGlobalRef() noexcept {
}
void JNIGlobalRef::clear() noexcept {
- DBG_PRINT("JNIGlobalRef::clear %p (nulled) -> null", object);
+ DBG_JNI_PRINT("JNIGlobalRef::clear %p (nulled) -> null", object);
object = nullptr;
}
bool JNIGlobalRef::operator==(const JNIGlobalRef& rhs) const noexcept {
if( &rhs == this ) {
- DBG_PRINT("JNIGlobalRef::== true: %p == %p (ptr)", object, rhs.object);
+ DBG_JNI_PRINT("JNIGlobalRef::== true: %p == %p (ptr)", object, rhs.object);
return true;
}
bool res = JNI_TRUE == jni_env->IsSameObject(object, rhs.object);
- DBG_PRINT("JNIGlobalRef::== %d: %p == %p (IsSameObject)", res, object, rhs.object);
+ DBG_JNI_PRINT("JNIGlobalRef::== %d: %p == %p (IsSameObject)", res, object, rhs.object);
return res;
}
diff --git a/java/jni/direct_bt/DBTNativeDownlink.cxx b/java/jni/direct_bt/DBTNativeDownlink.cxx
index 4a9bc174..0ba8fe51 100644
--- a/java/jni/direct_bt/DBTNativeDownlink.cxx
+++ b/java/jni/direct_bt/DBTNativeDownlink.cxx
@@ -25,7 +25,6 @@
#include "direct_bt_tinyb_DBTNativeDownlink.h"
-// #define VERBOSE_ON 1
#include <dbt_debug.hpp>
#include "JNIMem.hpp"
@@ -53,7 +52,7 @@ void Java_direct_1bt_tinyb_DBTNativeDownlink_initNativeJavaObject(JNIEnv *env, j
std::shared_ptr<JavaGlobalObj> jobjRef( new JavaGlobalObj(obj, mNotifyDeleted) );
javaUplink->setJavaObject( jobjRef );
JavaGlobalObj::check(javaUplink->getJavaObject(), E_FILE_LINE);
- // DBG_PRINT("Java_direct_1bt_tinyb_DBTNativeDownlink_initNativeJavaObject %p -> %s", javaUplink, javaUplink->toString().c_str());
+ DBG_JNI_PRINT("Java_direct_1bt_tinyb_DBTNativeDownlink_initNativeJavaObject %p -> %s", javaUplink, javaUplink->toString().c_str());
} catch(...) {
rethrow_and_raise_java_exception(env);
}
@@ -64,7 +63,7 @@ void Java_direct_1bt_tinyb_DBTNativeDownlink_deleteNativeJavaObject(JNIEnv *env,
(void)obj;
try {
JavaUplink *javaUplink = castInstance<JavaUplink>(nativeInstance);
- // DBG_PRINT("Java_direct_1bt_tinyb_DBTNativeDownlink_deleteNativeJavaObject %p -> %s", javaUplink, javaUplink->toString().c_str());
+ DBG_JNI_PRINT("Java_direct_1bt_tinyb_DBTNativeDownlink_deleteNativeJavaObject %p -> %s", javaUplink, javaUplink->toString().c_str());
javaUplink->setJavaObject(nullptr);
} catch(...) {
rethrow_and_raise_java_exception(env);