FpDebug: renamed dwarf classes, more unified names

git-svn-id: trunk@44624 -
This commit is contained in:
martin 2014-04-06 16:27:37 +00:00
parent bee933f2ab
commit 5df27a9624
5 changed files with 690 additions and 690 deletions

View File

@ -293,8 +293,8 @@ procedure TDbgInstance.LoadInfo;
begin begin
FLoader := InitializeLoader; FLoader := InitializeLoader;
assert(false, 'fpc will not compile this'); assert(false, 'fpc will not compile this');
FDbgInfo := TDbgDwarf.Create(FLoader); FDbgInfo := TFpDwarfInfo.Create(FLoader);
TDbgDwarf(FDbgInfo).LoadCompilationUnits; TFpDwarfInfo(FDbgInfo).LoadCompilationUnits;
end; end;
function TDbgInstance.RemoveBreak(const AFileName: String; ALine: Cardinal): Boolean; function TDbgInstance.RemoveBreak(const AFileName: String; ALine: Cardinal): Boolean;

File diff suppressed because it is too large Load Diff

View File

@ -56,7 +56,7 @@ const
); );
type type
TDbgDwarf = class; TFpDwarfInfo = class;
TDwarfCompilationUnit = class; TDwarfCompilationUnit = class;
{%region Dwarf Header Structures } {%region Dwarf Header Structures }
@ -436,7 +436,7 @@ type
class function HandleCompUnit(ACU: TDwarfCompilationUnit): Boolean; virtual; abstract; class function HandleCompUnit(ACU: TDwarfCompilationUnit): Boolean; virtual; abstract;
class function GetDwarfSymbolClass(ATag: Cardinal): TDbgDwarfSymbolBaseClass; virtual; abstract; class function GetDwarfSymbolClass(ATag: Cardinal): TDbgDwarfSymbolBaseClass; virtual; abstract;
class function CreateContext(AnAddress: TDbgPtr; ASymbol: TFpDbgSymbol; class function CreateContext(AnAddress: TDbgPtr; ASymbol: TFpDbgSymbol;
ADwarf: TDbgDwarf): TDbgInfoAddressContext; virtual; abstract; ADwarf: TFpDwarfInfo): TDbgInfoAddressContext; virtual; abstract;
class function CreateProcSymbol(ACompilationUnit: TDwarfCompilationUnit; class function CreateProcSymbol(ACompilationUnit: TDwarfCompilationUnit;
AInfo: PDwarfAddressInfo; AAddress: TDbgPtr): TDbgDwarfSymbolBase; virtual; abstract; AInfo: PDwarfAddressInfo; AAddress: TDbgPtr): TDbgDwarfSymbolBase; virtual; abstract;
end; end;
@ -460,7 +460,7 @@ type
TDwarfCompilationUnitClass = class of TDwarfCompilationUnit; TDwarfCompilationUnitClass = class of TDwarfCompilationUnit;
TDwarfCompilationUnit = class TDwarfCompilationUnit = class
private private
FOwner: TDbgDwarf; FOwner: TFpDwarfInfo;
FDwarfSymbolClassMap: TFpDwarfSymbolClassMapClass; FDwarfSymbolClassMap: TFpDwarfSymbolClassMapClass;
FValid: Boolean; // set if the compilationunit has compile unit tag. FValid: Boolean; // set if the compilationunit has compile unit tag.
@ -531,7 +531,7 @@ type
function ReadValue(AAttribute: Pointer; AForm: Cardinal; out AValue: TByteDynArray): Boolean; function ReadValue(AAttribute: Pointer; AForm: Cardinal; out AValue: TByteDynArray): Boolean;
public public
constructor Create(AOwner: TDbgDwarf; ADataOffset: QWord; ALength: QWord; AVersion: Word; AAbbrevOffset: QWord; AAddressSize: Byte; AIsDwarf64: Boolean); virtual; constructor Create(AOwner: TFpDwarfInfo; ADataOffset: QWord; ALength: QWord; AVersion: Word; AAbbrevOffset: QWord; AAddressSize: Byte; AIsDwarf64: Boolean); virtual;
destructor Destroy; override; destructor Destroy; override;
procedure ScanAllEntries; inline; procedure ScanAllEntries; inline;
function GetDefinition(AAbbrevPtr: Pointer; out ADefinition: TDwarfAbbrev): Boolean; inline; function GetDefinition(AAbbrevPtr: Pointer; out ADefinition: TDwarfAbbrev): Boolean; inline;
@ -549,7 +549,7 @@ type
//property AbbrevOffset: QWord read FAbbrevOffset; //property AbbrevOffset: QWord read FAbbrevOffset;
property AddressSize: Byte read FAddressSize; // the address size of the target in bytes property AddressSize: Byte read FAddressSize; // the address size of the target in bytes
property IsDwarf64: Boolean read FIsDwarf64; // Set if the dwarf info in this unit is 64bit property IsDwarf64: Boolean read FIsDwarf64; // Set if the dwarf info in this unit is 64bit
property Owner: TDbgDwarf read FOwner; property Owner: TFpDwarfInfo read FOwner;
property DwarfSymbolClassMap: TFpDwarfSymbolClassMapClass read FDwarfSymbolClassMap; property DwarfSymbolClassMap: TFpDwarfSymbolClassMapClass read FDwarfSymbolClassMap;
property FirstScope: TDwarfScopeInfo read FScope; property FirstScope: TDwarfScopeInfo read FScope;
@ -562,7 +562,7 @@ type
end; end;
{ TDbgDwarf } { TFpDwarfInfo }
TDwarfSectionInfo = record TDwarfSectionInfo = record
Section: TDwarfSection; Section: TDwarfSection;
@ -572,7 +572,7 @@ type
end; end;
PDwarfSectionInfo = ^TDwarfSectionInfo; PDwarfSectionInfo = ^TDwarfSectionInfo;
TDbgDwarf = class(TDbgInfo) TFpDwarfInfo = class(TDbgInfo)
private private
FCompilationUnits: TList; FCompilationUnits: TList;
FImageBase: QWord; FImageBase: QWord;
@ -2767,9 +2767,9 @@ begin
//DebugLn(['#### ',NextAFterHighestLine, ' / ',Count]); //DebugLn(['#### ',NextAFterHighestLine, ' / ',Count]);
end; end;
{ TDbgDwarf } { TFpDwarfInfo }
constructor TDbgDwarf.Create(ALoader: TDbgImageLoader); constructor TFpDwarfInfo.Create(ALoader: TDbgImageLoader);
var var
Section: TDwarfSection; Section: TDwarfSection;
p: PDbgImageSection; p: PDbgImageSection;
@ -2788,7 +2788,7 @@ begin
end; end;
end; end;
destructor TDbgDwarf.Destroy; destructor TFpDwarfInfo.Destroy;
var var
n: integer; n: integer;
begin begin
@ -2798,7 +2798,7 @@ begin
inherited Destroy; inherited Destroy;
end; end;
function TDbgDwarf.FindContext(AAddress: TDbgPtr): TDbgInfoAddressContext; function TFpDwarfInfo.FindContext(AAddress: TDbgPtr): TDbgInfoAddressContext;
var var
Proc: TDbgDwarfSymbolBase; Proc: TDbgDwarfSymbolBase;
begin begin
@ -2811,27 +2811,27 @@ begin
Proc.ReleaseReference; Proc.ReleaseReference;
end; end;
function TDbgDwarf.FindSymbol(AAddress: TDbgPtr): TFpDbgSymbol; function TFpDwarfInfo.FindSymbol(AAddress: TDbgPtr): TFpDbgSymbol;
begin begin
Result := FindProcSymbol(AAddress); Result := FindProcSymbol(AAddress);
end; end;
function TDbgDwarf.GetCompilationUnit(AIndex: Integer): TDwarfCompilationUnit; function TFpDwarfInfo.GetCompilationUnit(AIndex: Integer): TDwarfCompilationUnit;
begin begin
Result := TDwarfCompilationUnit(FCompilationUnits[Aindex]); Result := TDwarfCompilationUnit(FCompilationUnits[Aindex]);
end; end;
function TDbgDwarf.GetSections(AIndex: TDwarfSection): TDwarfSectionInfo; function TFpDwarfInfo.GetSections(AIndex: TDwarfSection): TDwarfSectionInfo;
begin begin
Result := FSections[AIndex]; Result := FSections[AIndex];
end; end;
function TDbgDwarf.GetCompilationUnitClass: TDwarfCompilationUnitClass; function TFpDwarfInfo.GetCompilationUnitClass: TDwarfCompilationUnitClass;
begin begin
Result := TDwarfCompilationUnit; Result := TDwarfCompilationUnit;
end; end;
function TDbgDwarf.FindCompilationUnitByOffs(AOffs: QWord): TDwarfCompilationUnit; function TFpDwarfInfo.FindCompilationUnitByOffs(AOffs: QWord): TDwarfCompilationUnit;
var var
l, h, m: Integer; l, h, m: Integer;
p: Pointer; p: Pointer;
@ -2852,7 +2852,7 @@ begin
Result := nil; Result := nil;
end; end;
function TDbgDwarf.FindProcSymbol(AAddress: TDbgPtr): TDbgDwarfSymbolBase; function TFpDwarfInfo.FindProcSymbol(AAddress: TDbgPtr): TDbgDwarfSymbolBase;
var var
n: Integer; n: Integer;
CU: TDwarfCompilationUnit; CU: TDwarfCompilationUnit;
@ -2910,7 +2910,7 @@ begin
end; end;
end; end;
function TDbgDwarf.GetLineAddress(const AFileName: String; ALine: Cardinal): TDbgPtr; function TFpDwarfInfo.GetLineAddress(const AFileName: String; ALine: Cardinal): TDbgPtr;
var var
n: Integer; n: Integer;
CU: TDwarfCompilationUnit; CU: TDwarfCompilationUnit;
@ -2924,7 +2924,7 @@ begin
Result := 0; Result := 0;
end; end;
function TDbgDwarf.GetLineAddressMap(const AFileName: String): PDWarfLineMap; function TFpDwarfInfo.GetLineAddressMap(const AFileName: String): PDWarfLineMap;
var var
n: Integer; n: Integer;
CU: TDwarfCompilationUnit; CU: TDwarfCompilationUnit;
@ -2939,7 +2939,7 @@ begin
Result := nil; Result := nil;
end; end;
function TDbgDwarf.LoadCompilationUnits: Integer; function TFpDwarfInfo.LoadCompilationUnits: Integer;
var var
p, pe: Pointer; p, pe: Pointer;
CU32: PDwarfCUHeader32 absolute p; CU32: PDwarfCUHeader32 absolute p;
@ -2986,17 +2986,17 @@ begin
Result := FCompilationUnits.Count; Result := FCompilationUnits.Count;
end; end;
function TDbgDwarf.PointerFromRVA(ARVA: QWord): Pointer; function TFpDwarfInfo.PointerFromRVA(ARVA: QWord): Pointer;
begin begin
Result := Pointer(PtrUInt(FImageBase + ARVA)); Result := Pointer(PtrUInt(FImageBase + ARVA));
end; end;
function TDbgDwarf.PointerFromVA(ASection: TDwarfSection; AVA: QWord): Pointer; function TFpDwarfInfo.PointerFromVA(ASection: TDwarfSection; AVA: QWord): Pointer;
begin begin
Result := FSections[ASection].RawData + AVA - FImageBase - FSections[ASection].VirtualAddress; Result := FSections[ASection].RawData + AVA - FImageBase - FSections[ASection].VirtualAddress;
end; end;
function TDbgDwarf.CompilationUnitsCount: Integer; function TFpDwarfInfo.CompilationUnitsCount: Integer;
begin begin
Result := FCompilationUnits.Count; Result := FCompilationUnits.Count;
end; end;
@ -3414,7 +3414,7 @@ begin
FAddressMapBuild := True; FAddressMapBuild := True;
end; end;
constructor TDwarfCompilationUnit.Create(AOwner: TDbgDwarf; ADataOffset: QWord; ALength: QWord; AVersion: Word; AAbbrevOffset: QWord; AAddressSize: Byte; AIsDwarf64: Boolean); constructor TDwarfCompilationUnit.Create(AOwner: TFpDwarfInfo; ADataOffset: QWord; ALength: QWord; AVersion: Word; AAbbrevOffset: QWord; AAddressSize: Byte; AIsDwarf64: Boolean);
procedure FillLineInfo(AData: Pointer); procedure FillLineInfo(AData: Pointer);
var var
LNP32: PDwarfLNPHeader32 absolute AData; LNP32: PDwarfLNPHeader32 absolute AData;

View File

@ -16,14 +16,14 @@ type
class function HandleCompUnit(ACU: TDwarfCompilationUnit): Boolean; override; class function HandleCompUnit(ACU: TDwarfCompilationUnit): Boolean; override;
//class function GetDwarfSymbolClass(ATag: Cardinal): TDbgDwarfSymbolBaseClass; override; //class function GetDwarfSymbolClass(ATag: Cardinal): TDbgDwarfSymbolBaseClass; override;
class function CreateContext(AnAddress: TDBGPtr; ASymbol: TFpDbgSymbol; class function CreateContext(AnAddress: TDBGPtr; ASymbol: TFpDbgSymbol;
ADwarf: TDbgDwarf): TDbgInfoAddressContext; override; ADwarf: TFpDwarfInfo): TDbgInfoAddressContext; override;
//class function CreateProcSymbol(ACompilationUnit: TDwarfCompilationUnit; //class function CreateProcSymbol(ACompilationUnit: TDwarfCompilationUnit;
// AInfo: PDwarfAddressInfo; AAddress: TDbgPtr): TDbgDwarfSymbolBase; override; // AInfo: PDwarfAddressInfo; AAddress: TDbgPtr): TDbgDwarfSymbolBase; override;
end; end;
{ TFpDwarfFreePascalAddressContext } { TFpDwarfFreePascalAddressContext }
TFpDwarfFreePascalAddressContext = class(TDbgDwarfInfoAddressContext) TFpDwarfFreePascalAddressContext = class(TFpDwarfInfoAddressContext)
protected protected
function FindLocalSymbol(const AName: String; PNameUpper, PNameLower: PChar; function FindLocalSymbol(const AName: String; PNameUpper, PNameLower: PChar;
InfoEntry: TDwarfInformationEntry): TFpDbgValue; override; InfoEntry: TDwarfInformationEntry): TFpDbgValue; override;
@ -43,7 +43,7 @@ begin
end; end;
class function TFpDwarfFreePascalSymbolClassMap.CreateContext(AnAddress: TDbgPtr; class function TFpDwarfFreePascalSymbolClassMap.CreateContext(AnAddress: TDbgPtr;
ASymbol: TFpDbgSymbol; ADwarf: TDbgDwarf): TDbgInfoAddressContext; ASymbol: TFpDbgSymbol; ADwarf: TFpDwarfInfo): TDbgInfoAddressContext;
begin begin
Result := TFpDwarfFreePascalAddressContext.Create(AnAddress, ASymbol, ADwarf); Result := TFpDwarfFreePascalAddressContext.Create(AnAddress, ASymbol, ADwarf);
end; end;

View File

@ -68,7 +68,7 @@ type
private private
FWatchEvalList: TList; FWatchEvalList: TList;
FImageLoader: TDbgImageLoader; FImageLoader: TDbgImageLoader;
FDwarfInfo: TDbgDwarf; FDwarfInfo: TFpDwarfInfo;
FPrettyPrinter: TFpPascalPrettyPrinter; FPrettyPrinter: TFpPascalPrettyPrinter;
FMemReader: TFpGDBMIDbgMemReader; FMemReader: TFpGDBMIDbgMemReader;
FMemManager: TFpDbgMemManager; FMemManager: TFpDbgMemManager;
@ -624,7 +624,7 @@ begin
{$ENDIF} {$ENDIF}
FMemManager := TFpDbgMemManager.Create(FMemReader, TFpDbgMemConvertorLittleEndian.Create); FMemManager := TFpDbgMemManager.Create(FMemReader, TFpDbgMemConvertorLittleEndian.Create);
FDwarfInfo := TDbgDwarf.Create(FImageLoader); FDwarfInfo := TFpDwarfInfo.Create(FImageLoader);
FDwarfInfo.MemManager := FMemManager; FDwarfInfo.MemManager := FMemManager;
FDwarfInfo.LoadCompilationUnits; FDwarfInfo.LoadCompilationUnits;
FPrettyPrinter := TFpPascalPrettyPrinter.Create(SizeOf(Pointer)); FPrettyPrinter := TFpPascalPrettyPrinter.Create(SizeOf(Pointer));
@ -788,7 +788,7 @@ begin
end; end;
type type
TGDBMIDwarfTypeIdentifier = class(TDbgDwarfTypeIdentifier) TGDBMIDwarfTypeIdentifier = class(TFpDwarfSymbolType)
public public
property InformationEntry; property InformationEntry;
end; end;