FPDebug: fix logging / verbose. Issue #0025188

git-svn-id: trunk@43247 -
This commit is contained in:
martin 2013-10-14 11:34:14 +00:00
parent 35ea619dab
commit d94a996d71

View File

@ -161,7 +161,6 @@ type
FDefinitions: array of TDwarfAbbrevEntry; FDefinitions: array of TDwarfAbbrevEntry;
function GetEntryPointer(AIndex: Integer): PDwarfAbbrevEntry; inline; function GetEntryPointer(AIndex: Integer): PDwarfAbbrevEntry; inline;
protected protected
FVerbose: Boolean;
procedure LoadAbbrevs(AnAbbrevDataPtr: Pointer); procedure LoadAbbrevs(AnAbbrevDataPtr: Pointer);
public public
constructor Create(AnAbbrData, AnAbbrDataEnd: Pointer; AnAbbrevOffset, AInfoLen: QWord); constructor Create(AnAbbrData, AnAbbrDataEnd: Pointer; AnAbbrevOffset, AInfoLen: QWord);
@ -1802,9 +1801,11 @@ var
abbrev, attrib, form: Cardinal; abbrev, attrib, form: Cardinal;
n: Integer; n: Integer;
CurAbbrevIndex: Integer; CurAbbrevIndex: Integer;
DbgVerbose: Boolean;
begin begin
abbrev := 0; abbrev := 0;
CurAbbrevIndex := 0; CurAbbrevIndex := 0;
DbgVerbose := (FPDBG_DWARF_VERBOSE <> nil) and (FPDBG_DWARF_VERBOSE^.Enabled);
while (pbyte(AnAbbrevDataPtr) < FAbbrDataEnd) and (pbyte(AnAbbrevDataPtr)^ <> 0) do while (pbyte(AnAbbrevDataPtr) < FAbbrDataEnd) and (pbyte(AnAbbrevDataPtr)^ <> 0) do
begin begin
@ -1824,7 +1825,7 @@ begin
Continue; Continue;
end; end;
if FVerbose if DbgVerbose
then begin then begin
DebugLn(FPDBG_DWARF_VERBOSE, [' abbrev: ', abbrev]); DebugLn(FPDBG_DWARF_VERBOSE, [' abbrev: ', abbrev]);
DebugLn(FPDBG_DWARF_VERBOSE, [' tag: ', Def.tag, '=', DwarfTagToString(Def.tag)]); DebugLn(FPDBG_DWARF_VERBOSE, [' tag: ', Def.tag, '=', DwarfTagToString(Def.tag)]);
@ -1846,7 +1847,7 @@ begin
FDefinitions[CurAbbrevIndex].Form := form; FDefinitions[CurAbbrevIndex].Form := form;
Inc(CurAbbrevIndex); Inc(CurAbbrevIndex);
if FVerbose if DbgVerbose
then DebugLn(FPDBG_DWARF_VERBOSE, [' [', n, '] attrib: ', attrib, '=', DwarfAttributeToString(attrib), ', form: ', form, '=', DwarfAttributeFormToString(form)]); then DebugLn(FPDBG_DWARF_VERBOSE, [' [', n, '] attrib: ', attrib, '=', DwarfAttributeToString(attrib), ', form: ', form, '=', DwarfAttributeFormToString(form)]);
Inc(n); Inc(n);
end; end;
@ -3363,7 +3364,6 @@ begin
FAbbrevList := TDwarfAbbrevList.Create(FOwner.FSections[dsAbbrev].RawData, FAbbrevList := TDwarfAbbrevList.Create(FOwner.FSections[dsAbbrev].RawData,
FOwner.FSections[dsAbbrev].RawData + FOwner.FSections[dsAbbrev].Size, FOwner.FSections[dsAbbrev].RawData + FOwner.FSections[dsAbbrev].Size,
FAbbrevOffset, FLength); FAbbrevOffset, FLength);
FAbbrevList.FVerbose := FVerbose;
// use internally 64 bit target pointer // use internally 64 bit target pointer
FAddressMap := TMap.Create(itu8, SizeOf(TDwarfAddressInfo)); FAddressMap := TMap.Create(itu8, SizeOf(TDwarfAddressInfo));