Qualnet 調試記錄

在Qualnet裏添加了一個應用層協議,編譯完全通過,但在運行時總是在63s內存讀取錯誤。可以肯定是路由表更新處指針調用錯誤了.爲了定位錯誤,最可靠的辦法就是使用VS進行調試。但按照官方手冊設置調試時,卻出現瞭如下錯誤信息:
'qualnet.exe': Loaded 'C:\snt\qualnet\5.0\bin\qualnet.exe', Symbols loaded.
'qualnet.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll'
'qualnet.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll'
'qualnet.exe': Loaded 'C:\WINDOWS\system32\ws2_32.dll'
'qualnet.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll'
'qualnet.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll'
'qualnet.exe': Loaded 'C:\WINDOWS\system32\secur32.dll'
'qualnet.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll'
'qualnet.exe': Loaded 'C:\WINDOWS\system32\ws2help.dll'
'qualnet.exe': Loaded 'C:\snt\qualnet\5.0\bin\libexpat.dll', Binary was not built with debug information.
'qualnet.exe': Loaded 'C:\WINDOWS\system32\user32.dll'
'qualnet.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll'
'qualnet.exe': Loaded 'C:\WINDOWS\system32\netapi32.dll'
'qualnet.exe': Loaded 'C:\WINDOWS\system32\comdlg32.dll'
'qualnet.exe': Loaded 'C:\WINDOWS\system32\comctl32.dll'
'qualnet.exe': Loaded 'C:\WINDOWS\system32\shell32.dll'
'qualnet.exe': Loaded 'C:\WINDOWS\system32\shlwapi.dll'
'qualnet.exe': Loaded 'C:\WINDOWS\system32\imm32.dll'
'qualnet.exe': Loaded 'C:\WINDOWS\system32\lpk.dll'
'qualnet.exe': Loaded 'C:\WINDOWS\system32\usp10.dll'
'qualnet.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.6028_x-ww_61e65202\comctl32.dll'
The program '[6780] qualnet.exe: Native' has exited with code 10 (0xa).

問題分析與解決:
(1)“Binary was not built with debug information.”爲編譯是沒加上調試選項。這和後面斷點調試出現的“The breakpoint will not currently be hit. No symbols have been loaded for this document”的原因一樣。這是因爲選擇VS編譯器中的編譯按鈕,調用的是QUALNET_HOME\Makefile編譯文件,根據官方手冊指導,Makefile調用的是QUALNET_HOME\main\Makefile-windows-vc9,而手冊只是說要在QUALNET_HOME\main\Makefile裏開啓DEBUG = /Zi調試選項,並沒有說明要在QUALNET_HOME\main\Makefile-windows-vc9裏開啓,因此按照手冊操作發生此錯誤。
解決辦法兩種:
1)按照手冊,在QUALNET_HOME\main\Makefile裏開啓DEBUG = /Zi調試選項,然後打開QualNet Developer xxx Command-Line,進入QUALNET_HOME\main目錄,在裏面用命令nmake clean/nmake進行編譯。
2)修改QUALNET_HOME\Makefile編譯文件,使其調用指向爲QUALNET_HOME\main\Makefile,然後在QUALNET_HOME\main\Makefile裏開啓DEBUG = /Zi調試選項。使用VS編譯器中的編譯按鈕進行編譯。

(2)“The program '[6780] qualnet.exe: Native' has exited with code 10 (0xa).”爲調試時沒有指定場景配置文件,解決辦法可如下:
1) Start Visual C++ 2008.
2) Select File > Open > Project/Solutionand select the qualnet project.(而不是手冊說的qualnet.exe)
3)  Select Project > Properties > Configuration Properties > Debugging.
       Set Command Argumentsto the name of the scenario configuration (.config) file to be debugged.
       Set Working Directoryto the directory where the scenario configuration file is located
4) Set the breakpoints as desired and debug using the commands listed in the Debugmenu.
5) start Debug

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章