Visual c++ Call Stack窗口调试 跟踪“内存不能为读”的错误

Call Stack窗口用于观看函数运行时的参数类型、参数值信息。当程序处于调试阶段时,Call Stack窗口会将当前代码所在的函数显示在窗口的上方,其后是调用该函数的上级函数,直到WinMain()函数入口。

比如程序会在执行一段时间后出现“内存xxx不能为读”的错误,如果在VC调试模式下执行程序,会出现Access   Violation的警告,VC会自动断点到当前执行的函数,也就是产生Access   Violation异常的那个函数,然后这时打开Call Stack,可以看到函数的调用顺序及参数,例如:

CStbTestDoc::Serialize(CArchive & {...}) line 62
CDocument::OnSaveDocument(const char * 0x011529fc) line 759
CStbTestDoc::OnSaveDocument(const char * 0x011529fc) line 75
CStbTestView::OnAutoSave() line 732 + 36 bytes
CStbTestView::PreTranslateMessage(tagMSG * 0x0085ad5c {msg=0x00000113 wp=0x00000000 lp=0x00000000}) line 747
CWnd::WalkPreTranslateTree(HWND__ * 0x000d039e, tagMSG * 0x0085ad5c {msg=0x00000113 wp=0x00000000 lp=0x00000000}) line 2667 + 18 bytes
CWinThread::PreTranslateMessage(tagMSG * 0x0085ad5c {msg=0x00000113 wp=0x00000000 lp=0x00000000}) line 665 + 18 bytes
CNewEdXrfApp::PreTranslateMessage(tagMSG * 0x0085ad5c {msg=0x00000113 wp=0x00000000 lp=0x00000000}) line 614
CWinThread::PumpMessage() line 841 + 30 bytes
CWinThread::Run() line 480 + 11 bytes
CWinApp::Run() line 400
AfxWinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x00141f1f, int 1) line 49 + 11 bytes
WinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x00141f1f, int 1) line 30
WinMainCRTStartup() line 198 + 54 bytes
KERNEL32! 7c817077()

你可能感兴趣的:(C++,c)