因为这与原始查询无关,并且
是我在第一个答案中编辑的贴标机 windbg 扩展的各种实验,所以
我将其添加为新答案而不是编辑我的原始答案,
因为 AddSyntheticSymbol 的性能问题批量添加 出现了我编写了一个 6 位数的小 Windbg 脚本文件,我可以用它来测试性能
如果windbg可以在第一轮的11秒内添加500个符号,那么添加符号所需的时间似乎呈对数增加,
接下来的500
个需要13秒,第三轮500个符号需要16秒
我中断了测试当我添加第 20 轮符号时,加载符号 9500 到 10000 需要大约 50 秒
这是编写windbg脚本文件的小python脚本
buff = []
j=0
k=1
for i in range(0,100000,1):
j=j+1
buff.append("!label str_%s %08x 1 xul\n" % ( str(i).rjust(8,'0') , i ) )
if(j == 500):
buff.append("%s %d symbols added\n" % (".echotime;.echo ",j*k))
j = 0
k = k+1
with open ("lab100k.txt","w") as txt:
txt.writelines(buff)
这将创建一个包含 100200 个使用 !label extcmd 命令的文件
wc -l lab100k.txt
100200 lab100k.txt
grep -c echotime lab100k.txt
200
tail -n 3 lab100k.txt
!label str_00099998 0001869e 1 xul
!label str_00099999 0001869f 1 xul
.echotime;.echo 100000 symbols added
加载标签扩展并执行此windbg脚本并在标记10000地址后将其切断,时间范围如下
0:021> $$>a< lab100k.txt
Debugger (not debuggee) time: Tue Sep 22 23:58:52.053 2020
500 symbols added
Debugger (not debuggee) time: Tue Sep 22 23:59:03.468 2020
1000 symbols added
Debugger (not debuggee) time: Tue Sep 22 23:59:16.983 2020
1500 symbols added
Debugger (not debuggee) time: Tue Sep 22 23:59:32.546 2020
2000 symbols added
Debugger (not debuggee) time: Tue Sep 22 23:59:50.225 2020
2500 symbols added
Debugger (not debuggee) time: Wed Sep 23 00:00:10.133 2020
3000 symbols added
Debugger (not debuggee) time: Wed Sep 23 00:00:32.502 2020
3500 symbols added
Debugger (not debuggee) time: Wed Sep 23 00:00:57.303 2020
4000 symbols added
Debugger (not debuggee) time: Wed Sep 23 00:01:23.955 2020
4500 symbols added
Debugger (not debuggee) time: Wed Sep 23 00:01:52.593 2020
5000 symbols added
Debugger (not debuggee) time: Wed Sep 23 00:02:22.930 2020
5500 symbols added
Debugger (not debuggee) time: Wed Sep 23 00:02:55.546 2020
6000 symbols added
Debugger (not debuggee) time: Wed Sep 23 00:03:30.068 2020
6500 symbols added
Debugger (not debuggee) time: Wed Sep 23 00:04:06.521 2020
7000 symbols added
Debugger (not debuggee) time: Wed Sep 23 00:04:45.134 2020
7500 symbols added
Debugger (not debuggee) time: Wed Sep 23 00:05:25.709 2020
8000 symbols added
Debugger (not debuggee) time: Wed Sep 23 00:06:08.456 2020
8500 symbols added
Debugger (not debuggee) time: Wed Sep 23 00:06:53.301 2020
9000 symbols added
Debugger (not debuggee) time: Wed Sep 23 00:07:40.663 2020
9500 symbols added
Debugger (not debuggee) time: Wed Sep 23 00:08:29.967 2020
10000 symbols added
符号的结果如下
0:021> x xul!str_000100*
50462710 xul!str_00010000 = <no type information>
50462711 xul!str_00010001 = <no type information>
50462712 xul!str_00010002 = <no type information>
50462713 xul!str_00010003 = <no type information>
50462714 xul!str_00010004 = <no type information>
50462715 xul!str_00010005 = <no type information>
50462716 xul!str_00010006 = <no type information>
50462717 xul!str_00010007 = <no type information>
50462718 xul!str_00010008 = <no type information>
50462719 xul!str_00010009 = <no type information>
5046271a xul!str_00010010 = <no type information>
5046271b xul!str_00010011 = <no type information>
5046271c xul!str_00010012 = <no type information>
5046271d xul!str_00010013 = <no type information>
5046271e xul!str_00010014 = <no type information>
5046271f xul!str_00010015 = <no type information>
50462720 xul!str_00010016 = <no type information>
50462721 xul!str_00010017 = <no type information>
50462722 xul!str_00010018 = <no type information>
50462723 xul!str_00010019 = <no type information>
50462724 xul!str_00010020 = <no type information>
50462725 xul!str_00010021 = <no type information>
50462726 xul!str_00010022 = <no type information>
50462727 xul!str_00010023 = <no type information>
50462728 xul!str_00010024 = <no type information>
50462729 xul!str_00010025 = <no type information>
5046272a xul!str_00010026 = <no type information>
5046272b xul!str_00010027 = <no type information>
5046272c xul!str_00010028 = <no type information>