return sp;
}
+static void
+do_debugger_tramp (void (*tramp) (void), MonoInvocation *frame)
+{
+ MonoLMFExt ext;
+ interp_push_lmf (&ext, frame);
+ tramp ();
+ interp_pop_lmf (&ext);
+}
+
+static void
+do_transform_method (MonoInvocation *frame, ThreadContext *context)
+{
+ MonoLMFExt ext;
+
+ /* Use the parent frame as the current frame is not complete yet */
+ interp_push_lmf (&ext, frame->parent);
+
+ frame->ex = mono_interp_transform_method (frame->runtime_method, context);
+ context->managed_code = 1;
+
+ interp_pop_lmf (&ext);
+}
+
/*
* These functions are the entry points into the interpreter from compiled code.
* They are called by the interp_in wrappers. They have the following signature:
g_free (mn);
#endif
- MonoLMFExt ext;
-
- /* Use the parent frame as the current frame is not complete yet */
- interp_push_lmf (&ext, frame->parent);
-
- frame->ex = mono_interp_transform_method (frame->runtime_method, context);
- context->managed_code = 1;
-
- interp_pop_lmf (&ext);
-
+ do_transform_method (frame, context);
if (frame->ex) {
rtm = NULL;
ip = NULL;
MINT_IN_CASE(MINT_NOP)
++ip;
MINT_IN_BREAK;
- MINT_IN_CASE(MINT_BREAK) {
+ MINT_IN_CASE(MINT_BREAK)
++ip;
-
- MonoLMFExt ext;
-
- interp_push_lmf (&ext, frame);
-
- mono_debugger_agent_user_break ();
-
- interp_pop_lmf (&ext);
+ do_debugger_tramp (mono_debugger_agent_user_break, frame);
MINT_IN_BREAK;
- }
MINT_IN_CASE(MINT_LDNULL)
sp->data.p = NULL;
++ip;
MINT_IN_BREAK;
MINT_IN_CASE(MINT_SDB_INTR_LOC)
if (G_UNLIKELY (ss_enabled)) {
- MonoLMFExt ext;
static void (*ss_tramp) (void);
if (!ss_tramp) {
*/
frame->ip = ip + 1;
- interp_push_lmf (&ext, frame);
/*
* Use the same trampoline as the JIT. This ensures that
* the debugger has the context for the last interpreter
* native frame.
*/
- ss_tramp ();
- interp_pop_lmf (&ext);
+ do_debugger_tramp (ss_tramp, frame);
if (context->has_resume_state) {
if (frame == context->handler_frame)
++ip;
MINT_IN_BREAK;
MINT_IN_CASE(MINT_SDB_BREAKPOINT) {
- MonoLMFExt ext;
-
static void (*bp_tramp) (void);
if (!bp_tramp) {
void *tramp = mini_get_breakpoint_trampoline ();
frame->ip = ip;
- interp_push_lmf (&ext, frame);
/* Use the same trampoline as the JIT */
- bp_tramp ();
- interp_pop_lmf (&ext);
+ do_debugger_tramp (bp_tramp, frame);
if (context->has_resume_state) {
if (frame == context->handler_frame)