summaryrefslogtreecommitdiff
path: root/test/ti-agent/common_helper.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2017-01-10 09:00:28 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2017-01-10 09:00:29 +0000
commitc38c429ef1246a7abcfa88dafb6325e06a934b2b (patch)
tree2fa31602bc18dd28fa9f036d5345e3da7575979e /test/ti-agent/common_helper.cc
parenta82de09e6d1d54ec7381efdf226a289a1ff0504d (diff)
parentf9d41c1d269f3031c0a89e34fc4a04303e186958 (diff)
Merge "Revert "Add basic checks for redefinition.""
Diffstat (limited to 'test/ti-agent/common_helper.cc')
-rw-r--r--test/ti-agent/common_helper.cc21
1 files changed, 2 insertions, 19 deletions
diff --git a/test/ti-agent/common_helper.cc b/test/ti-agent/common_helper.cc
index 01b6c989cc..ebf1e4621c 100644
--- a/test/ti-agent/common_helper.cc
+++ b/test/ti-agent/common_helper.cc
@@ -17,7 +17,6 @@
#include "ti-agent/common_helper.h"
#include <stdio.h>
-#include <sstream>
#include "art_method.h"
#include "jni.h"
@@ -42,24 +41,8 @@ void SetAllCapabilities(jvmtiEnv* env) {
namespace common_redefine {
-static void throwRedefinitionError(jvmtiEnv* jvmti, JNIEnv* env, jclass target, jvmtiError res) {
- std::stringstream err;
- char* signature = nullptr;
- char* generic = nullptr;
- jvmti->GetClassSignature(target, &signature, &generic);
- char* error = nullptr;
- jvmti->GetErrorName(res, &error);
- err << "Failed to redefine class <" << signature << "> due to " << error;
- std::string message = err.str();
- jvmti->Deallocate(reinterpret_cast<unsigned char*>(signature));
- jvmti->Deallocate(reinterpret_cast<unsigned char*>(generic));
- jvmti->Deallocate(reinterpret_cast<unsigned char*>(error));
- env->ThrowNew(env->FindClass("java/lang/Exception"), message.c_str());
-}
-
using RedefineDirectFunction = jvmtiError (*)(jvmtiEnv*, jclass, jint, const unsigned char*);
-static void DoClassTransformation(jvmtiEnv* jvmti_env,
- JNIEnv* env,
+static void DoClassTransformation(jvmtiEnv* jvmti_env, JNIEnv* env,
jclass target,
jbyteArray class_file_bytes,
jbyteArray dex_file_bytes) {
@@ -80,7 +63,7 @@ static void DoClassTransformation(jvmtiEnv* jvmti_env,
res = f(jvmti_env, target, len, redef_bytes);
}
if (res != JVMTI_ERROR_NONE) {
- throwRedefinitionError(jvmti_env, env, target, res);
+ printf("Redefinition failed!");
}
}