mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-24 07:09:07 +02:00
debugger:
- add skVariant enum value for Variant data type, - move Variant type handling to skVariant - misc Inspect dialog improvements (hiding pages, close on escape) git-svn-id: trunk@23002 -
This commit is contained in:
parent
68bc1dda1d
commit
92aacc4bf2
@ -452,7 +452,7 @@ type
|
|||||||
(******************************************************************************)
|
(******************************************************************************)
|
||||||
|
|
||||||
type
|
type
|
||||||
TDBGSymbolKind = (skClass, skRecord, skEnum, skSet, skProcedure, skFunction, skSimple, skPointer);
|
TDBGSymbolKind = (skClass, skRecord, skEnum, skSet, skProcedure, skFunction, skSimple, skPointer, skVariant);
|
||||||
TDBGFieldLocation = (flPrivate, flProtected, flPublic, flPublished);
|
TDBGFieldLocation = (flPrivate, flProtected, flPublic, flPublished);
|
||||||
TDBGFieldFlag = (ffVirtual,ffConstructor,ffDestructor);
|
TDBGFieldFlag = (ffVirtual,ffConstructor,ffDestructor);
|
||||||
TDBGFieldFlags = set of TDBGFieldFlag;
|
TDBGFieldFlags = set of TDBGFieldFlag;
|
||||||
|
@ -2365,11 +2365,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
skVariant: begin
|
||||||
|
AResult := GetVariantValue(AResult);
|
||||||
|
end;
|
||||||
skRecord: begin
|
skRecord: begin
|
||||||
if (ResultInfo.TypeName = 'Variant') or
|
|
||||||
(ResultInfo.TypeName = 'VARIANT') then
|
|
||||||
AResult := GetVariantValue(AResult)
|
|
||||||
else
|
|
||||||
if (ResultInfo.TypeName = 'ShortString') or
|
if (ResultInfo.TypeName = 'ShortString') or
|
||||||
(ResultInfo.TypeName = 'SHORTSTRING') then
|
(ResultInfo.TypeName = 'SHORTSTRING') then
|
||||||
AResult := AResult // don't show 'record ShortString' as this is debug info implementation details
|
AResult := AResult // don't show 'record ShortString' as this is debug info implementation details
|
||||||
|
@ -261,7 +261,12 @@ var
|
|||||||
S: String;
|
S: String;
|
||||||
Field: TDBGField;
|
Field: TDBGField;
|
||||||
begin
|
begin
|
||||||
FKind := skRecord;
|
if (FTypeName = 'Variant') or
|
||||||
|
(FTypeName = 'VARIANT') then
|
||||||
|
FKind := skVariant
|
||||||
|
else
|
||||||
|
FKind := skRecord;
|
||||||
|
|
||||||
FFields := TDBGFields.Create;
|
FFields := TDBGFields.Create;
|
||||||
|
|
||||||
//concatenate all lines and skip last end
|
//concatenate all lines and skip last end
|
||||||
|
@ -9,7 +9,9 @@ inherited IDEInspectDlg: TIDEInspectDlg
|
|||||||
ClientWidth = 295
|
ClientWidth = 295
|
||||||
Constraints.MinHeight = 200
|
Constraints.MinHeight = 200
|
||||||
Constraints.MinWidth = 200
|
Constraints.MinWidth = 200
|
||||||
|
KeyPreview = True
|
||||||
OnClose = FormClose
|
OnClose = FormClose
|
||||||
|
OnKeyDown = FormKeyDown
|
||||||
object StatusBar1: TStatusBar[0]
|
object StatusBar1: TStatusBar[0]
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 23
|
Height = 23
|
||||||
|
@ -4,15 +4,15 @@ LazarusResources.Add('TIDEInspectDlg','FORMDATA',[
|
|||||||
'TPF0'#241#14'TIDEInspectDlg'#13'IDEInspectDlg'#4'Left'#3'n'#1#6'Height'#3#151
|
'TPF0'#241#14'TIDEInspectDlg'#13'IDEInspectDlg'#4'Left'#3'n'#1#6'Height'#3#151
|
||||||
+#1#3'Top'#3#185#0#5'Width'#3''''#1#11'BorderStyle'#7#13'bsSizeToolWin'#7'Cap'
|
+#1#3'Top'#3#185#0#5'Width'#3''''#1#11'BorderStyle'#7#13'bsSizeToolWin'#7'Cap'
|
||||||
+'tion'#6#13'IDEInspectDlg'#12'ClientHeight'#3#151#1#11'ClientWidth'#3''''#1
|
+'tion'#6#13'IDEInspectDlg'#12'ClientHeight'#3#151#1#11'ClientWidth'#3''''#1
|
||||||
+#21'Constraints.MinHeight'#3#200#0#20'Constraints.MinWidth'#3#200#0#7'OnClos'
|
+#21'Constraints.MinHeight'#3#200#0#20'Constraints.MinWidth'#3#200#0#10'KeyPr'
|
||||||
+'e'#7#9'FormClose'#0#242#2#0#10'TStatusBar'#10'StatusBar1'#4'Left'#2#0#6'Hei'
|
+'eview'#9#7'OnClose'#7#9'FormClose'#9'OnKeyDown'#7#11'FormKeyDown'#0#242#2#0
|
||||||
+'ght'#2#23#3'Top'#3#128#1#5'Width'#3''''#1#6'Panels'#14#0#0#0#242#2#1#12'TPa'
|
+#10'TStatusBar'#10'StatusBar1'#4'Left'#2#0#6'Height'#2#23#3'Top'#3#128#1#5'W'
|
||||||
+'geControl'#11'PageControl'#4'Left'#2#0#6'Height'#3'k'#1#3'Top'#2#21#5'Width'
|
+'idth'#3''''#1#6'Panels'#14#0#0#0#242#2#1#12'TPageControl'#11'PageControl'#4
|
||||||
+#3''''#1#10'ActivePage'#7#8'DataPage'#5'Align'#7#8'alClient'#8'TabIndex'#2#0
|
+'Left'#2#0#6'Height'#3'k'#1#3'Top'#2#21#5'Width'#3''''#1#10'ActivePage'#7#8
|
||||||
+#8'TabOrder'#2#1#0#9'TTabSheet'#8'DataPage'#7'Caption'#6#8'DataPage'#0#0#9'T'
|
+'DataPage'#5'Align'#7#8'alClient'#8'TabIndex'#2#0#8'TabOrder'#2#1#0#9'TTabSh'
|
||||||
+'TabSheet'#14'PropertiesPage'#7'Caption'#6#14'PropertiesPage'#0#0#9'TTabShee'
|
+'eet'#8'DataPage'#7'Caption'#6#8'DataPage'#0#0#9'TTabSheet'#14'PropertiesPag'
|
||||||
+'t'#11'MethodsPage'#7'Caption'#6#11'MethodsPage'#0#0#0#242#2#2#5'TEdit'#13'E'
|
+'e'#7'Caption'#6#14'PropertiesPage'#0#0#9'TTabSheet'#11'MethodsPage'#7'Capti'
|
||||||
+'ditInspected'#4'Left'#2#0#6'Height'#2#21#3'Top'#2#0#5'Width'#3''''#1#5'Alig'
|
+'on'#6#11'MethodsPage'#0#0#0#242#2#2#5'TEdit'#13'EditInspected'#4'Left'#2#0#6
|
||||||
+'n'#7#5'alTop'#7'Enabled'#8#8'ReadOnly'#9#8'TabOrder'#2#2#4'Text'#6#5'(...)'
|
+'Height'#2#21#3'Top'#2#0#5'Width'#3''''#1#5'Align'#7#5'alTop'#7'Enabled'#8#8
|
||||||
+#0#0#0
|
+'ReadOnly'#9#8'TabOrder'#2#2#4'Text'#6#5'(...)'#0#0#0
|
||||||
]);
|
]);
|
||||||
|
@ -30,7 +30,7 @@ interface
|
|||||||
uses
|
uses
|
||||||
Classes, SysUtils, TypInfo, FileUtil, LResources, Forms, Controls, Graphics,
|
Classes, SysUtils, TypInfo, FileUtil, LResources, Forms, Controls, Graphics,
|
||||||
Dialogs, ComCtrls, ObjectInspector, PropEdits, Debugger, DebuggerDlg, BaseDebugManager,
|
Dialogs, ComCtrls, ObjectInspector, PropEdits, Debugger, DebuggerDlg, BaseDebugManager,
|
||||||
LazarusIDEStrConsts, IDEWindowIntf,LCLProc,Grids, StdCtrls;
|
LazarusIDEStrConsts, IDEWindowIntf, LCLProc, LCLType, Grids, StdCtrls;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -53,6 +53,7 @@ type
|
|||||||
PropertiesPage: TTabSheet;
|
PropertiesPage: TTabSheet;
|
||||||
MethodsPage: TTabSheet;
|
MethodsPage: TTabSheet;
|
||||||
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||||
|
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||||
private
|
private
|
||||||
FDataGridHook,
|
FDataGridHook,
|
||||||
FPropertiesGridHook,
|
FPropertiesGridHook,
|
||||||
@ -68,6 +69,7 @@ type
|
|||||||
procedure Localize;
|
procedure Localize;
|
||||||
procedure InspectClass;
|
procedure InspectClass;
|
||||||
procedure InspectRecord;
|
procedure InspectRecord;
|
||||||
|
procedure InspectVariant;
|
||||||
procedure InspectSimple;
|
procedure InspectSimple;
|
||||||
procedure InspectPointer;
|
procedure InspectPointer;
|
||||||
procedure GridDataSetup;
|
procedure GridDataSetup;
|
||||||
@ -90,6 +92,13 @@ begin
|
|||||||
IDEDialogLayoutList.SaveLayout(Self);
|
IDEDialogLayoutList.SaveLayout(Self);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TIDEInspectDlg.FormKeyDown(Sender: TObject; var Key: Word;
|
||||||
|
Shift: TShiftState);
|
||||||
|
begin
|
||||||
|
if Key = VK_ESCAPE then
|
||||||
|
Close;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TIDEInspectDlg.Localize;
|
procedure TIDEInspectDlg.Localize;
|
||||||
begin
|
begin
|
||||||
Caption := lisInspectDialog;
|
Caption := lisInspectDialog;
|
||||||
@ -100,9 +109,9 @@ end;
|
|||||||
|
|
||||||
procedure TIDEInspectDlg.InspectClass;
|
procedure TIDEInspectDlg.InspectClass;
|
||||||
begin
|
begin
|
||||||
DataPage.Visible:=true;
|
DataPage.TabVisible:=true;
|
||||||
PropertiesPage.Visible:=false;
|
PropertiesPage.TabVisible:=false;
|
||||||
MethodsPage.Visible:=true;
|
MethodsPage.TabVisible:=true;
|
||||||
|
|
||||||
if not Assigned(FDBGInfo) then exit;
|
if not Assigned(FDBGInfo) then exit;
|
||||||
if not Assigned(FDBGInfo.Fields) then exit;
|
if not Assigned(FDBGInfo.Fields) then exit;
|
||||||
@ -117,20 +126,32 @@ begin
|
|||||||
FGridMethods.AutoSizeColumn(3);
|
FGridMethods.AutoSizeColumn(3);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TIDEInspectDlg.InspectVariant;
|
||||||
|
begin
|
||||||
|
DataPage.TabVisible:=true;
|
||||||
|
PropertiesPage.TabVisible:=false;
|
||||||
|
MethodsPage.TabVisible:=false;
|
||||||
|
if not Assigned(FDBGInfo) then exit;
|
||||||
|
EditInspected.Text:=FExpression+' : Variant';
|
||||||
|
GridDataSetup;
|
||||||
|
FGridData.Cells[0,1]:=FExpression;
|
||||||
|
FGridData.Cells[1,1]:='Variant';
|
||||||
|
FGridData.Cells[2,1]:=FHumanReadable;
|
||||||
|
FGridData.AutoSizeColumn(1);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TIDEInspectDlg.InspectRecord;
|
procedure TIDEInspectDlg.InspectRecord;
|
||||||
begin
|
begin
|
||||||
DataPage.Visible:=true;
|
DataPage.TabVisible:=true;
|
||||||
PropertiesPage.Visible:=false;
|
PropertiesPage.TabVisible:=false;
|
||||||
MethodsPage.Visible:=false;
|
MethodsPage.TabVisible:=false;
|
||||||
|
|
||||||
if not Assigned(FDBGInfo) then exit;
|
if not Assigned(FDBGInfo) then exit;
|
||||||
if not Assigned(FDBGInfo.Fields) then exit;
|
if not Assigned(FDBGInfo.Fields) then exit;
|
||||||
EditInspected.Text:=FExpression+' : '+FDBGInfo.TypeName;
|
EditInspected.Text:=FExpression+' : '+FDBGInfo.TypeName;
|
||||||
GridDataSetup;
|
GridDataSetup;
|
||||||
// handle special records
|
// handle special records
|
||||||
if (FDBGInfo.TypeName = 'VARIANT') or
|
if (FDBGInfo.TypeName = 'ShortString') or
|
||||||
(FDBGInfo.TypeName = 'Variant') or
|
|
||||||
(FDBGInfo.TypeName = 'ShortString') or
|
|
||||||
(FDBGInfo.TypeName = 'SHORTSTRING') then
|
(FDBGInfo.TypeName = 'SHORTSTRING') then
|
||||||
begin
|
begin
|
||||||
FGridData.Cells[0,1]:=FExpression;
|
FGridData.Cells[0,1]:=FExpression;
|
||||||
@ -144,6 +165,9 @@ end;
|
|||||||
|
|
||||||
procedure TIDEInspectDlg.InspectSimple;
|
procedure TIDEInspectDlg.InspectSimple;
|
||||||
begin
|
begin
|
||||||
|
DataPage.TabVisible:=true;
|
||||||
|
PropertiesPage.TabVisible:=false;
|
||||||
|
MethodsPage.TabVisible:=false;
|
||||||
if not Assigned(FDBGInfo) then exit;
|
if not Assigned(FDBGInfo) then exit;
|
||||||
EditInspected.Text:=FExpression+' : '+FDBGInfo.TypeName + ' = ' + FDBGInfo.Value.AsString;
|
EditInspected.Text:=FExpression+' : '+FDBGInfo.TypeName + ' = ' + FDBGInfo.Value.AsString;
|
||||||
GridDataSetup;
|
GridDataSetup;
|
||||||
@ -155,6 +179,9 @@ end;
|
|||||||
|
|
||||||
procedure TIDEInspectDlg.InspectPointer;
|
procedure TIDEInspectDlg.InspectPointer;
|
||||||
begin
|
begin
|
||||||
|
DataPage.TabVisible:=true;
|
||||||
|
PropertiesPage.TabVisible:=false;
|
||||||
|
MethodsPage.TabVisible:=false;
|
||||||
if not Assigned(FDBGInfo) then exit;
|
if not Assigned(FDBGInfo) then exit;
|
||||||
EditInspected.Text:=FExpression+' : ^'+FDBGInfo.TypeName + ' = ' + FDBGInfo.Value.AsString;
|
EditInspected.Text:=FExpression+' : ^'+FDBGInfo.TypeName + ' = ' + FDBGInfo.Value.AsString;
|
||||||
GridDataSetup;
|
GridDataSetup;
|
||||||
@ -251,6 +278,13 @@ begin
|
|||||||
FGridData.Cells[1,k]:='Record '+FDBGInfo.Fields[j].DBGType.TypeName;
|
FGridData.Cells[1,k]:='Record '+FDBGInfo.Fields[j].DBGType.TypeName;
|
||||||
FGridData.Cells[2,k]:=FDBGInfo.Fields[j].DBGType.Value.AsString;
|
FGridData.Cells[2,k]:=FDBGInfo.Fields[j].DBGType.Value.AsString;
|
||||||
end;
|
end;
|
||||||
|
skVariant:
|
||||||
|
begin
|
||||||
|
inc(k);
|
||||||
|
FGridData.Cells[0,k]:=FDBGInfo.Fields[j].Name;
|
||||||
|
FGridData.Cells[1,k]:='Variant';
|
||||||
|
FGridData.Cells[2,k]:=FDBGInfo.Fields[j].DBGType.Value.AsString;
|
||||||
|
end;
|
||||||
skProcedure:
|
skProcedure:
|
||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
@ -376,6 +410,7 @@ begin
|
|||||||
case FDBGInfo.Kind of
|
case FDBGInfo.Kind of
|
||||||
skClass: InspectClass();
|
skClass: InspectClass();
|
||||||
skRecord: InspectRecord();
|
skRecord: InspectRecord();
|
||||||
|
skVariant: InspectVariant();
|
||||||
// skEnum: ;
|
// skEnum: ;
|
||||||
// skSet: ;
|
// skSet: ;
|
||||||
// skProcedure: ;
|
// skProcedure: ;
|
||||||
|
Loading…
Reference in New Issue
Block a user