Condividi tramite


MDAInfo Structure

Provides details about the Event_MDAFired event, which triggers the creation of a managed debugging assistant (MDA).

typedef struct _MDAInfo {
    LPCWSTR  lpMDACaption;
    LPCWSTR  lpMDAMessage
} MDAInfo;

Members

Member

Description

lpMDACaption

The title of the current MDA. The title describes the kind of failure that triggered the Event_MDAFired event.

lpMDAMessage

The output message provided by the current MDA.

Remarks

Managed debugging assistants (MDAs) are debugging aids that work in conjunction with the common language runtime (CLR) to perform tasks such as identifying invalid conditions in the runtime execution engine or dumping additional information about the state of the engine. MDAs generate XML messages about events that are otherwise difficult to trap. They are especially useful for debugging transitions between managed and unmanaged code.

The runtime takes the following steps when an event that triggers the creation of an MDA is fired:

  • If the host has not registered an IActionOnCLREvent instance by calling ICLROnEventManager::RegisterActionOnEvent to be notified of an Event_MDAFired event, the runtime proceeds with its default, non-hosted behavior.

  • If the host has registered a handler for this event, the runtime checks to see whether a debugger is attached to the process. If it is, the runtime breaks into the debugger. When the debugger continues, it calls into the host. If no debugger is attached, the runtime calls IActionOnCLREvent::OnEvent and passes a pointer to an MDAInfo instance as the data parameter.

The host can choose to activate MDAs and to be notified when an MDA is activated. This gives the host an opportunity to override default behavior and to abort the managed thread that raised the event, to prevent it from corrupting the process state. For more information about using MDAs, see Diagnosing Errors with Managed Debugging Assistants.

Requirements

Platforms: Windows 2000, Windows XP, Windows Server 2003 family

Header: MSCorEE.idl

Library: Included as a resource in MSCorEE.dll

.NET Framework Version: 2.0

See Also

Concepts

Hosting Structures

Diagnosing Errors with Managed Debugging Assistants