2009-11-09 37 views
1

我試圖從mdbglib使用dbgeng時出現此異常:ASDumpAnalyzer.exe中0x037ba4f4(dbgeng.dll)的第一次機會異常:0xC000001D:非法指令。我想知道如何去調試這個?如何調試非法指令異常?

它正在拋出彙編指令vmcpuid。當我單步執行該指令時,代碼將按預期工作。

堆棧跟蹤:

dbgeng.dll!X86IsVirtualMachine() + 0x44 bytes 
dbgeng.dll!LiveUserDebugServices::GetTargetInfo() + 0x95 bytes 
dbgeng.dll!LiveUserTargetInfo::InitFromServices() + 0x95 bytes 
dbgeng.dll!LiveUserTargetInfo::WaitForEvent() + 0x4f bytes 
dbgeng.dll!WaitForAnyTarget() + 0x5f bytes 
dbgeng.dll!RawWaitForEvent() + 0x2ae bytes 
dbgeng.dll!DebugClient::WaitForEvent() + 0xb0 bytes 
[Managed to Native Transition] 
mdbglib.dll!MS::Debuggers::DbgEng::DebugControl::WaitForEvent(unsigned int timeout = 0) Line 107 + 0x38 bytes C++ 
mdbglib.dll!MS::Debuggers::DbgEng::Debuggee::WaitForEvent(unsigned int timeout = 0) Line 365 C++ 
ASDumpAnalyzer.exe!ASDumpAnalyzer.Program.WriteMemoryDump() Line 51 + 0xd bytes C# 
ASDumpAnalyzer.exe!ASDumpAnalyzer.Program.Main() Line 21 + 0x5 bytes C# 
[email protected]() + 0x34 bytes 
[email protected]() + 0x23 bytes 
+1

你有沒有試過不打破第一次機會例外?我敢打賭,X86IsVirtualMachine有一個圍繞VMCPUID的__try/__ finally塊......因爲它不是一個有效的指令,你可能沒有在虛擬機下運行。 – 2009-11-09 05:41:38

+0

是的,這是我的問題。感謝您指出我的錯誤。如果您提交答案,我會將您的答案標記爲答案。 – 2009-11-09 13:13:31

回答

1

您是否嘗試過不上破第一次機會異常?我敢打賭,X86IsVirtualMachine在VMCPUID周圍有一個__try/__finally塊...因爲它不是一個有效的指令,你可能沒有在虛擬機下運行。