Debugger support for the interpreter (#5902)
commite0607c34f07e53f5bebe9671a31ef7bdd1390344
authorZoltan Varga <vargaz@gmail.com>
Tue, 31 Oct 2017 22:39:43 +0000 (31 18:39 -0400)
committerGitHub <noreply@github.com>
Tue, 31 Oct 2017 22:39:43 +0000 (31 18:39 -0400)
treedf4e11e8e0682408db6e445b4c7bd0a23a51f6e4
parent08bb8da2cc0f041d9f822690284cdacd4a5b4cc5
Debugger support for the interpreter (#5902)

* [interp] Add infrastructure code needed for unified exception handling between the interpreter and the JIT.

* Pass the clause to mono_interp_set_resume_state ().
* Add a mono_interp_run_filter () function to run filter clauses.
* Add a 'ji' field to ExceptionTraceIp which is used to avoid an ip->ji lookup in ves_icall_get_trace ().
* Rename mono_handle_exception_internal_first_pass () to handle_exception_first_pass () and make it return the
  StackFrameInfo for the frame which caught the exception.

This allows the removal of the duplicate and hard to understand interpreter EH code
and makes it easier to add debugger support to the intepreter.

* [sdb] Pass the already computed StackFrameInfo to mono_debugger_agent_handle_exception () so it doesn't have to be recomputed in ss_create (). This approach works both for the JIT and the interpreter.

* [interp] Generate seq points for async methods too.

* [interp] Rename ves_exec_method_with_context () to interp_exec_method_full (), add a interp_exec_method () helper with less arguments.

* [interp] Set ctx->sp for interpreter frames to the address of the InterpFrame structure, code in debugger-agent.c uses it to order frames.

* [sdb] Fix the support for filter clauses in the interpreter by running them in a new interpreter frame.

* [sdb] Add DEBUGGER_INVOKE frames for the interpreter.

* [interp] Add a mono_interp_frame_get_parent () function, use that instead of the 'new_sp' argument to mono_interp_frame_iter_next ().

* [sdb] Run the test code for the ClassLocalReflection () test only for that test since it doesn't work with the interpreter.

* [interp] Fix the build.
mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs
mcs/class/Mono.Debugger.Soft/Test/dtest.cs
mono/mini/debugger-agent.c
mono/mini/debugger-agent.h
mono/mini/interp/interp-stubs.c
mono/mini/interp/interp.c
mono/mini/interp/interp.h
mono/mini/interp/transform.c
mono/mini/mini-exceptions.c