leakview: simplified and comment

git-svn-id: trunk@44996 -
This commit is contained in:
mattias 2014-05-10 15:51:32 +00:00
parent 3d36d6f59e
commit fc63515eb0

View File

@ -330,36 +330,41 @@ begin
Result := False; Result := False;
s := TrimLeft(SubStr); s := TrimLeft(SubStr);
i := pos('#', s); if s='' then exit;
if (i = 1) or (pos('~"#', s) = 1) then begin
if (LeftStr(s,3) = '~"#') then begin
// gdb // gdb
// examples:
// ~"#0 DOHANDLEMOUSEACTION (this=0x14afae00, ANACTIONLIST=0x14a96af8,
// ANINFO=...) at synedit.pp:3000\n"
//
// #4 0x007489de in EXTTOOLEDITDLG_TEXTERNALTOOLMENUITEMS_$__LOAD$TCONFIGSTORAGE$$TMODALRESULT ()
i:=3;
Result := (i < Length(s)) and (s[i+1] in ['0'..'9']) and Result := (i < Length(s)) and (s[i+1] in ['0'..'9']) and
( (pos(' at ', s) > 1) or (pos(' from ', s) > 1) ); ( (pos(' at ', s) > 1) or (pos(' from ', s) > 1) );
Result := Result or CheckOnlyLineStart; Result := Result or CheckOnlyLineStart;
exit; end
end; else if LeftStr(s,4) = '0000' then begin // leave 3 digits for pos
if copy(s,1,4) = '0000' then begin // leave 3 digits for pos
// mantis mangled gdb ? // mantis mangled gdb ?
i := pos(':', s); i := pos(':', s);
Result := ( ((i > 1) and (i < Length(s)) and (s[i+1] in ['0'..'9'])) or Result := ( ((i > 1) and (i < Length(s)) and (s[i+1] in ['0'..'9'])) or
(pos(' in ', s) > 1) ) and (pos(' in ', s) > 1) ) and
( (pos(' at ', s) > 1) or (pos(' from ', s) > 1) ); ( (pos(' at ', s) > 1) or (pos(' from ', s) > 1) );
Result := Result or CheckOnlyLineStart; Result := Result or CheckOnlyLineStart;
exit; end else begin
// heaptrc line?
i := 1;
l := length(SubStr);
while (i <= l) and (SubStr[i] = ' ') do inc(i);
if (i > l) or (SubStr[i] <> '$') then exit;
inc(i);
while (i <= l) and
((SubStr[i] in ['0'..'9']) or ((SubStr[i] in ['A'..'F'])) or ((SubStr[i] in ['a'..'f'])))
do inc(i);
if (i > l) or (SubStr[i] <> ' ') then exit;
Result := (Pos('line', SubStr) > 0)
or CheckOnlyLineStart;
end; end;
// heaptrc line?
i := 1;
l := length(SubStr);
while (i <= l) and (SubStr[i] = ' ') do inc(i);
if (i > l) or (SubStr[i] <> '$') then exit;
inc(i);
while (i <= l) and
((SubStr[i] in ['0'..'9']) or ((SubStr[i] in ['A'..'F'])) or ((SubStr[i] in ['a'..'f'])))
do inc(i);
if (i > l) or (SubStr[i] <> ' ') then exit;
Result := Pos('line', SubStr) > 0;
Result := Result or CheckOnlyLineStart;
end; end;
function THeapTrcInfo.IsHeaderLine(const SubStr: string): Boolean; function THeapTrcInfo.IsHeaderLine(const SubStr: string): Boolean;