请高手帮我看下使用AppVerifier检查内存泄露的问题(一)

Tannear 2009-03-06 02:31:28
今天在实验在Mobile上使用AppVerifier工具检查内存泄露时,发现生成的log与map文件不能解析函数名,这是为什么?

源代码如下:
#include <Windows.h>

void LeakMemory()
{
BYTE* p = new BYTE[10];
NKDbgPrintfW(L"Allocated memory: 0x%X", p);
}

void LeakHandle()
{
HANDLE h = CreateEvent(NULL, FALSE, FALSE, L"leaked_event");
NKDbgPrintfW(L"Created event: 0x%X", h);
}

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
LeakMemory();
LeakHandle();
return 0;
}



生成的map文件:
 Leak

Timestamp is 49b080f5 (Fri Mar 06 09:48:37 2009)

Preferred load address is 00010000

Start Length Name Class
0001:00000000 000003ccH .text CODE
0002:00000000 00000090H .rdata DATA
0002:00000090 0000006aH .rdata$debug DATA
0002:000000fc 00000014H .xdata DATA
0002:00000110 00000014H .idata$2 DATA
0002:00000124 00000014H .idata$3 DATA
0002:00000138 0000001cH .idata$4 DATA
0002:00000154 0000000cH .idata$6 DATA
0002:00000160 00000000H .edata DATA
0003:00000000 0000001cH .idata$5 DATA
0003:0000001c 00000004H .CRT$XCA DATA
0003:00000020 00000004H .CRT$XCZ DATA
0003:00000024 00000004H .CRT$XIA DATA
0003:00000028 00000004H .CRT$XIZ DATA
0003:0000002c 00000004H .CRT$XPA DATA
0003:00000030 00000004H .CRT$XPZ DATA
0003:00000034 00000004H .CRT$XTA DATA
0003:00000038 00000004H .CRT$XTZ DATA
0003:0000003c 00000009H .bss DATA
0004:00000000 00000068H .pdata DATA

Address Publics by Value Rva+Base Lib:Object

0000:00000000 ___safe_se_handler_table 00000000 <absolute>
0000:00000000 ___safe_se_handler_count 00000000 <absolute>
0001:00000000 ?LeakMemory@@YAXXZ 00011000 f Leak.obj
0001:0000003c ?LeakHandle@@YAXXZ 0001103c f Leak.obj
0001:00000080 WinMain 00011080 f Leak.obj
0001:000000ac NKDbgPrintfW 000110ac f coredll:COREDLL.dll
0001:000000bc ??2@YAPAXI@Z 000110bc f coredll:COREDLL.dll
0001:000000cc CreateEventW 000110cc f coredll:COREDLL.dll
0001:000000e4 WinMainCRTStartup 000110e4 f corelibc:pegwmain.obj
0001:00000158 GetCurrentProcess 00011158 f i corelibc:crt0dat.obj
0001:00000194 _cinit 00011194 f corelibc:crt0dat.obj
0001:00000304 exit 00011304 f corelibc:crt0dat.obj
0001:0000031c _exit 0001131c f corelibc:crt0dat.obj
0001:00000334 _cexit 00011334 f corelibc:crt0dat.obj
0001:00000350 _c_exit 00011350 f corelibc:crt0dat.obj
0001:0000039c _XcptFilter 0001139c f coredll:COREDLL.dll
0001:000003ac __C_specific_handler 000113ac f coredll:COREDLL.dll
0001:000003bc LocalFree 000113bc f coredll:COREDLL.dll
0002:00000110 __IMPORT_DESCRIPTOR_COREDLL 00012110 coredll:COREDLL.dll
0002:00000124 __NULL_IMPORT_DESCRIPTOR 00012124 coredll:COREDLL.dll
0003:00000000 __imp_??2@YAPAXI@Z 00013000 coredll:COREDLL.dll
0003:00000004 __imp_CreateEventW 00013004 coredll:COREDLL.dll
0003:00000008 __imp__XcptFilter 00013008 coredll:COREDLL.dll
0003:0000000c __imp___C_specific_handler 0001300c coredll:COREDLL.dll
0003:00000010 __imp_LocalFree 00013010 coredll:COREDLL.dll
0003:00000014 __imp_NKDbgPrintfW 00013014 coredll:COREDLL.dll
0003:00000018 \177COREDLL_NULL_THUNK_DATA 00013018 coredll:COREDLL.dll
0003:0000001c __xc_a 0001301c corelibc:crt0init.obj
0003:00000020 __xc_z 00013020 corelibc:crt0init.obj
0003:00000024 __xi_a 00013024 corelibc:crt0init.obj
0003:00000028 __xi_z 00013028 corelibc:crt0init.obj
0003:0000002c __xp_a 0001302c corelibc:crt0init.obj
0003:00000030 __xp_z 00013030 corelibc:crt0init.obj
0003:00000034 __xt_a 00013034 corelibc:crt0init.obj
0003:00000038 __xt_z 00013038 corelibc:crt0init.obj
0003:0000003c __onexitend 0001303c <common>
0003:00000040 __onexitbegin 00013040 <common>
0003:00000044 _exitflag 00013044 <common>

entry point at 0001:000000e4

Static symbols

0001:00000160 _initterm 00011160 f corelibc:crt0dat.obj
0001:00000200 doexit 00011200 f corelibc:crt0dat.obj


未完待续!
...全文
159 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
我骷髅我快乐 2010-10-30
  • 打赏
  • 举报
回复
为什么我 用的时候 应用程序起不来呢?
儿大不由爷 2009-03-06
  • 打赏
  • 举报
回复
AppVerifier支持Windows Mobile么?

7,655

社区成员

发帖
与我相关
我的任务
社区描述
Windows Phone是微软发布的一款手机操作系统,它将微软旗下的Xbox LIVE游戏、Zune音乐与独特的视频体验整合至手机中。
社区管理员
  • Windows客户端开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧