Add crash reporting debugger event (#10628)
commit9aab5273dd8f1a516c4f072b350487a50cc0bced
authorAlexander Kyte <alexmkyte@gmail.com>
Fri, 19 Oct 2018 00:39:03 +0000 (18 20:39 -0400)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Fri, 19 Oct 2018 00:39:03 +0000 (19 02:39 +0200)
treef538100ae4e9f7d06421595970be7f9a40cceb37
parent4844ab019dc4c04eb5b96dceca32a84a6256dff5
Add crash reporting debugger event  (#10628)

This should help get information on native crashes that happen in hard-to-debug environments.

To quote https://github.com/mono/mono/issues/10157 :

When a mono runtime is attached to a managed debugger and the debugged runtime is induced to cause a crash, the state of that crash is not communicated to the managed debugger. This, combined with the difficulty in having the debugged runtime both attached to the managed debugger and lldb, makes this type of crash difficult to interactively debug.

When the managed debugger is the only connection someone has with the runtime because it is embedded in a way that is resistant to unmanaged debugging (watchOS application on-device, for instance), this is an even more difficult problem.

By adding an SDB protocol event that sends a type of "runtime death" and a blob of opaque json (version dependent, no protocol guarantees), people can report these crashes without having to assist a mono runtime engineer in observing a crash on device.

In the case that spurious bugs in this manner are submitted, it will require less effort as well to spot stack frames that indicate misuse of mixed managed-unmanaged APIs (which offer the ability to drive a segfault or g_assert
16 files changed:
bcl.sln
external/api-snapshot
mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft.csproj
mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft.dll.sources
mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs
mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/CrashEvent.cs [new file with mode: 0644]
mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/EventType.cs
mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VMDisconnectedException.cs
mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachine.cs
mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs
mcs/class/Mono.Debugger.Soft/Test/dtest.cs
mono/mini/debugger-agent-stubs.c
mono/mini/debugger-agent.c
mono/mini/debugger-agent.h
mono/mini/debugger-engine.h
mono/mini/mini-posix.c