⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 leak-analyze

📁 radius协议源码÷The Radius Stack will connect to a Radius Server. This stack implementation is built upo
💻
字号:
#!/usr/bin/perl# (c) 1999 Erwin S. Andreasen <erwin@andreasen.org># Homepage: http://www.andreasen.org/LeakTracer/die "You must supply at least one argument.\n" unless $#ARGV >= 0;$ExeFile = shift @ARGV;$LeaksFile = $#ARGV >= 0 ? shift @ARGV : "leak.out";open (LEAKS, $LeaksFile) or die "Could not open leaks data file $LeaksFile: $!";if ($#ARGV >= 0) {    $BreakOn = shift @ARGV;    # Rest in @ARGV are program arguments}$n = $u = 0;while (<LEAKS>) {    chop;    #       1                2       3          4    if (/^\s*(0x)?[0-9a-f]+\s+(0x)?([0-9a-f]+)\s+(\d+)/) {        $addr = $3;        $u++ if not exists $Size{$addr};        $Size{$addr} += $4;        $Count{$addr}++;        $n++;    }}print STDERR "Gathered $n ($u unique) points of data.\n";close (LEAKS);open (PIPE, "|gdb -batch -n -q $ExeFile -x -") or die "Cannot start gdb";# Change set listsize 2 to something else to show more linesprint PIPE "set prompt\nset listsize 2\nset height 0\n";if (defined($BreakOn)) {    print PIPE "break $BreakOn\n";    print PIPE "run ", join(" ", @ARGV), " \n";}# Optionally, run the programforeach (sort keys %Size) {    print PIPE "echo \\nAllocations: $Count{$_} / Size: $Size{$_} $Comment{$_}\\n\nl \*0x$_\n";}if (defined($BreakOn)) {    print PIPE "kill\n";}close (PIPE);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -