#include "vm/breakpoint.hpp"
#include "vm/exceptions.hpp"
+#include "vm/hook.hpp"
#include "vm/initialize.hpp"
#include "vm/options.h"
#include "vm/os.hpp"
#define TRACE_PATCHER_INDENT for (i=0; i<patcher_depth; i++) printf("\t")
#endif /* !defined(NDEBUG) */
-java_handle_t *patcher_handler(u1 *pc)
+bool patcher_handler(u1 *pc)
{
codeinfo *code;
patchref_t *pr;
}
#endif
code->patchers->unlock();
- return NULL;
+ return true;
}
#if !defined(NDEBUG)
}
#endif
- // Check for return value and exit accordingly.
- if (result == false) {
- // Mangle the pending exception.
+ // Check return value and mangle the pending exception.
+ if (result == false)
resolve_handle_pending_exception(true);
- // Get the exception and return it.
- java_handle_t* e = exceptions_get_and_clear_exception();
-
- code->patchers->unlock();
-
- return e;
- }
-
- pr->done = true; /* XXX this is only preliminary to prevent double-patching */
+ // XXX This is only preliminary to prevent double-patching.
+ else
+ pr->done = true;
code->patchers->unlock();
- return NULL;
+ return result;
}
// Get stuff from the patcher reference.
Breakpoint* breakp = (Breakpoint*) pr->ref;
-#if defined(ENABLE_JVMTI)
- methodinfo* m = breakp->method;
- int32_t l = breakp->location;
-
- log_message_method("JVMTI: Reached breakpoint in method ", m);
- log_println("JVMTI: Reached breakpoint at location %d", l);
-#endif
+ // Hook point when a breakpoint was triggered.
+ Hook::breakpoint(breakp);
// In case the breakpoint wants to be kept active, we simply
// fail to "patch" at this point.