Debugger3.LastBreakReason Özellik
Bir program kesildi son neden alır. Program verir çalışıyorsa, DBG_REASON_NONE.
Ad alanı: EnvDTE90
Derleme: EnvDTE90 (EnvDTE90.dll içinde)
Sözdizimi
'Bildirim
ReadOnly Property LastBreakReason As dbgEventReason
Get
dbgEventReason LastBreakReason { get; }
property dbgEventReason LastBreakReason {
dbgEventReason get ();
}
abstract LastBreakReason : dbgEventReason
function get LastBreakReason () : dbgEventReason
Özellik Değeri
Tür: EnvDTE.dbgEventReason
A dbgEventReason değer.
Yüklenen
Açıklamalar
Bir program, örneğin, bazı nedenleri aşağıdaki için bölünebilir:
Bir kesme noktası isabet aldı. Gets dbgEventReasonBreakpoint.
Bir özel durum oluşturuldu. Gets dbgEventReasonExceptionThrown.
Bir özel durum oluşturuldu, ancak ayıklanacak program tarafından işlenmedi. Gets dbgEventReasonExceptionNotHandled.
Hiçbir şey ayıklanacak veya hata ayıklayıcı çalıştırma modunda olduğundan, bu özellik döndürür dbgEventReasonNone.
Numaralandırma tam listesi için bkz: dbgEventReason.
Örnekler
Aşağıdaki örnek, nasıl kullanılacağını gösterir LastBreakReason özelliği.
Bu özellik test etmek için:
Bir kesme noktası hedef uygulamada ayarlayın. Eklentiyi çalıştırın.
Hedef uygulama hata ayıklama modunda çalıştırın.
Eklentiyi çalıştırın.
public static void LastBreakReason(EnvDTE80.DTE2 dte)
{
// Setup debug Output window.
Window w =
(Window)dte.Windows.Item(EnvDTE.Constants.vsWindowKindOutput);
w.Visible = true;
OutputWindow ow = (OutputWindow)w.Object;
OutputWindowPane owp = ow.OutputWindowPanes.Add("Last Break Reason
Test");
owp.Activate();
owp.OutputString("The reason that a program was broken: ");
EnvDTE90.Debugger3 debugger = (EnvDTE90.Debugger3)dte.Debugger;
switch (debugger.LastBreakReason)
{
case dbgEventReason.dbgEventReasonBreakpoint:
owp.OutputString("Breakpoint hit.");
break;
case dbgEventReason.dbgEventReasonNone:
owp.OutputString("No reason");
break;
case dbgEventReason.dbgEventReasonExceptionNotHandled:
owp.OutputString("Exception not handled by the debuggee");
break;
case dbgEventReason.dbgEventReasonExceptionThrown:
owp.OutputString("Exception thrown");
break;
}
}
Sub LastBreakReason()
' This function shows the reason break mode was entered
' in the Output window.
Dim ow As OutputWindow
ow = DTE2.Windows.Item(Constants.vsWindowKindOutput).Object
Select Case DTE2.Debugger.LastBreakReason
Case dbgEventReason.dbgEventReasonBreakpoint
ow.ActivePane.OutputString("Breakpoint hit" + vbCrLf)
Case dbgEventReason.dbgEventReasonNone
ow.ActivePane.OutputString("No reason" + vbCrLf)
Case dbgEventReason.dbgEventReasonExceptionNotHandled
ow.ActivePane.OutputString("Exception not handled by the _
debuggee" + vbCrLf)
Case dbgEventReason.dbgEventReasonExceptionThrown
ow.ActivePane.OutputString("Exception thrown" + vbCrLf)
End Select
End Sub
.NET Framework Güvenliği
- Anında arayanlar için tam güven. Bu üye kısmen güvenilen kodla kullanılamaz. Daha fazla bilgi için bkz. kısmen güvenilir kod tarafından Kitaplıklar kullanma.