阅读:4493回复:11
如何单步调试驱动程序
哪位大哥知道如何单步调试驱动程序,不然的靠打印调试信息太麻烦了
|
|
|
沙发#
发布于:2005-02-28 09:01
设断点啊,让驱动在目标机或者是仿真器上跑。
|
|
|
板凳#
发布于:2005-02-28 10:09
F10
|
|
|
地板#
发布于:2005-02-28 10:52
to wwei_wang:
经常看到你的留言,真是精彩。 我在平台下写的dll,在CPP文件中加上Extern \"C\" 再在需要导出的函数前面加上 __declspec(dllexport) 设置断点道是可以。 现在想问一个问题: 我如果想调试其它的驱动,如display驱动,把加入一个dll空项目中,根本编译不过去。(当然,用build命令还是可以的),那么如何设置断点呢? 只能用RETAILMSG等显示吗? |
|
|
地下室#
发布于:2005-02-28 11:58
to wwei_wang: 编译不过去,那可能是因为缺少所需的头文件和库文件吧。 |
|
|
5楼#
发布于:2005-03-01 15:48
多谢,可能是确实缺少库文件,可发现下面还有好的.S汇编Arm文件,加入到工程中(因为C程序调用汇编程序),发现无法编译,究竟该如何是好?
下面是source文件的内容: ___________________________________________________________ RELEASETYPE=PLATFORM TARGETNAME=sa2video TARGETTYPE=DYNLINK DLLENTRY=_DllMainCRTStartup TARGETLIBS= \\ $(_COMMONSDKROOT)\\lib\\$(_CPUINDPATH)\\coredll.lib \\ $(_COMMONOAKROOT)\\lib\\$(_CPUINDPATH)\\gpe.lib \\ $(_COMMONOAKROOT)\\lib\\$(_CPUINDPATH)\\dxdrvguid.lib SOURCELIBS= \\ $(_TARGETPLATROOT)\\lib\\$(_CPUINDPATH)\\drvlib.lib \\ $(_COMMONOAKROOT)\\lib\\$(_CPUINDPATH)\\ddgpe.lib CDEFINES=$(CDEFINES) -DDDI CDEFINES=$(CDEFINES) -DDD_ENABLE !IF \"$(DO_DISPPERF)\" == \"1\" CDEFINES=$(CDEFINES) -DDO_DISPPERF !ENDIF INCLUDES= \\ ..\\..\\..\\inc; SOURCES= \\ sa2video.cpp \\ dispdrvr.c \\ dirtyRectDumpCore_ASM.s \\ ebtext16_opt.s \\ ebcccc_opt.s \\ ebfill16_opt.s \\ halcaps.cpp \\ haldd.cpp \\ halpalette.cpp \\ halsurf.cpp |
|
|
6楼#
发布于:2005-03-03 12:30
(1)我没太明白啊:)))你是在pb中新创建一个空的dll,然后把已有的驱动文件代码加进去再编译,还是通过makefile和source文件进行编译?
(2)另外,你说无法编译,那么能否把出错信息贴上来? |
|
|
7楼#
发布于:2005-03-16 09:26
to milesky:
你好!你说的RetailMSG或者DebugMSG信息是显示在PB里面的Build窗口嘛?我怎么没有显示的哪? 我的驱动源码中都加入了此类代码,但是在目标板运行的时候却没有看到这类信息的显示,可否给我说明白一点哪,先谢谢了 :) |
|
|
8楼#
发布于:2005-03-16 09:28
sorry,milosky,写错了 ;)
|
|
|
9楼#
发布于:2005-03-16 12:39
也可以利用OEMWriteDebugString通过串口输出调试信息;
|
|
|
10楼#
发布于:2005-04-28 09:45
最近忙,没有上网,请帮忙看看:是链结的错误
Linking... dispdrvr.obj : error LNK2019: unresolved external symbol msWait referenced in function DispDrvrInitialize dispdrvr.obj : error LNK2019: unresolved external symbol VirtualAllocCopy referenced in function MapVirtualAddress dispdrvr.obj : error LNK2019: unresolved external symbol dirtyRectDump_core_ASM referenced in function DirtyRectDumpPortraitLoop_C dispdrvr.obj : error LNK2019: unresolved external symbol ellipse_core_ASM referenced in function DispDrvrDirtyRectDump2 sa2video.obj : error LNK2019: unresolved external symbol \"int __cdecl GPEEnableDriver(unsigned long,unsigned long,struct tagDrvEnableData *,struct _ENGCALLBACKS *)\" (?GPEEnableDriver@@YAHKKPAUtagDrvEnableData@@PAU_ENGCALLBACKS@@@Z) referenced in fun ction DrvEnableDriver sa2video.obj : error LNK2001: unresolved external symbol \"public: virtual long __cdecl GPE::ProcessCommandBlock(unsigned char *)\" (?ProcessCommandBlock@GPE@@UAAJPAE@Z) sa2video.obj : error LNK2001: unresolved external symbol \"public: virtual int __cdecl GPE::ScanLine(void)\" (?ScanLine@GPE@@UAAHXZ) sa2video.obj : error LNK2001: unresolved external symbol \"public: virtual unsigned long __cdecl GPE::AvailableVideoMemory(void)\" (?AvailableVideoMemory@GPE@@UAAKXZ) sa2video.obj : error LNK2001: unresolved external symbol \"public: virtual int __cdecl GPE::SurfaceBusyFlipping(class GPESurf *)\" (?SurfaceBusyFlipping@GPE@@UAAHPAVGPESurf@@@Z) sa2video.obj : error LNK2001: unresolved external symbol \"public: virtual void __cdecl GPE::WaitForVBlank(void)\" (?WaitForVBlank@GPE@@UAAXXZ) sa2video.obj : error LNK2001: unresolved external symbol \"public: virtual int __cdecl GPE::FlipInProgress(void)\" (?FlipInProgress@GPE@@UAAHXZ) sa2video.obj : error LNK2001: unresolved external symbol \"public: virtual void __cdecl GPE::SetVisibleSurface(class GPESurf *)\" (?SetVisibleSurface@GPE@@UAAXPAVGPESurf@@@Z) sa2video.obj : error LNK2001: unresolved external symbol \"public: virtual unsigned long __cdecl GPE::GetGraphicsCaps(void)\" (?GetGraphicsCaps@GPE@@UAAKXZ) sa2video.obj : error LNK2001: unresolved external symbol \"public: virtual int __cdecl GPE::ContrastControl(unsigned long,unsigned long *)\" (?ContrastControl@GPE@@UAAHKPAK@Z) sa2video.obj : error LNK2001: unresolved external symbol \"public: virtual int __cdecl GPE::IsPaletteSettable(void)\" (?IsPaletteSettable@GPE@@UAAHXZ) sa2video.obj : error LNK2001: unresolved external symbol \"public: virtual long __cdecl GPE::GetPalette(struct tagPALETTEENTRY * *,unsigned short *)\" (?GetPalette@GPE@@UAAJPAPAUtagPALETTEENTRY@@PAG@Z) sa2video.obj : error LNK2019: unresolved external symbol \"public: __cdecl GPE::GPE(void)\" (??0GPE@@QAA@XZ) referenced in function \"public: __cdecl SA2Video::SA2Video(void)\" (??0SA2Video@@QAA@XZ) sa2video.obj : error LNK2019: unresolved external symbol \"public: virtual __cdecl GPE::~GPE(void)\" (??1GPE@@UAA@XZ) referenced in function \"public: virtual void * __cdecl SA2Video::`scalar deleting destructor\'(unsigned int)\" (??_GSA2Video@@UAAPAXI@Z ) sa2video.obj : error LNK2019: unresolved external symbol EngCreatePalette referenced in function \"public: virtual long __cdecl SA2Video::SetMode(int,struct HPALETTE__ * *)\" (?SetMode@SA2Video@@UAAJHPAPAUHPALETTE__@@@Z) sa2video.obj : error LNK2019: unresolved external symbol \"public: void __cdecl GPESurf::Init(int,int,void *,int,enum EGPEFormat)\" (?Init@GPESurf@@QAAXHHPAXHW4EGPEFormat@@@Z) referenced in function \"public: virtual long __cdecl SA2Video::SetMode(int, struct HPALETTE__ * *)\" (?SetMode@SA2Video@@UAAJHPAPAUHPALETTE__@@@Z) sa2video.obj : error LNK2019: unresolved external symbol \"public: __cdecl GPESurf::GPESurf(int,int,enum EGPEFormat)\" (??0GPESurf@@QAA@HHW4EGPEFormat@@@Z) referenced in function \"public: virtual long __cdecl SA2Video::SetMode(int,struct HPALETTE__ * *)\" (?SetMode@SA2Video@@UAAJHPAPAUHPALETTE__@@@Z) sa2video.obj : error LNK2019: unresolved external symbol \"public: long __cdecl GPE::EmulatedLine(struct GPELineParms *)\" (?EmulatedLine@GPE@@QAAJPAUGPELineParms@@@Z) referenced in function \"private: long __cdecl SA2Video::WrappedEmulatedLine(struct GPELineParms *)\" (?WrappedEmulatedLine@SA2Video@@AAAJPAUGPELineParms@@@Z) sa2video.obj : error LNK2019: unresolved external symbol EGPEFormatToBpp referenced in function \"private: long __cdecl SA2Video::WrappedEmulatedBlt(struct GPEBltParms *)\" (?WrappedEmulatedBlt@SA2Video@@AAAJPAUGPEBltParms@@@Z) sa2video.obj : error LNK2019: unresolved external symbol \"public: virtual __cdecl GPESurf::~GPESurf(void)\" (??1GPESurf@@UAA@XZ) referenced in function \"public: virtual void * __cdecl GPESurf::`scalar deleting destructor\'(unsigned int)\" (??_GGPESurf@ @UAAPAXI@Z) sa2video.obj : error LNK2019: unresolved external symbol EmulatedBltSrcCopy1616ASM referenced in function \"long __cdecl EmulatedBltSrcCopy1616_Eml(struct GPEBltParms *)\" (?EmulatedBltSrcCopy1616_Eml@@YAJPAUGPEBltParms@@@Z) sa2video.obj : error LNK2019: unresolved external symbol \"public: long __cdecl GPE::EmulatedBlt(struct GPEBltParms *)\" (?EmulatedBlt@GPE@@QAAJPAUGPEBltParms@@@Z) referenced in function \"private: long __cdecl SA2Video::WrappedEmulatedBlt(struct GPEBl tParms *)\" (?WrappedEmulatedBlt@SA2Video@@AAAJPAUGPEBltParms@@@Z) sa2video.obj : error LNK2019: unresolved external symbol EmulatedBltFill16ASM referenced in function \"long __cdecl EmulatedBltFill16_Eml(struct GPEBltParms *)\" (?EmulatedBltFill16_Eml@@YAJPAUGPEBltParms@@@Z) sa2video.obj : error LNK2019: unresolved external symbol EmulatedBltText16ASM referenced in function \"long __cdecl EmulatedBltText16_Eml(struct GPEBltParms *)\" (?EmulatedBltText16_Eml@@YAJPAUGPEBltParms@@@Z) INTEL_XSCALE_TT-I255_PLATFORM_ARMV4IRel/DispDrv.dll : fatal error LNK1120: 28 unresolved externals Error PB2505: Error executing link.exe. DispDrv.dll - 30 error(s), 0 warning(s) |
|
|
11楼#
发布于:2005-04-28 11:35
老兄是你的某个库文件没有导入,看看是否缺少某个库文件导入就可以了。
|
|