Debugging 64位操作系统上Win32程序的错误调试 Windows 7 64位、Visual Studio 2010、控制台C++应用程序、Win32调试配置: #include "stdafx.h" int _tmain(int argc, _TCHAR* argv[]) { char* p = NULL; *p = 1; return 0; }

Debugging 64位操作系统上Win32程序的错误调试 Windows 7 64位、Visual Studio 2010、控制台C++应用程序、Win32调试配置: #include "stdafx.h" int _tmain(int argc, _TCHAR* argv[]) { char* p = NULL; *p = 1; return 0; },debugging,visual-c++,64-bit,32bit-64bit,visual-studio-debugging,Debugging,Visual C++,64 Bit,32bit 64bit,Visual Studio Debugging,现在,如果我在x64调试配置中运行相同的程序,一切正常-调试器在第*p=1行中断。如何获得Win32程序的正确调试?调试->异常->Win32异常->c0000005在“抛出”列或整个Win32异常的“抛出”列中勾选框 test2.exe中0x00041378处的首次机会异常:0xC0000005:访问冲突写入位置0x00000000谢谢,这就成功了。有趣的是,为什么它在没有对x64进行此更改的情况下工作?可能是出于设计,Visual Studio调试器团队必须知道, Unhandled exc

现在,如果我在x64调试配置中运行相同的程序,一切正常-调试器在第
*p=1
行中断。如何获得Win32程序的正确调试?

调试->异常->Win32异常->c0000005在“抛出”列或整个Win32异常的“抛出”列中勾选框


test2.exe中0x00041378处的首次机会异常:0xC0000005:访问冲突写入位置0x00000000

谢谢,这就成功了。有趣的是,为什么它在没有对x64进行此更改的情况下工作?可能是出于设计,Visual Studio调试器团队必须知道, Unhandled exception at 0x77d915de in test.exe: 0xC0000005: Access violation writing location 0x00000000. ntdll.dll!77d915de() [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] ntdll.dll!77d915de() ntdll.dll!77d8014e() msvcr100d.dll!_heap_alloc_dbg_impl(unsigned int nSize, int nBlockUse, const char * szFileName, int nLine, int * errno_tmp) Line 504 + 0xc bytes C++ >ffffffff() 'test.exe': Loaded 'C:\tmp\test\Debug\test.exe', Symbols loaded. 'test.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file 'test.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file 'test.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file 'test.exe': Loaded 'C:\Windows\SysWOW64\msvcr100d.dll', Symbols loaded. First-chance exception at 0x010f13a8 in test.exe: 0xC0000005: Access violation writing location 0x00000000. Unhandled exception at 0x77d915de in test.exe: 0xC0000005: Access violation writing location 0x00000000.
*p = 1; 
00041375 mov eax,dword ptr [p]
00041378 mov byte ptr [eax],1