-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fixed a buildscript bug that broke compiler flags for baron - Added fake class, method and field lookups to the example JNI module - Covnerted over to the new CX::va_list_t wrapper type for variadic c functions - Added modifier deserializers for JClass, JMethodID and JFieldID, closes #1 - Added conditional logging for class, method and field fabrication. Only prints if BARON_DEBUG is set
- Loading branch information
1 parent
137c488
commit 4049b27
Showing
13 changed files
with
126 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,5 +11,7 @@ int main(int argc, char **argv) { | |
|
||
vm.removeLibrary("./libjni.so"); | ||
|
||
vm.destroy(); | ||
|
||
return 0; | ||
} |
Submodule fake-jni
updated
25 files
+6 −0 | .gitmodules | |
+94 −4 | CMakeLists.txt | |
+1 −1 | CX | |
+40 −4 | README.md | |
+6 −3 | examples/src/agent.cpp | |
+4 −2 | examples/src/jni.cpp | |
+4 −14 | examples/src/main.cpp | |
+24 −0 | include/fake-jni/fake-jni.h | |
+32 −17 | include/fake-jni/internal/meta/meta.h | |
+195 −137 | include/fake-jni/internal/meta/method.h | |
+138 −0 | include/fake-jni/internal/util.h | |
+258 −118 | include/fake-jni/jvm.h | |
+1 −0 | libunwind | |
+49 −0 | src/fake-jni/fake-jni.cpp | |
+3 −4 | src/fake-jni/jni/invoke/misc.cpp | |
+9 −5 | src/fake-jni/jni/native/field.cpp | |
+30 −30 | src/fake-jni/jni/native/method.cpp | |
+62 −31 | src/fake-jni/jni/native/native.cpp | |
+3 −1 | src/fake-jni/jni/native/native_vararg.cpp | |
+1 −1 | src/fake-jni/jni/native/object.cpp | |
+7 −3 | src/fake-jni/jvm/class.cpp | |
+50 −21 | src/fake-jni/jvm/field.cpp | |
+229 −9 | src/fake-jni/jvm/jvm.cpp | |
+56 −83 | src/fake-jni/jvm/method.cpp | |
+1 −0 | xz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#pragma once | ||
|
||
#include <string> | ||
|
||
namespace Baron { | ||
std::string deserializeClassModifiers(uint32_t modifiers); | ||
std::string deserializeFieldModifiers(uint32_t modifiers); | ||
std::string deserializeMethodModifiers(uint32_t modifiers); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#include "baron/util/util.h" | ||
|
||
#define _MODIFIER_CASE(clazz, modifier) \ | ||
if ((modifiers & clazz::modifier) == clazz::modifier) {\ | ||
smods.append(#modifier);\ | ||
} | ||
|
||
#include <fake-jni/jvm.h> | ||
|
||
namespace Baron { | ||
std::string deserializeClassModifiers(uint32_t modifiers) { | ||
std::string smods; | ||
_MODIFIER_CASE(FakeJni::JClass, PUBLIC) | ||
_MODIFIER_CASE(FakeJni::JClass, PRIVATE) | ||
_MODIFIER_CASE(FakeJni::JClass, PROTECTED) | ||
_MODIFIER_CASE(FakeJni::JClass, STATIC) | ||
_MODIFIER_CASE(FakeJni::JClass, FINAL) | ||
_MODIFIER_CASE(FakeJni::JClass, INTERFACE) | ||
_MODIFIER_CASE(FakeJni::JClass, ABSTRACT) | ||
_MODIFIER_CASE(FakeJni::JClass, SYNTHETIC) | ||
_MODIFIER_CASE(FakeJni::JClass, ANNOTATION) | ||
_MODIFIER_CASE(FakeJni::JClass, ENUM) | ||
return smods; | ||
} | ||
|
||
std::string deserializeFieldModifiers(uint32_t modifiers) { | ||
std::string smods; | ||
_MODIFIER_CASE(FakeJni::JMethodID, PUBLIC) | ||
_MODIFIER_CASE(FakeJni::JMethodID, PRIVATE) | ||
_MODIFIER_CASE(FakeJni::JMethodID, PROTECTED) | ||
_MODIFIER_CASE(FakeJni::JMethodID, STATIC) | ||
_MODIFIER_CASE(FakeJni::JMethodID, FINAL) | ||
_MODIFIER_CASE(FakeJni::JMethodID, SYNCHRONIZED) | ||
_MODIFIER_CASE(FakeJni::JMethodID, BRIDGE) | ||
_MODIFIER_CASE(FakeJni::JMethodID, VARARGS) | ||
_MODIFIER_CASE(FakeJni::JMethodID, NATIVE) | ||
_MODIFIER_CASE(FakeJni::JMethodID, ABSTRACT) | ||
_MODIFIER_CASE(FakeJni::JMethodID, STRICT) | ||
_MODIFIER_CASE(FakeJni::JMethodID, SYNTHETIC) | ||
return smods; | ||
} | ||
|
||
std::string deserializeMethodModifiers(uint32_t modifiers) { | ||
std::string smods; | ||
_MODIFIER_CASE(FakeJni::JFieldID, PUBLIC) | ||
_MODIFIER_CASE(FakeJni::JFieldID, PRIVATE) | ||
_MODIFIER_CASE(FakeJni::JFieldID, PROTECTED) | ||
_MODIFIER_CASE(FakeJni::JFieldID, STATIC) | ||
_MODIFIER_CASE(FakeJni::JFieldID, FINAL) | ||
_MODIFIER_CASE(FakeJni::JFieldID, VOLATILE) | ||
_MODIFIER_CASE(FakeJni::JFieldID, TRANSIENT) | ||
_MODIFIER_CASE(FakeJni::JFieldID, SYNTHETIC) | ||
_MODIFIER_CASE(FakeJni::JFieldID, ENUM) | ||
return smods; | ||
} | ||
} |