mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-21 23:19:29 +02:00
Debugger: put some common types into DbgIntf
git-svn-id: trunk@44079 -
This commit is contained in:
parent
4ec00361b1
commit
3f415797e4
@ -12,8 +12,54 @@ uses
|
||||
Classes, SysUtils;
|
||||
|
||||
type
|
||||
// datatype pointing to data on the target
|
||||
TDBGPtr = QWord;
|
||||
(* TDBGPtr
|
||||
datatype pointing to data on the target
|
||||
*)
|
||||
TDBGPtr = type QWord;
|
||||
|
||||
(* TDbgSymbolKind
|
||||
Enum of types that a value can have.
|
||||
*)
|
||||
|
||||
TDbgSymbolKind = (
|
||||
skNone, // undefined type
|
||||
//skType // Not a value, but a type description
|
||||
//skUser, // userdefined type, this sym refers to another sym defined elswhere
|
||||
//--------------------------------------------------------------------------
|
||||
skInstance, // the main exe/dll, containing all other syms
|
||||
skUnit, // contains syms defined in this unit
|
||||
skProcedure, // an actual procedure, with an address // NOT just the type of a procedure
|
||||
skFunction,
|
||||
//--------------------------------------------------------------------------
|
||||
//----------------- Basic types, these cannot have references or children
|
||||
skSimple, // Any of the below (in this group), the dbg does not know more detailed
|
||||
skPointer,
|
||||
skInteger,
|
||||
skCardinal,
|
||||
skBoolean,
|
||||
skChar,
|
||||
skFloat,
|
||||
skString,
|
||||
skAnsiString,
|
||||
skCurrency,
|
||||
skVariant,
|
||||
skWideString,
|
||||
//--------------------------------------------------------------------------
|
||||
skEnum, // Variable holding an enum / enum type
|
||||
skEnumValue, // a single element from an enum
|
||||
skSet,
|
||||
//--------------------------------------------------------------------------
|
||||
skRecord, // the address member is the relative location within the
|
||||
skObject, // structure: type TFoo=object end; // may also be reported as record
|
||||
skClass,
|
||||
skInterface,
|
||||
//--------------------------------------------------------------------------
|
||||
skArray,
|
||||
//--------------------------------------------------------------------------
|
||||
skRegister // the Address member is the register number
|
||||
//--------------------------------------------------------------------------
|
||||
);
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
|
@ -36,7 +36,7 @@ Provides an interface to add debuggers to the IDE"/>
|
||||
<UnitName Value="DbgIntfMiscClasses"/>
|
||||
</Item3>
|
||||
</Files>
|
||||
<Type Value="DesignTime"/>
|
||||
<Type Value="RunAndDesignTime"/>
|
||||
<RequiredPkgs Count="2">
|
||||
<Item1>
|
||||
<PackageName Value="LazUtils"/>
|
||||
|
@ -36,7 +36,7 @@ unit FPDCommand;
|
||||
interface
|
||||
|
||||
uses
|
||||
SysUtils, Classes, Windows, LCLProc, FpDbgWinExtra, FpDbgInfo, FpDbgClasses, FpdMemoryTools;
|
||||
SysUtils, Classes, Windows, LCLProc, FpDbgWinExtra, FpDbgInfo, FpDbgClasses, DbgIntfBaseTypes;
|
||||
|
||||
procedure HandleCommand(ACommand: String);
|
||||
|
||||
|
@ -38,7 +38,7 @@ interface
|
||||
|
||||
uses
|
||||
Windows, Classes, SysUtils, FileUtil, FpDbgInfo, FpDbgClasses, FpDbgWinExtra, FpDbgDisasX86,
|
||||
FpDbgWinClasses, FpdMemoryTools;
|
||||
FpDbgWinClasses, DbgIntfBaseTypes, FpdMemoryTools;
|
||||
|
||||
procedure DebugLoop;
|
||||
|
||||
|
@ -37,7 +37,7 @@ unit FPDPEImage;
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, SysUtils, FPDGLobal, FpDbgInfo, FpDbgClasses, FpDbgPETypes, FpdMemoryTools;
|
||||
Windows, SysUtils, FPDGLobal, FpDbgInfo, FpDbgClasses, FpDbgPETypes, DbgIntfBaseTypes;
|
||||
|
||||
procedure DumpPEImage(const AProcessHandle: THandle; const AAddress: TDbgPtr);
|
||||
|
||||
|
@ -38,7 +38,7 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, Maps, FpDbgDwarf, FpDbgUtil, FpDbgWinExtra, FpDbgLoader,
|
||||
FpDbgInfo, FpdMemoryTools, LazLoggerBase, LazClasses;
|
||||
FpDbgInfo, FpdMemoryTools, LazLoggerBase, LazClasses, DbgIntfBaseTypes;
|
||||
|
||||
type
|
||||
TDbgProcess = class;
|
||||
|
@ -43,7 +43,7 @@ uses
|
||||
{$ifdef windows}
|
||||
Windows,
|
||||
{$endif}
|
||||
FpDbgUtil, FpDbgInfo, FpdMemoryTools;
|
||||
FpDbgUtil, FpDbgInfo, DbgIntfBaseTypes, FpdMemoryTools;
|
||||
|
||||
{
|
||||
The function Disassemble decodes the instruction at the given address.
|
||||
|
@ -43,7 +43,7 @@ interface
|
||||
uses
|
||||
Classes, Types, SysUtils, FpDbgUtil, FpDbgInfo, FpDbgDwarfConst, Maps, Math,
|
||||
FpDbgLoader, FpImgReaderBase, FpdMemoryTools, LazLoggerBase, // LazLoggerDummy,
|
||||
LazClasses, LazFileUtils, LazUTF8, contnrs;
|
||||
LazClasses, LazFileUtils, LazUTF8, contnrs, DbgIntfBaseTypes;
|
||||
|
||||
type
|
||||
// compilation unit header
|
||||
|
@ -5,7 +5,7 @@ unit FpDbgInfo;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FpDbgLoader, FpdMemoryTools, LazLoggerBase, LazClasses;
|
||||
Classes, SysUtils, DbgIntfBaseTypes, FpDbgLoader, FpdMemoryTools, LazLoggerBase, LazClasses;
|
||||
|
||||
type
|
||||
{ TFpDbgCircularRefCountedObject }
|
||||
@ -45,40 +45,6 @@ type
|
||||
stType // The Symbol is a type (including proc/func declaration / without DW_AT_low_pc)
|
||||
);
|
||||
|
||||
TDbgSymbolKind = (
|
||||
skNone, // undefined type
|
||||
// skUser, // userdefined type, this sym refers to another sym defined elswhere
|
||||
skInstance, // the main exe/dll, containing all other syms
|
||||
skUnit, // contains syms defined in this unit
|
||||
//--------------------------------------------------------------------------
|
||||
skRecord, // the address member is the relative location within the
|
||||
skObject, // structure: type TFoo=object end;
|
||||
skClass,
|
||||
skInterface,
|
||||
skProcedure,
|
||||
skFunction,
|
||||
//--------------------------------------------------------------------------
|
||||
skArray,
|
||||
//--------------------------------------------------------------------------
|
||||
skPointer,
|
||||
skInteger, // Basic types, these cannot have references or children
|
||||
skCardinal, // only size matters ( char(1) = Char, char(2) = WideChar
|
||||
skBoolean, // cardinal(1) = Byte etc.
|
||||
skChar,
|
||||
skFloat,
|
||||
skString,
|
||||
skAnsiString,
|
||||
skCurrency,
|
||||
skVariant,
|
||||
skWideString,
|
||||
skEnum, // Variable holding an enum / enum type
|
||||
skEnumValue, // a single element from an enum
|
||||
skSet,
|
||||
//--------------------------------------------------------------------------
|
||||
skRegister // the Address member is the register number
|
||||
//--------------------------------------------------------------------------
|
||||
);
|
||||
|
||||
TDbgSymbolMemberVisibility =(
|
||||
svPrivate,
|
||||
svProtected,
|
||||
|
@ -46,6 +46,7 @@ uses
|
||||
FpDbgWinExtra,
|
||||
FpDbgInfo,
|
||||
FpDbgLoader, FpdMemoryTools,
|
||||
DbgIntfBaseTypes,
|
||||
LazLoggerBase;
|
||||
|
||||
type
|
||||
|
@ -118,17 +118,20 @@ File(s) with other licenses (see also header in file(s):
|
||||
</Item20>
|
||||
<Item21>
|
||||
<Filename Value="fpdmemorytools.pas"/>
|
||||
<UnitName Value="fpdmemorytools"/>
|
||||
<UnitName Value="FpdMemoryTools"/>
|
||||
</Item21>
|
||||
</Files>
|
||||
<Type Value="RunAndDesignTime"/>
|
||||
<RequiredPkgs Count="2">
|
||||
<RequiredPkgs Count="3">
|
||||
<Item1>
|
||||
<PackageName Value="LCLBase"/>
|
||||
<PackageName Value="DebuggerIntf"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="FCL"/>
|
||||
<PackageName Value="LCLBase"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<PackageName Value="FCL"/>
|
||||
</Item3>
|
||||
</RequiredPkgs>
|
||||
<UsageOptions>
|
||||
<UnitPath Value="$(PkgOutDir)"/>
|
||||
|
@ -24,10 +24,9 @@ unit FpdMemoryTools;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, math;
|
||||
Classes, SysUtils, math, DbgIntfBaseTypes;
|
||||
|
||||
type
|
||||
TDbgPtr = QWord; // TODO, use from IdeDebuggerInterface, once that is done.
|
||||
|
||||
TFpDbgMemReaderBase = class
|
||||
public
|
||||
|
@ -5,7 +5,7 @@ unit FpPascalBuilder;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FpDbgInfo;
|
||||
Classes, SysUtils, DbgIntfBaseTypes, FpDbgInfo;
|
||||
|
||||
type
|
||||
TTypeNameFlag = (
|
||||
|
@ -29,7 +29,7 @@ unit FpPascalParser;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, sysutils, math, FpDbgInfo, FpdMemoryTools, LazLoggerBase, LazClasses;
|
||||
Classes, sysutils, math, DbgIntfBaseTypes, FpDbgInfo, FpdMemoryTools, LazLoggerBase, LazClasses;
|
||||
|
||||
type
|
||||
|
||||
|
@ -3,7 +3,7 @@ program FpTest;
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
Interfaces, Forms, GuiTestRunner, TestPascalParser, TestTypeInfo, TestHelperClasses,
|
||||
Interfaces, Forms, GuiTestRunner, TestTypeInfo, TestHelperClasses,
|
||||
TestDwarfSetup1, TestDwarfSetupBasic, TestDwarfVarious, testdwarfsetupArray, TestMemManager;
|
||||
|
||||
{$R *.res}
|
||||
|
@ -5,7 +5,8 @@ unit TestHelperClasses;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FpImgReaderBase, FpDbgDwarfConst, FpDbgLoader, FpDbgInfo, FpdMemoryTools;
|
||||
Classes, SysUtils, FpImgReaderBase, FpDbgDwarfConst, FpDbgLoader, FpDbgInfo,
|
||||
DbgIntfBaseTypes, FpdMemoryTools;
|
||||
|
||||
const
|
||||
TestAddrSize = sizeof(Pointer);
|
||||
|
@ -5,8 +5,8 @@ unit TestMemManager;
|
||||
interface
|
||||
|
||||
uses
|
||||
FpDbgDwarf, FpDbgUtil, FpdMemoryTools, TestHelperClasses, LazLoggerBase, LazUTF8, sysutils,
|
||||
fpcunit, testregistry;
|
||||
FpDbgDwarf, FpDbgUtil, FpdMemoryTools, TestHelperClasses, LazLoggerBase, LazUTF8,
|
||||
DbgIntfBaseTypes, sysutils, fpcunit, testregistry;
|
||||
|
||||
type
|
||||
|
||||
|
@ -7,7 +7,7 @@ interface
|
||||
uses
|
||||
FpPascalParser, FpDbgDwarf, FpDbgInfo, FpdMemoryTools, LazLoggerBase, LazUTF8, sysutils,
|
||||
fpcunit, testregistry, TestHelperClasses, TestDwarfSetup1, TestDwarfSetupBasic,
|
||||
TestDwarfSetupArray;
|
||||
DbgIntfBaseTypes, TestDwarfSetupArray;
|
||||
|
||||
|
||||
type
|
||||
|
@ -6,7 +6,7 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, Forms, Controls, Graphics,
|
||||
IDEWindowIntf,
|
||||
IDEWindowIntf, DbgIntfBaseTypes,
|
||||
ComCtrls, StdCtrls, ExtCtrls, LclType, LCLIntf, DebuggerDlg, Debugger,
|
||||
BaseDebugManager, EditorOptions, Math, types, LCLProc, Menus, Clipbrd, ActnList,
|
||||
IDECommands, IDEImagesIntf, CodeToolManager, CodeCache, SourceEditor;
|
||||
|
@ -38,12 +38,10 @@ unit Debugger;
|
||||
interface
|
||||
|
||||
uses
|
||||
TypInfo, Classes, SysUtils, Laz2_XMLCfg, math, FileUtil, LazLoggerBase, LazClasses,
|
||||
DbgIntfBaseTypes, DbgIntfMiscClasses, TypInfo, Classes, SysUtils, Laz2_XMLCfg, math, FileUtil, LazLoggerBase, LazClasses,
|
||||
LCLProc, LazConfigStorage, DebugUtils, maps, contnrs;
|
||||
|
||||
type
|
||||
// datatype pointing to data on the target
|
||||
TDBGPtr = DebugUtils.TDBGPtr;
|
||||
|
||||
TDBGLocationRec = record
|
||||
Address: TDBGPtr;
|
||||
@ -221,21 +219,6 @@ type
|
||||
published
|
||||
end;
|
||||
|
||||
{ TRefCountedColectionItem }
|
||||
|
||||
TRefCountedColectionItem = class(TDelayedUdateItem)
|
||||
public
|
||||
constructor Create(ACollection: TCollection); override;
|
||||
destructor Destroy; override;
|
||||
procedure AddReference;
|
||||
procedure ReleaseReference;
|
||||
private
|
||||
FRefCount: Integer;
|
||||
protected
|
||||
procedure DoFree; virtual;
|
||||
property RefCount: Integer read FRefCount;
|
||||
end;
|
||||
|
||||
procedure ReleaseRefAndNil(var ARefCountedObject);
|
||||
|
||||
type
|
||||
@ -919,7 +902,6 @@ type
|
||||
(******************************************************************************)
|
||||
|
||||
type
|
||||
TDBGSymbolKind = (skClass, skRecord, skEnum, skSet, skProcedure, skFunction, skSimple, skPointer, skVariant);
|
||||
TDBGSymbolAttribute = (saRefParam, // var, const, constref passed by reference
|
||||
saInternalPointer, // PointerToObject
|
||||
saArray, saDynArray
|
||||
@ -6191,38 +6173,6 @@ begin
|
||||
//
|
||||
end;
|
||||
|
||||
{ =========================================================================== }
|
||||
{ TRefCountedColectionItem }
|
||||
|
||||
constructor TRefCountedColectionItem.Create(ACollection: TCollection);
|
||||
begin
|
||||
FRefCount := 0;
|
||||
inherited Create(ACollection);
|
||||
end;
|
||||
|
||||
destructor TRefCountedColectionItem.Destroy;
|
||||
begin
|
||||
Assert(FRefcount = 0, 'Destroying referenced object');
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
procedure TRefCountedColectionItem.AddReference;
|
||||
begin
|
||||
Inc(FRefcount);
|
||||
end;
|
||||
|
||||
procedure TRefCountedColectionItem.ReleaseReference;
|
||||
begin
|
||||
Assert(FRefCount > 0, 'TRefCountedObject.ReleaseReference RefCount > 0');
|
||||
Dec(FRefCount);
|
||||
if FRefCount = 0 then DoFree;
|
||||
end;
|
||||
|
||||
procedure TRefCountedColectionItem.DoFree;
|
||||
begin
|
||||
Self.Free;
|
||||
end;
|
||||
|
||||
(******************************************************************************)
|
||||
(******************************************************************************)
|
||||
(** **)
|
||||
|
@ -35,31 +35,10 @@ unit DebugUtils;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, LCLProc;
|
||||
DbgIntfBaseTypes, Classes, LCLProc;
|
||||
|
||||
type
|
||||
|
||||
TDBGPtr = type QWord;
|
||||
|
||||
{ TDelayedUdateItem }
|
||||
|
||||
TDelayedUdateItem = class(TCollectionItem)
|
||||
private
|
||||
FUpdateCount: Integer;
|
||||
FDoChanged: Boolean;
|
||||
protected
|
||||
procedure Changed;
|
||||
procedure DoChanged; virtual;
|
||||
procedure DoEndUpdate; virtual; // even if not changed
|
||||
public
|
||||
procedure Assign(ASource: TPersistent); override;
|
||||
procedure BeginUpdate;
|
||||
constructor Create(ACollection: TCollection); override;
|
||||
procedure EndUpdate;
|
||||
function IsUpdating: Boolean;
|
||||
end;
|
||||
|
||||
|
||||
TPCharWithLen = record
|
||||
Ptr: PChar;
|
||||
Len: Integer;
|
||||
@ -523,66 +502,6 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
|
||||
{ TDelayedUdateItem }
|
||||
|
||||
procedure TDelayedUdateItem.Assign(ASource: TPersistent);
|
||||
begin
|
||||
BeginUpdate;
|
||||
try
|
||||
inherited Assign(ASource);
|
||||
finally
|
||||
EndUpdate;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TDelayedUdateItem.BeginUpdate;
|
||||
begin
|
||||
Inc(FUpdateCount);
|
||||
if FUpdateCount = 1 then FDoChanged := False;
|
||||
end;
|
||||
|
||||
procedure TDelayedUdateItem.Changed;
|
||||
begin
|
||||
if FUpdateCount > 0
|
||||
then FDoChanged := True
|
||||
else DoChanged;
|
||||
end;
|
||||
|
||||
constructor TDelayedUdateItem.Create(ACollection: TCollection);
|
||||
begin
|
||||
inherited Create(ACollection);
|
||||
FUpdateCount := 0;
|
||||
end;
|
||||
|
||||
procedure TDelayedUdateItem.DoChanged;
|
||||
begin
|
||||
inherited Changed(False);
|
||||
end;
|
||||
|
||||
procedure TDelayedUdateItem.DoEndUpdate;
|
||||
begin
|
||||
//
|
||||
end;
|
||||
|
||||
procedure TDelayedUdateItem.EndUpdate;
|
||||
begin
|
||||
Dec(FUpdateCount);
|
||||
if FUpdateCount < 0 then raise EInvalidOperation.Create('TDelayedUdateItem.EndUpdate');
|
||||
if (FUpdateCount = 0)
|
||||
then DoEndUpdate;
|
||||
if (FUpdateCount = 0) and FDoChanged
|
||||
then begin
|
||||
DoChanged;
|
||||
FDoChanged := False;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TDelayedUdateItem.IsUpdating: Boolean;
|
||||
begin
|
||||
Result := FUpdateCount > 0;
|
||||
end;
|
||||
|
||||
initialization
|
||||
LastSmartWritelnCount:=0;
|
||||
|
||||
|
@ -9,7 +9,8 @@ unit FpGdbmiDebugger;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, {$IFdef MSWindows}windows,{$ENDIF} sysutils, math, FpdMemoryTools, FpDbgInfo, FpDbgClasses, GDBMIDebugger, BaseDebugManager,
|
||||
Classes, {$IFdef MSWindows}windows,{$ENDIF} sysutils, math, FpdMemoryTools,
|
||||
FpDbgInfo, FpDbgClasses, GDBMIDebugger, BaseDebugManager, DbgIntfBaseTypes,
|
||||
Debugger, GDBMIMiscClasses, GDBTypeInfo, maps, LCLProc, Forms, FpDbgLoader, FpDbgDwarf,
|
||||
FpDbgDwarfConst, LazLoggerBase, LazLoggerProfiling, FpPascalParser, FpPascalBuilder;
|
||||
|
||||
@ -27,9 +28,9 @@ type
|
||||
FDebugger: TFpGDBMIDebugger;
|
||||
public
|
||||
constructor Create(ADebugger: TFpGDBMIDebugger);
|
||||
function ReadMemory(AnAddress: FpdMemoryTools.TDbgPtr; ASize: Cardinal; ADest: Pointer): Boolean; override;
|
||||
function ReadMemoryEx(AnAddress, AnAddressSpace: FpdMemoryTools.TDbgPtr; ASize: Cardinal; ADest: Pointer): Boolean; override;
|
||||
function ReadRegister(ARegNum: Cardinal; out AValue: FpdMemoryTools.TDbgPtr): Boolean; override;
|
||||
function ReadMemory(AnAddress: TDbgPtr; ASize: Cardinal; ADest: Pointer): Boolean; override;
|
||||
function ReadMemoryEx(AnAddress, AnAddressSpace: TDbgPtr; ASize: Cardinal; ADest: Pointer): Boolean; override;
|
||||
function ReadRegister(ARegNum: Cardinal; out AValue: TDbgPtr): Boolean; override;
|
||||
function RegisterSize(ARegNum: Cardinal): Integer; override;
|
||||
end;
|
||||
|
||||
@ -40,7 +41,7 @@ type
|
||||
hProcess: THandle;
|
||||
public
|
||||
destructor Destroy; override;
|
||||
function ReadMemory(AnAddress: FpdMemoryTools.TDbgPtr; ASize: Cardinal; ADest: Pointer): Boolean; override;
|
||||
function ReadMemory(AnAddress: TDbgPtr; ASize: Cardinal; ADest: Pointer): Boolean; override;
|
||||
//function ReadRegister(ARegNum: Integer; out AValue: TDbgPtr): Boolean; override;
|
||||
procedure OpenProcess(APid: Cardinal);
|
||||
procedure CloseProcess;
|
||||
@ -148,7 +149,7 @@ begin
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
function TFpGDBMIAndWin32DbgMemReader.ReadMemory(AnAddress: FpdMemoryTools.TDbgPtr;
|
||||
function TFpGDBMIAndWin32DbgMemReader.ReadMemory(AnAddress: TDbgPtr;
|
||||
ASize: Cardinal; ADest: Pointer): Boolean;
|
||||
var
|
||||
BytesRead: Cardinal;
|
||||
@ -192,7 +193,7 @@ end;
|
||||
|
||||
type TGDBMIDebuggerCommandHack = class(TGDBMIDebuggerCommand) end;
|
||||
|
||||
function TFpGDBMIDbgMemReader.ReadMemory(AnAddress: FpdMemoryTools.TDbgPtr; ASize: Cardinal;
|
||||
function TFpGDBMIDbgMemReader.ReadMemory(AnAddress: TDbgPtr; ASize: Cardinal;
|
||||
ADest: Pointer): Boolean;
|
||||
var
|
||||
cmd: TGDBMIDebuggerCommandHack;
|
||||
@ -223,14 +224,14 @@ begin
|
||||
debugln(['TFpGDBMIDbgMemReader.ReadMemory ', dbgs(AnAddress), ' ', dbgMemRange(ADest, ASize)]);
|
||||
end;
|
||||
|
||||
function TFpGDBMIDbgMemReader.ReadMemoryEx(AnAddress, AnAddressSpace: FpdMemoryTools.TDbgPtr;
|
||||
function TFpGDBMIDbgMemReader.ReadMemoryEx(AnAddress, AnAddressSpace: TDbgPtr;
|
||||
ASize: Cardinal; ADest: Pointer): Boolean;
|
||||
begin
|
||||
Result := False;
|
||||
end;
|
||||
|
||||
function TFpGDBMIDbgMemReader.ReadRegister(ARegNum: Cardinal; out
|
||||
AValue: FpdMemoryTools.TDbgPtr): Boolean;
|
||||
AValue: TDbgPtr): Boolean;
|
||||
var
|
||||
rname: String;
|
||||
v: String;
|
||||
@ -301,7 +302,7 @@ const
|
||||
ADeRefTypeName := '';
|
||||
ABaseTypeName := ABaseType.Name;
|
||||
|
||||
while (ABaseType.Kind = FpDbgInfo.skPointer) and (ABaseType.TypeInfo <> nil) do begin
|
||||
while (ABaseType.Kind = skPointer) and (ABaseType.TypeInfo <> nil) do begin
|
||||
ABaseType := ABaseType.TypeInfo;
|
||||
inc(APointerLevel);
|
||||
|
||||
@ -345,7 +346,7 @@ const
|
||||
begin
|
||||
//todo: functions / virtual / array ...
|
||||
s2 := '';
|
||||
if AMember.Kind = FpDbgInfo.skProcedure then begin
|
||||
if AMember.Kind = skProcedure then begin
|
||||
if sfVirtual in AMember.Flags then s2 := ' virtual;';
|
||||
AText := AText + ' procedure ' + AMember.Name + ' ();' + s2 + LineEnding;
|
||||
exit
|
||||
@ -359,9 +360,9 @@ const
|
||||
|
||||
s := ti.Name;
|
||||
if s = '' then begin
|
||||
if not( (AMember.Kind = FpDbgInfo.skSet) or (AMember.Kind = FpDbgInfo.skEnum) or
|
||||
(AMember.Kind = FpDbgInfo.skArray) or (AMember.Kind = FpDbgInfo.skPointer) or
|
||||
(AMember.Kind = FpDbgInfo.skRecord)
|
||||
if not( (AMember.Kind = skSet) or (AMember.Kind = skEnum) or
|
||||
(AMember.Kind = skArray) or (AMember.Kind = skPointer) or
|
||||
(AMember.Kind = skRecord)
|
||||
)
|
||||
then begin
|
||||
Result := False;
|
||||
@ -373,7 +374,7 @@ const
|
||||
end
|
||||
end;
|
||||
|
||||
if AMember.Kind = FpDbgInfo.skFunction then begin
|
||||
if AMember.Kind = skFunction then begin
|
||||
if sfVirtual in AMember.Flags then s2 := ' virtual;';
|
||||
AText := AText + ' function ' + AMember.Name + ' () : '+s+';' + s2 + LineEnding;
|
||||
end
|
||||
@ -693,7 +694,7 @@ const
|
||||
if (AVal <> nil) and (ATypeIdent.Kind = skBoolean) then
|
||||
MaybeAdd(gcrtEvalExpr, GdbCmdEval + ASourceExpr, Format(',value="%s"', [dbgs(AVal.AsBool)]))
|
||||
else
|
||||
if (AVal <> nil) and (ATypeIdent.Kind = FpDbgInfo.skPointer) then
|
||||
if (AVal <> nil) and (ATypeIdent.Kind = skPointer) then
|
||||
MaybeAdd(gcrtEvalExpr, GdbCmdEval + ASourceExpr, Format(',value="%u"', [AVal.AsCardinal]))
|
||||
;
|
||||
end;
|
||||
@ -701,28 +702,28 @@ const
|
||||
AddBaseType(ASourceExpr, PointerLevel,
|
||||
SrcTypeName, DeRefTypeName, BaseTypeName,
|
||||
ATypeIdent, BaseType);
|
||||
FpDbgInfo.skClass:
|
||||
skClass:
|
||||
AddClassType(ASourceExpr, PointerLevel,
|
||||
SrcTypeName, DeRefTypeName, BaseTypeName,
|
||||
ATypeIdent, BaseType);
|
||||
FpDbgInfo.skRecord:
|
||||
skRecord:
|
||||
AddRecordType(ASourceExpr, PointerLevel,
|
||||
SrcTypeName, DeRefTypeName, BaseTypeName,
|
||||
ATypeIdent, BaseType);
|
||||
FpDbgInfo.skEnum: begin
|
||||
skEnum: begin
|
||||
AddEnumType(ASourceExpr, PointerLevel,
|
||||
SrcTypeName, DeRefTypeName, BaseTypeName,
|
||||
ATypeIdent, BaseType);
|
||||
if (AVal <> nil) and (ATypeIdent.Kind = FpDbgInfo.skEnum) then
|
||||
if (AVal <> nil) and (ATypeIdent.Kind = skEnum) then
|
||||
if AVal.AsString = ''
|
||||
then MaybeAdd(gcrtEvalExpr, GdbCmdEval + ASourceExpr, Format(',value="%u"', [AVal.AsCardinal]))
|
||||
else MaybeAdd(gcrtEvalExpr, GdbCmdEval + ASourceExpr, Format(',value="%s"', [AVal.AsString]));
|
||||
end;
|
||||
FpDbgInfo.skSet: begin
|
||||
skSet: begin
|
||||
AddSetType(ASourceExpr, PointerLevel,
|
||||
SrcTypeName, DeRefTypeName, BaseTypeName,
|
||||
ATypeIdent, BaseType);
|
||||
if (AVal <> nil) and (ATypeIdent.Kind = FpDbgInfo.skSet) then begin
|
||||
if (AVal <> nil) and (ATypeIdent.Kind = skSet) then begin
|
||||
s := '';
|
||||
for i := 0 to AVal.MemberCount-1 do
|
||||
if i = 0
|
||||
@ -731,7 +732,7 @@ const
|
||||
MaybeAdd(gcrtEvalExpr, GdbCmdEval + ASourceExpr, Format(',value="[%s]"', [s]))
|
||||
end;
|
||||
end;
|
||||
FpDbgInfo.skArray:
|
||||
skArray:
|
||||
AddArrayType(ASourceExpr, PointerLevel,
|
||||
SrcTypeName, DeRefTypeName, BaseTypeName,
|
||||
ATypeIdent, BaseType);
|
||||
@ -767,7 +768,7 @@ DebugLn(['######## '+ARequest.Request, ' ## FOUND: ', dbgs(Result)]);
|
||||
if PasExpr.Valid and (PasExpr.ResultValue <> nil) then begin
|
||||
rt := PasExpr.ResultValue.DbgSymbol; // value or typecast
|
||||
if rt <> nil then debugln(['@@@@@ ',rt.ClassName, ' ADDR=', dbgs(rt.Address)]);
|
||||
DebugLn(['== VAL === ', PasExpr.ResultValue.AsInteger, ' / ', PasExpr.ResultValue.AsCardinal, ' / ', PasExpr.ResultValue.AsBool, ' / ', PasExpr.ResultValue.AsString, ' / ', PasExpr.ResultValue.MemberCount]);
|
||||
DebugLn(['== VAL === ', PasExpr.ResultValue.AsInteger, ' / ', PasExpr.ResultValue.AsCardinal, ' / ', PasExpr.ResultValue.AsBool, ' / ', PasExpr.ResultValue.AsString, ' / ', PasExpr.ResultValue.MemberCount, ' / ', PasExpr.ResultValue.AsFloat]);
|
||||
|
||||
if (rt <> nil) and (rt is TDbgDwarfValueIdentifier) then begin
|
||||
// symbol is value
|
||||
|
@ -41,7 +41,7 @@ interface
|
||||
uses
|
||||
Classes, SysUtils, strutils, Controls, Math, Variants, LCLProc, LazClasses, LazLoggerBase,
|
||||
Dialogs, DebugUtils, Debugger, FileUtil, LazLoggerProfiling, BaseIDEIntf, CmdLineDebugger,
|
||||
GDBTypeInfo, Maps, GDBMIDebugInstructions, LCLIntf, Forms,
|
||||
DbgIntfBaseTypes, GDBTypeInfo, Maps, GDBMIDebugInstructions, LCLIntf, Forms,
|
||||
{$IFdef MSWindows}
|
||||
Windows,
|
||||
{$ENDIF}
|
||||
|
@ -34,7 +34,8 @@ unit GDBTypeInfo;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, Debugger, LclProc, math, LazLoggerBase, DebugUtils, GDBMIMiscClasses;
|
||||
Classes, SysUtils, Debugger, LclProc, math, LazLoggerBase, DebugUtils,
|
||||
DbgIntfBaseTypes, GDBMIMiscClasses;
|
||||
|
||||
(*
|
||||
ptype = {
|
||||
|
@ -29,7 +29,7 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, Forms, Controls, Graphics, IDEWindowIntf, DebuggerStrConst, ComCtrls,
|
||||
ObjectInspector, PropEdits, IDEImagesIntf, Debugger, DebuggerDlg, BaseDebugManager,
|
||||
ObjectInspector, PropEdits, IDEImagesIntf, Debugger, DebuggerDlg, DbgIntfBaseTypes, BaseDebugManager,
|
||||
LazarusIDEStrConsts, LCLType, Grids, StdCtrls, Menus, LCLProc, InputHistory, IDEProcs;
|
||||
|
||||
type
|
||||
|
@ -41,7 +41,7 @@ uses
|
||||
Classes, Forms, Controls, math, sysutils, LazLoggerBase, Clipbrd,
|
||||
IDEWindowIntf, Menus, ComCtrls, ActnList, ExtCtrls, StdCtrls, LCLType, IDEImagesIntf,
|
||||
LazarusIDEStrConsts, DebuggerStrConst, Debugger, DebuggerDlg,
|
||||
BaseDebugManager;
|
||||
DbgIntfBaseTypes, BaseDebugManager;
|
||||
|
||||
type
|
||||
|
||||
|
@ -40,7 +40,7 @@ uses
|
||||
{$IFDEF IDE_MEM_CHECK}
|
||||
MemCheck,
|
||||
{$ENDIF}
|
||||
Classes, SysUtils, Forms, Project, SourceMarks, Debugger, ProjectDefs,
|
||||
Classes, SysUtils, Forms, Project, SourceMarks, DbgIntfBaseTypes, Debugger, ProjectDefs,
|
||||
IDEOptionsIntf, LazarusIDEStrConsts, Laz2_XMLCfg;
|
||||
|
||||
type
|
||||
|
@ -57,8 +57,8 @@ uses
|
||||
DebuggerDlg, Watchesdlg, BreakPointsdlg, BreakPropertyDlg, LocalsDlg, WatchPropertyDlg,
|
||||
CallStackDlg, EvaluateDlg, RegistersDlg, AssemblerDlg, DebugOutputForm, ExceptionDlg,
|
||||
InspectDlg, DebugEventsForm, PseudoTerminalDlg, FeedbackDlg, ThreadDlg, HistoryDlg,
|
||||
GDBMIDebugger, SSHGDBMIDebugger, ProcessDebugger, GDBMIServerDebugger,
|
||||
BaseDebugManager;
|
||||
GDBMIDebugger, SSHGDBMIDebugger, ProcessDebugger, GDBMIServerDebugger,
|
||||
DbgIntfBaseTypes, BaseDebugManager;
|
||||
|
||||
|
||||
type
|
||||
|
@ -101,7 +101,7 @@ uses
|
||||
Translations,
|
||||
// debugger
|
||||
RunParamsOpts, BaseDebugManager, DebugManager, debugger, DebuggerDlg,
|
||||
DebugAttachDialog,
|
||||
DebugAttachDialog, DbgIntfBaseTypes,
|
||||
// packager
|
||||
PackageSystem, PkgManager, BasePkgManager, LPKCache,
|
||||
// source editing
|
||||
|
@ -74,7 +74,7 @@ uses
|
||||
SortSelectionDlg, EncloseSelectionDlg, ConDef, InvertAssignTool,
|
||||
SourceEditProcs, SourceMarks, CharacterMapDlg, SearchFrm,
|
||||
FPDocHints, EditorMacroListViewer,
|
||||
BaseDebugManager, Debugger, MainIntf, GotoFrm;
|
||||
DbgIntfBaseTypes, BaseDebugManager, Debugger, MainIntf, GotoFrm;
|
||||
|
||||
type
|
||||
TSourceNotebook = class;
|
||||
|
Loading…
Reference in New Issue
Block a user