IdeDebugger: Displayformat defaults for enum-identifier

This commit is contained in:
Martin 2024-04-19 14:45:06 +02:00
parent f167f7fba2
commit 3f2ccce591
31 changed files with 525 additions and 24 deletions

View File

@ -6,7 +6,7 @@ interface
uses
Classes, SysUtils, DbgIntfBaseTypes, FpDbgClasses, FpdMemoryTools,
FpDbgDwarfCFI, FpDbgDwarfDataClasses, FpDbgDisasX86;
FpDbgDwarfCFI, FpDbgDwarfDataClasses, FpDbgDisasX86, LazLogger;
type
@ -107,9 +107,9 @@ function TDbgStackUnwinderX86FramePointer.Unwind(AFrameIndex: integer;
ACurrentFrame: TDbgCallstackEntry; out ANewFrame: TDbgCallstackEntry
): TTDbgStackUnwindResult;
var
OutSideFrame: Boolean;
OutSideFrame, UnknownOutsideFrame, AfterCallOut, AfterCallIn: Boolean;
Dummy: QWord;
LastFrameBase: TDBGPtr;
LastFrameBase, TmpCodePointer: TDBGPtr;
NewRes: TTDbgStackUnwindResult;
begin
ANewFrame := nil;
@ -122,9 +122,12 @@ begin
exit;
OutSideFrame := False;
UnknownOutsideFrame := False;
TmpCodePointer := 0;
LastFrameBase := FrameBasePointer;
if not Process.Disassembler.GetFunctionFrameInfo(CodePointer, OutSideFrame) then begin
UnknownOutsideFrame := True;
if Process.Disassembler.LastErrorWasMemReadErr then begin
inc(FCodeReadErrCnt);
if FCodeReadErrCnt > 5 then // If the code cannot be read the stack pointer is wrong.
@ -136,9 +139,11 @@ begin
if (not OutSideFrame) {and (AFrameIndex = 1)} and (ACurrentFrame.ProcSymbol <> nil) then begin
// the frame must be outside frame, if it is at entrypoint / needed for exceptions
OutSideFrame := CodePointer = LocToAddrOrNil(ACurrentFrame.ProcSymbol.Address);
if OutSideFrame then
UnknownOutsideFrame := False;
end;
if OutSideFrame then begin
if OutSideFrame or UnknownOutsideFrame then begin
if not Process.ReadData(StackPointer, AddressSize, CodePointer) or (CodePointer = 0) then
exit;
@ -147,13 +152,30 @@ begin
NewRes := suGuessed;
end
else begin
{$PUSH}{$R-}{$Q-}
StackPointer := StackPointer + 1 * AddressSize; // After popping return-addr from "StackPointer"
if LastFrameBase > 0 then
LastFrameBase := LastFrameBase - 1; // Make the loop think thas LastFrameBase was smaller
{$POP}
// last stack has no frame
//ACurrentFrame.RegisterValueList.DbgRegisterAutoCreate[nBP].SetValue(0, '0',AddressSize, BP);
if UnknownOutsideFrame then begin
NewRes := suGuessed;
if Process.ReadData(FrameBasePointer + AddressSize, AddressSize, TmpCodePointer) and
(TmpCodePointer <> 0)
then begin
AfterCallOut := Process.Disassembler.IsAfterCallInstruction(CodePointer);
AfterCallIn := Process.Disassembler.IsAfterCallInstruction(TmpCodePointer);
if AfterCallOut = AfterCallIn then
OutSideFrame := StackPointer + 1 * AddressSize < FrameBasePointer + 2 * AddressSize
else
OutSideFrame := AfterCallOut;
if not OutSideFrame then debugln(['>>>>>>>>>>>> ####### FRAME UNWIND - new code update to better']);
end;
end;
if OutSideFrame then begin
{$PUSH}{$R-}{$Q-}
StackPointer := StackPointer + 1 * AddressSize; // After popping return-addr from "StackPointer"
if LastFrameBase > 0 then
LastFrameBase := LastFrameBase - 1; // Make the loop think thas LastFrameBase was smaller
{$POP}
// last stack has no frame
//ACurrentFrame.RegisterValueList.DbgRegisterAutoCreate[nBP].SetValue(0, '0',AddressSize, BP);
end;
end;
end;
@ -161,8 +183,11 @@ begin
{$PUSH}{$R-}{$Q-}
StackPointer := FrameBasePointer + 2 * AddressSize; // After popping return-addr from "FrameBasePointer + AddressSize"
{$POP}
if not Process.ReadData(FrameBasePointer + AddressSize, AddressSize, CodePointer) or (CodePointer = 0) then
exit;
if TmpCodePointer <> 0 then
CodePointer := TmpCodePointer
else
if not Process.ReadData(FrameBasePointer + AddressSize, AddressSize, CodePointer) or (CodePointer = 0) then
exit;
if not Process.ReadData(FrameBasePointer, AddressSize, FrameBasePointer) then
exit;
end;

View File

@ -156,6 +156,7 @@ type
Num: TWatchDisplayFormatNum;
Num2: TWatchDisplayFormatNum2;
Enum: TWatchDisplayFormatEnum;
EnumVal: TWatchDisplayFormatEnum;
Bool: TWatchDisplayFormatBool;
Char: TWatchDisplayFormatChar;
Float: TWatchDisplayFormatFloat;
@ -195,6 +196,11 @@ const
BaseFormat: vdfBaseDecimal;
SignFormat: vdfSignAuto;
);
EnumVal: (UseInherited: True;
MainFormat: vdfEnumNameAndOrd;
BaseFormat: vdfBaseDecimal;
SignFormat: vdfSignAuto;
);
Bool: (UseInherited: True;
MainFormat: vdfBoolName;
BaseFormat: vdfBaseDecimal;
@ -448,6 +454,7 @@ begin
'Num2: '+' '+dbgs(df.Num2.UseInherited)+' '+dbgs(df.Num2.Visible)+' '+dbgs(df.Num2.BaseFormat)+' '+dbgs(df.Num2.SignFormat)+' '+
dbgs(df.Num2.MinDigits)+' '+dbgs(df.Num2.SeparatorDec)+' '+dbgs(df.Num2.SeparatorHexBin) + LineEnding+
'Enum: '+dbgs(df.Enum.UseInherited)+' '+dbgs(df.Enum.MainFormat)+' '+dbgs(df.Enum.BaseFormat)+' '+dbgs(df.Enum.SignFormat) + LineEnding+
'EnumVal: '+dbgs(df.EnumVal.UseInherited)+' '+dbgs(df.EnumVal.MainFormat)+' '+dbgs(df.EnumVal.BaseFormat)+' '+dbgs(df.EnumVal.SignFormat) + LineEnding+
'Bool: '+dbgs(df.Bool.UseInherited)+' '+dbgs(df.Bool.MainFormat)+' '+dbgs(df.Bool.BaseFormat)+' '+dbgs(df.Bool.SignFormat) + LineEnding+
'Char: '+dbgs(df.Char.UseInherited)+' '+dbgs(df.Char.MainFormat)+' '+dbgs(df.Char.BaseFormat)+' '+dbgs(df.Char.SignFormat) + LineEnding+
'Float: '+dbgs(df.Float.UseInherited)+' '+dbgs(df.Float.NumFormat)+' '+dbgs(df.Float.Precission) + LineEnding+
@ -597,6 +604,7 @@ begin
(a.Num = b.Num) and
(a.Num2 = b.Num2) and
(a.Enum = b.Enum) and
(a.EnumVal = b.EnumVal) and
(a.Bool = b.Bool) and
(a.Char = b.Char) and
(a.Float = b.Float) and
@ -608,7 +616,7 @@ end;
function TWatchDisplayFormat.HasOverrides: boolean;
begin
Result := not(Num.UseInherited and Num2.UseInherited and
Enum.UseInherited and Bool.UseInherited and Char.UseInherited and
Enum.UseInherited and EnumVal.UseInherited and Bool.UseInherited and Char.UseInherited and
Float.UseInherited and
Struct.UseInherited and Struct.Address.UseInherited and
Pointer.UseInherited and Pointer.Address.UseInherited
@ -620,6 +628,7 @@ begin
Num.UseInherited := False;
Num2.UseInherited := False;
Enum.UseInherited := False;
EnumVal.UseInherited := False;
Bool.UseInherited := False;
Char.UseInherited := False;
Float.UseInherited := False;

View File

@ -1472,14 +1472,14 @@ object DisplayFormatFrame: TDisplayFormatFrame
Visible = False
end
end
object PanelFloat: TPanel
object PanelEnumVal: TPanel
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = PanelEnum
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 0
Height = 26
Height = 42
Top = 255
Width = 592
Anchors = [akTop, akLeft, akRight]
@ -1490,6 +1490,255 @@ object DisplayFormatFrame: TDisplayFormatFrame
ChildSizing.ShrinkHorizontal = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 2
ClientHeight = 42
ClientWidth = 592
TabOrder = 9
Visible = False
object Spacer15: TLabel
Left = 0
Height = 1
Top = 0
Width = 107
BorderSpacing.Right = 4
Caption = ' '
Constraints.MaxHeight = 1
end
object Spacer16: TLabel
Left = 111
Height = 1
Top = 0
Width = 481
Caption = ' '
Constraints.MaxHeight = 1
end
object DividerBevelEnumVal: TDividerBevel
Left = 0
Height = 1
Top = 0
Width = 592
Align = alTop
AutoSize = False
BevelWidth = 1
BorderSpacing.Bottom = 2
CaptionSpacing = 5
Font.Height = 2
Font.Style = [fsBold]
LeftIndent = 30
ParentFont = False
Style = gsHorLines
end
object cbOverrideEnumVal: TCheckBox
AnchorSideLeft.Control = Spacer15
AnchorSideTop.Control = DividerBevelEnumVal
AnchorSideTop.Side = asrBottom
Left = 0
Height = 17
Top = 3
Width = 18
Font.Style = [fsBold]
ParentFont = False
TabOrder = 0
OnChange = OverrideCheckChanged
end
object lbOverrideEnumVal: TLabel
AnchorSideLeft.Control = cbOverrideEnumVal
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = cbOverrideEnumVal
AnchorSideRight.Control = Spacer15
AnchorSideRight.Side = asrBottom
Left = 18
Height = 15
Top = 3
Width = 89
Anchors = [akTop, akLeft, akRight]
Caption = 'lbOverrideEnum'
Font.Style = [fsBold]
ParentFont = False
WordWrap = True
OnClick = CheckLabelClicked
end
object PanelEnumValRb: TPanel
AnchorSideLeft.Control = Spacer16
AnchorSideTop.Control = DividerBevelEnumVal
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Spacer16
AnchorSideRight.Side = asrBottom
Left = 111
Height = 19
Top = 3
Width = 481
Anchors = [akTop, akLeft, akRight]
AutoSize = True
BevelOuter = bvNone
ChildSizing.EnlargeHorizontal = crsSameSize
ChildSizing.ShrinkHorizontal = crsSameSize
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 3
ClientHeight = 19
ClientWidth = 481
TabOrder = 1
object rbEnumValName: TRadioButton
Left = 0
Height = 19
Top = 0
Width = 160
AutoSize = False
Caption = 'rbEnumName'
TabOrder = 0
OnChange = FormatRadioChanged
end
object rbEnumValOrd: TRadioButton
Left = 160
Height = 19
Top = 0
Width = 161
AutoSize = False
Caption = 'rbEnumOrd'
TabOrder = 1
OnChange = FormatRadioChanged
end
object rbEnumValNameAndOrd: TRadioButton
Left = 321
Height = 19
Top = 0
Width = 160
AutoSize = False
Caption = 'rbEnumNameAndOrd'
TabOrder = 2
OnChange = FormatRadioChanged
end
object rbClear8: TRadioButton
AnchorSideBottom.Control = PanelEnumValRb
Left = -99
Height = 1
Top = -1
Width = 1
Anchors = [akLeft, akBottom]
AutoSize = False
TabOrder = 3
end
end
object PanelENumValBase: TPanel
AnchorSideLeft.Control = Spacer16
AnchorSideTop.Control = PanelEnumValRb
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Spacer16
AnchorSideRight.Side = asrBottom
Left = 111
Height = 20
Top = 22
Width = 481
Anchors = [akTop, akLeft, akRight]
AutoSize = True
BevelOuter = bvNone
ChildSizing.EnlargeHorizontal = crsSameSize
ChildSizing.ShrinkHorizontal = crsSameSize
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 6
ClientHeight = 20
ClientWidth = 481
ParentBackground = False
ParentColor = False
ParentFont = False
TabOrder = 2
object rbENumValDec: TRadioButton
Left = 0
Height = 19
Top = 0
Width = 80
AutoSize = False
Caption = 'rbNumDec'
ParentColor = False
TabOrder = 0
OnChange = FormatRadioChanged
end
object rbENumValHex: TRadioButton
Left = 80
Height = 19
Top = 0
Width = 80
AutoSize = False
Caption = 'rbNumHex'
TabOrder = 1
OnChange = FormatRadioChanged
end
object rbENumValOct: TRadioButton
Left = 160
Height = 19
Top = 0
Width = 81
AutoSize = False
Caption = 'rbNumOct'
TabOrder = 2
OnChange = FormatRadioChanged
end
object rbENumValBin: TRadioButton
Left = 241
Height = 19
Top = 0
Width = 80
AutoSize = False
Caption = 'rbNumBin'
TabOrder = 3
OnChange = FormatRadioChanged
end
object rbENumValChar: TRadioButton
Left = 321
Height = 19
Top = 0
Width = 80
AutoSize = False
BorderSpacing.CellAlignHorizontal = ccaLeftTop
Caption = 'rbNumChar'
TabOrder = 4
OnChange = FormatRadioChanged
end
object cbEnumValSign: TCheckBox
Left = 401
Height = 19
Top = 0
Width = 80
Caption = 'cbEnumSign'
TabOrder = 5
end
object lbEnumValBaseSpace: TLabel
Left = 0
Height = 1
Top = 19
Width = 80
Constraints.MaxHeight = 1
Visible = False
end
object rbClear15: TRadioButton
AnchorSideBottom.Control = PanelENumValBase
Left = -99
Height = 1
Top = -1
Width = 1
Anchors = [akLeft, akBottom]
AutoSize = False
TabOrder = 6
end
end
end
object PanelFloat: TPanel
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = PanelEnumVal
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 0
Height = 26
Top = 301
Width = 592
Anchors = [akTop, akLeft, akRight]
AutoSize = True
BorderSpacing.Bottom = 4
BevelOuter = bvNone
ChildSizing.EnlargeHorizontal = crsScaleChilds
ChildSizing.ShrinkHorizontal = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 2
ClientHeight = 26
ClientWidth = 592
TabOrder = 4
@ -1644,7 +1893,7 @@ object DisplayFormatFrame: TDisplayFormatFrame
AnchorSideRight.Side = asrBottom
Left = 0
Height = 43
Top = 285
Top = 331
Width = 592
Anchors = [akTop, akLeft, akRight]
AutoSize = True
@ -1853,7 +2102,7 @@ object DisplayFormatFrame: TDisplayFormatFrame
AnchorSideRight.Side = asrBottom
Left = 0
Height = 22
Top = 332
Top = 378
Width = 592
Anchors = [akTop, akLeft, akRight]
AutoSize = True
@ -1998,7 +2247,7 @@ object DisplayFormatFrame: TDisplayFormatFrame
AnchorSideRight.Side = asrBottom
Left = 0
Height = 41
Top = 358
Top = 404
Width = 592
Anchors = [akTop, akLeft, akRight]
AutoSize = True
@ -2226,7 +2475,7 @@ object DisplayFormatFrame: TDisplayFormatFrame
AnchorSideRight.Side = asrBottom
Left = 0
Height = 34
Top = 403
Top = 449
Width = 592
Anchors = [akTop, akLeft, akRight]
AutoSize = True

View File

@ -45,7 +45,9 @@ type
TDisplayFormatFrame = class(TFrame)
cbAddrSign: TCheckBox;
cbEnumValSign: TCheckBox;
cbMemDump: TCheckBox;
cbOverrideEnumVal: TCheckBox;
cbOverrideNum2Base: TCheckBox;
cbOverridePointerDeref: TCheckBox;
cbOverrideAddressFormat: TCheckBox;
@ -59,6 +61,7 @@ type
cbEnumSign: TCheckBox;
DigitSpacer3: TLabel;
DigitSpacer4: TLabel;
DividerBevelEnumVal: TDividerBevel;
DividerBevelNum2: TDividerBevel;
DividerBevelPointerDeref: TDividerBevel;
DividerBevelAddressFormat: TDividerBevel;
@ -69,6 +72,8 @@ type
DividerBevelStruct: TDividerBevel;
Label1: TLabel;
Label3: TLabel;
lbEnumValBaseSpace: TLabel;
lbOverrideEnumVal: TLabel;
lpAddrSpace: TLabel;
lbEnumBaseSpace: TLabel;
lbNum2Digits: TLabel;
@ -82,6 +87,9 @@ type
lbOverrideAddressFormat: TLabel;
lbOverrideNumBase: TLabel;
lbNum2SepGroup: TLabel;
PanelEnumVal: TPanel;
PanelENumValBase: TPanel;
PanelEnumValRb: TPanel;
PanelNum2All: TPanel;
PanelNum2Digits: TPanel;
PanelENumBase: TPanel;
@ -98,13 +106,23 @@ type
rbClear12: TRadioButton;
rbClear13: TRadioButton;
rbClear14: TRadioButton;
rbClear15: TRadioButton;
rbClear2: TRadioButton;
rbClear3: TRadioButton;
rbClear4: TRadioButton;
rbClear5: TRadioButton;
rbClear6: TRadioButton;
rbClear7: TRadioButton;
rbClear8: TRadioButton;
rbClear9: TRadioButton;
rbENumValBin: TRadioButton;
rbENumValChar: TRadioButton;
rbENumValDec: TRadioButton;
rbENumValHex: TRadioButton;
rbEnumValName: TRadioButton;
rbEnumValNameAndOrd: TRadioButton;
rbENumValOct: TRadioButton;
rbEnumValOrd: TRadioButton;
rbNum2SepByte: TRadioButton;
rbNum2SepLong: TRadioButton;
rbENumBin: TRadioButton;
@ -188,6 +206,8 @@ type
Spacer14: TLabel;
DigitSpacer1: TLabel;
DigitSpacer2: TLabel;
Spacer15: TLabel;
Spacer16: TLabel;
Spacer2: TLabel;
Spacer3: TLabel;
Spacer4: TLabel;
@ -239,6 +259,7 @@ type
FDisplayFormatCount: integer;
FDisplayFormat: array of TWatchDisplayFormat;
FCurrentResDataType: TWatchResultDataKind;
FShowExtraSettings: boolean;
FShowMemDump: boolean;
FShowMultiRadio: boolean;
FShowOverrideChecks: boolean;
@ -257,6 +278,7 @@ type
procedure SetDisplayFormats(AIndex: integer; AValue: TWatchDisplayFormat);
procedure SetHighlightModifiedTabs(AValue: boolean);
procedure SetShowCurrent(AValue: boolean);
procedure SetShowExtraSettings(AValue: boolean);
procedure SetShowMemDump(AValue: boolean);
procedure SetShowMultiRadio(AValue: boolean);
procedure SetShowOverrideChecks(AValue: boolean);
@ -293,6 +315,7 @@ type
property ShowMemDump: boolean read FShowMemDump write SetShowMemDump;
property ShowMultiRadio: boolean read FShowMultiRadio write SetShowMultiRadio;
property ShowOverrideChecks: boolean read FShowOverrideChecks write SetShowOverrideChecks;
property ShowExtraSettings: boolean read FShowExtraSettings write SetShowExtraSettings;
property HighlightModifiedTabs: boolean read FHighlightModifiedTabs write SetHighlightModifiedTabs;
end;
@ -769,6 +792,12 @@ begin
tbCurrent.Visible := FShowCurrent;
end;
procedure TDisplayFormatFrame.SetShowExtraSettings(AValue: boolean);
begin
if FShowExtraSettings = AValue then Exit;
FShowExtraSettings := AValue;
end;
procedure TDisplayFormatFrame.SetShowMemDump(AValue: boolean);
begin
if FShowMemDump = AValue then Exit;
@ -789,6 +818,7 @@ begin
cbOverrideNumBase.Visible := FShowOverrideChecks;
cbOverrideNum2Base.Visible := FShowOverrideChecks;
cbOverrideEnum.Visible := FShowOverrideChecks;
cbOverrideEnumVal.Visible := FShowOverrideChecks;
cbOverrideFloat.Visible := FShowOverrideChecks;
cbOverrideStruct.Visible := FShowOverrideChecks;
cbOverridePointerDeref.Visible := FShowOverrideChecks;
@ -946,11 +976,16 @@ begin
PanelNum.Visible := tbNumber.Down;
PanelNum2.Visible := tbNumber.Down;
PanelEnum.Visible := tbEnum.Down or tbBool.Down or tbChar.Down;
PanelEnumVal.Visible := FShowExtraSettings and
tbEnum.Down and
not(tbNumber.Down or tbFloat.Down or tbStruct.Down or tbPointer.Down);
PanelFloat.Visible := tbFloat.Down;
PanelStruct.Visible := tbStruct.Down;
PanelPointer.Visible := tbPointer.Down;
PanelAddressFormat.Visible := tbPointer.Down or tbStruct.Down;
CaptRbEnumName := '';
CaptDivEnum := '';
if FButtonStates[bsEnum] then begin
@ -1076,6 +1111,8 @@ begin
end;
if FButtonStates[bsEnum] then begin
BoolFromCBState(cbOverrideEnum.State, FDisplayFormat[i].Enum.UseInherited);
if PanelEnumVal.Visible then
BoolFromCBState(cbOverrideEnumVal.State, FDisplayFormat[i].EnumVal.UseInherited);
end;
if FButtonStates[bsBool] then begin
BoolFromCBState(cbOverrideEnum.State, FDisplayFormat[i].Bool.UseInherited);
@ -1178,6 +1215,23 @@ begin
cbUnchecked: FDisplayFormat[i].Enum.SignFormat := vdfSignAuto;
cbChecked: FDisplayFormat[i].Enum.SignFormat := vdfSignUnsigned;
end;
if ShowExtraSettings then begin
ds := ReadDispForm(PanelEnumValRb, RBA_Enum);
if IdeDebuggerDisplayFormats.DisplayFormatCount(ds) = 1 then
for d := low(TValueDisplayFormatEnum) to high(TValueDisplayFormatEnum) do
if d in ds then
FDisplayFormat[i].EnumVal.MainFormat := d;
ds := ReadDispForm(PanelENumValBase, RBA_Num);
if IdeDebuggerDisplayFormats.DisplayFormatCount(ds) = 1 then
for d := low(TValueDisplayFormatBase) to high(TValueDisplayFormatBase) do
if d in ds then
FDisplayFormat[i].EnumVal.BaseFormat := d;
if cbEnumValSign.Tag = 0 then
case cbEnumValSign.State of
cbUnchecked: FDisplayFormat[i].EnumVal.SignFormat := vdfSignAuto;
cbChecked: FDisplayFormat[i].EnumVal.SignFormat := vdfSignUnsigned;
end;
end;
end;
if FButtonStates[bsBool] then begin
ds := ReadDispForm(PanelEnumRb1, RBA_Enum);
@ -1281,7 +1335,7 @@ end;
procedure TDisplayFormatFrame.UpdateDisplay;
var
InherhitNum, InherhitNum2, InherhitEnum, InherhitFloat,
InherhitNum, InherhitNum2, InherhitEnum, InherhitEnumVal, InherhitFloat,
InherhitStruct, InherhitPtr, InherhitAddress: TBoolSet;
FormatNumBase: TValueDisplayFormats;
@ -1298,7 +1352,10 @@ var
FormatEnum: TValueDisplayFormats;
FormatEnumBase: TValueDisplayFormats;
FormatEnumSign: TBoolSet;
//FormatEnumSign: TValueDisplayFormats;
FormatEnumVal: TValueDisplayFormats;
FormatEnumValBase: TValueDisplayFormats;
FormatEnumValSign: TBoolSet;
FormatFloat: TValueDisplayFormats;
FormatFloatPrec: integer;
@ -1332,6 +1389,7 @@ begin
InherhitNum := [];
InherhitNum2 := [];
InherhitEnum := [];
InherhitEnumVal := [];
InherhitFloat := [];
InherhitStruct := [];
InherhitPtr := [];
@ -1352,6 +1410,10 @@ begin
FormatENumBase := [];
FormatENumSign := [];
FormatEnumVal := [];
FormatENumValBase := [];
FormatENumValSign := [];
FormatFloat := [];
FormatFloatPrec := INT_UNK;
@ -1394,6 +1456,12 @@ begin
include(FormatEnumBase, FDisplayFormat[i].Enum.BaseFormat);
include(FormatEnumSign, FDisplayFormat[i].Enum.SignFormat = vdfSignUnsigned);
end;
include(InherhitEnumVal, FDisplayFormat[i].EnumVal.UseInherited);
if (not FDisplayFormat[i].EnumVal.UseInherited) or (not ShowOverrideChecks) then begin
include(FormatEnumVal, FDisplayFormat[i].EnumVal.MainFormat);
include(FormatEnumValBase, FDisplayFormat[i].EnumVal.BaseFormat);
include(FormatEnumValSign, FDisplayFormat[i].EnumVal.SignFormat = vdfSignUnsigned);
end;
end;
if FButtonStates[bsBool] then begin
include(InherhitEnum, FDisplayFormat[i].Bool.UseInherited);
@ -1451,6 +1519,7 @@ begin
cbOverrideNumBase.State := BoolsetToCBState(InherhitNum);
cbOverrideNum2Base.State := BoolsetToCBState(InherhitNum2);
cbOverrideEnum.State := BoolsetToCBState(InherhitEnum);
cbOverrideEnumVal.State := BoolsetToCBState(InherhitEnumVal);
cbOverrideFloat.State := BoolsetToCBState(InherhitFloat);
cbOverrideStruct.State := BoolsetToCBState(InherhitStruct);
cbOverridePointerDeref.State := BoolsetToCBState(InherhitPtr);
@ -1460,6 +1529,7 @@ begin
InherhitNum := [False];
InherhitNum2 := [False];
InherhitEnum := [False];
InherhitEnumVal := [False];
InherhitFloat := [False];
InherhitStruct := [False];
InherhitPtr := [False];
@ -1524,6 +1594,19 @@ begin
cbEnumSign.Tag := 0;
end;
if InherhitEnumVal = [True] then begin
ClearRadios(PanelEnumValRb);
ClearRadios(PanelEnumValBase);
cbEnumValSign.State := cbUnchecked;
cbEnumValSign.Tag := 1;
end
else begin
ApplyDispForm(PanelEnumValRb, FormatEnumVal, RBA_Enum);
ApplyDispForm(PanelEnumValBase, FormatEnumValBase, RBA_Num);
cbEnumValSign.State := BoolsetToCBState(FormatEnumValSign, False);
cbEnumValSign.Tag := 0;
end;
if InherhitFloat = [True] then begin
ClearRadios(PanelFloat);
SpinFloatDigits.Tag := 1;
@ -1626,9 +1709,14 @@ begin
));
MarkTabEnum := MarkTabEnum or
((not FDisplayFormat[i].Enum.UseInherited) and (
(FDisplayFormat[i].Enum.MainFormat = DefaultWatchDisplayFormat.Enum.MainFormat) or
(FDisplayFormat[i].Enum.MainFormat = DefaultWatchDisplayFormat.Enum.MainFormat) or
(FDisplayFormat[i].Enum.BaseFormat = DefaultWatchDisplayFormat.Enum.BaseFormat) or
(FDisplayFormat[i].Enum.SignFormat = DefaultWatchDisplayFormat.Enum.SignFormat)
)) or
((not FDisplayFormat[i].EnumVal.UseInherited) and (
(FDisplayFormat[i].EnumVal.MainFormat = DefaultWatchDisplayFormat.EnumVal.MainFormat) or
(FDisplayFormat[i].EnumVal.BaseFormat = DefaultWatchDisplayFormat.EnumVal.BaseFormat) or
(FDisplayFormat[i].EnumVal.SignFormat = DefaultWatchDisplayFormat.EnumVal.SignFormat)
));
MarkTabBool := MarkTabBool or
((not FDisplayFormat[i].Bool.UseInherited) and (
@ -1755,6 +1843,17 @@ begin
rbENumChar.Caption := DispFormatBaseChar;
cbEnumSign.Caption := DispFormatSignUnsigned;
lbOverrideEnumVal.Caption := DispFormatDlgBtnEnumVal;
rbEnumValName.Caption := DispFormatEnumName;
rbEnumValOrd.Caption := DispFormatEnumOrd;
rbEnumValNameAndOrd.Caption := DispFormatEnumNameAndOrd;
rbENumValDec.Caption := DispFormatBaseDecimal;
rbENumValHex.Caption := DispFormatBaseHex;
rbENumValOct.Caption := DispFormatBaseOct;
rbENumValBin.Caption := DispFormatBaseBin;
rbENumValChar.Caption := DispFormatBaseChar;
cbEnumValSign.Caption := DispFormatSignUnsigned;
lbOverrideFloat.Caption := DispFormatDlgBtnFloat;
rbFloatPoint.Caption := DispFormatFloatPoint;
rbFloatScience.Caption := DispFormatFloatScientific;

View File

@ -166,6 +166,7 @@ begin
DisplayFormatFrame1.ShowCurrent := False;
DisplayFormatFrame1.ShowMemDump := False;
DisplayFormatFrame1.SelectDefaultButton;
DisplayFormatFrame1.ShowExtraSettings := True;
DisplayFormatFrame1.ShowOverrideChecks := FShowOverrideChecks;
btnGlobal.Down := True;

View File

@ -141,6 +141,10 @@ begin
AConfig.GetValue(APath + 'Enum', ord(DefaultWatchDisplayFormat.Enum.MainFormat), ADisplayFormat.Enum.MainFormat, TypeInfo(TValueDisplayFormatEnum));
AConfig.GetValue(APath + 'EnumBase', ord(DefaultWatchDisplayFormat.Enum.BaseFormat), ADisplayFormat.Enum.BaseFormat, TypeInfo(TValueDisplayFormatBase));
AConfig.GetValue(APath + 'EnumSign', ord(DefaultWatchDisplayFormat.Enum.SignFormat), ADisplayFormat.Enum.SignFormat, TypeInfo(TValueDisplayFormatSign));
ADisplayFormat.EnumVal.UseInherited := AConfig.GetValue(APath + 'ENumValInherit', DefaultWatchDisplayFormat.EnumVal.UseInherited);
AConfig.GetValue(APath + 'EnumVal', ord(DefaultWatchDisplayFormat.EnumVal.MainFormat), ADisplayFormat.EnumVal.MainFormat, TypeInfo(TValueDisplayFormatEnum));
AConfig.GetValue(APath + 'EnumValBase', ord(DefaultWatchDisplayFormat.EnumVal.BaseFormat), ADisplayFormat.EnumVal.BaseFormat, TypeInfo(TValueDisplayFormatBase));
AConfig.GetValue(APath + 'EnumValSign', ord(DefaultWatchDisplayFormat.EnumVal.SignFormat), ADisplayFormat.EnumVal.SignFormat, TypeInfo(TValueDisplayFormatSign));
ADisplayFormat.Bool.UseInherited := AConfig.GetValue(APath + 'BoolInherit', DefaultWatchDisplayFormat.Bool.UseInherited);
AConfig.GetValue(APath + 'Bool', ord(DefaultWatchDisplayFormat.Bool.MainFormat), ADisplayFormat.Bool.MainFormat, TypeInfo(TValueDisplayFormatBool));
AConfig.GetValue(APath + 'BoolBase', ord(DefaultWatchDisplayFormat.Bool.BaseFormat), ADisplayFormat.Bool.BaseFormat, TypeInfo(TValueDisplayFormatBase));
@ -194,6 +198,10 @@ begin
AConfig.SetDeleteValue(APath + 'Enum', ADisplayFormat.Enum.MainFormat, ord(DefaultWatchDisplayFormat.Enum.MainFormat), TypeInfo(TValueDisplayFormatEnum));
AConfig.SetDeleteValue(APath + 'EnumBase', ADisplayFormat.Enum.BaseFormat, ord(DefaultWatchDisplayFormat.Enum.BaseFormat), TypeInfo(TValueDisplayFormatBase));
AConfig.SetDeleteValue(APath + 'EnumSign', ADisplayFormat.Enum.SignFormat, ord(DefaultWatchDisplayFormat.Enum.SignFormat), TypeInfo(TValueDisplayFormatSign));
AConfig.SetDeleteValue(APath + 'ENumValInherit', ADisplayFormat.EnumVal.UseInherited, DefaultWatchDisplayFormat.EnumVal.UseInherited);
AConfig.SetDeleteValue(APath + 'EnumVal', ADisplayFormat.EnumVal.MainFormat, ord(DefaultWatchDisplayFormat.EnumVal.MainFormat), TypeInfo(TValueDisplayFormatEnum));
AConfig.SetDeleteValue(APath + 'EnumValBase', ADisplayFormat.EnumVal.BaseFormat, ord(DefaultWatchDisplayFormat.EnumVal.BaseFormat), TypeInfo(TValueDisplayFormatBase));
AConfig.SetDeleteValue(APath + 'EnumValSign', ADisplayFormat.EnumVal.SignFormat, ord(DefaultWatchDisplayFormat.EnumVal.SignFormat), TypeInfo(TValueDisplayFormatSign));
AConfig.SetDeleteValue(APath + 'BoolInherit', ADisplayFormat.Bool.UseInherited, DefaultWatchDisplayFormat.Bool.UseInherited);
AConfig.SetDeleteValue(APath + 'Bool', ADisplayFormat.Bool.MainFormat, ord(DefaultWatchDisplayFormat.Bool.MainFormat), TypeInfo(TValueDisplayFormatBool));
AConfig.SetDeleteValue(APath + 'BoolBase', ADisplayFormat.Bool.BaseFormat, ord(DefaultWatchDisplayFormat.Bool.BaseFormat), TypeInfo(TValueDisplayFormatBase));

View File

@ -420,6 +420,7 @@ resourcestring
DispFormatDlgBtnNumber2 = 'Number (2nd)';
DispFormatDlgBtnOrd = 'Ordinal';
DispFormatDlgBtnEnum = 'Enum';
DispFormatDlgBtnEnumVal = 'Enum(Identifier)';
DispFormatDlgBtnBool = 'Boolean';
DispFormatDlgBtnChar = 'Char';
DispFormatDlgBtnFloat = 'Float';

View File

@ -276,7 +276,7 @@ begin
ResolveMinDigits(Result.Num2.MinDigits, Result.Num2.BaseFormat);
end;
rdkEnum, rdkEnumVal, rdkSet: begin
rdkEnum, rdkSet: begin
Result.Enum := ADispFormat.Enum;
if Result.Enum.UseInherited then begin
@ -293,6 +293,23 @@ begin
ResolveSign(Result.Num2.SignFormat, DefaultEnumNum.SignFormat);
end;
rdkEnumVal: begin
Result.Enum := ADispFormat.Enum;
if Result.Enum.UseInherited then begin
i := FFallBackFormats.Count -1;
while (i >0) and (FFallBackFormats[i].EnumVal.UseInherited) do
dec(i);
Result.Enum := FFallBackFormats[i].EnumVal;
end;
Result.Num2 := DefaultEnumNum;
Result.Num2.Visible := Result.Enum.MainFormat in [vdfEnumNameAndOrd, vdfEnumOrd];
Result.Num2.BaseFormat := Result.Enum.BaseFormat;
Result.Num2.SignFormat := Result.Enum.SignFormat;
ResolveSign(Result.Num2.SignFormat, DefaultEnumNum.SignFormat);
end;
rdkBool: begin
Result.Bool := ADispFormat.Bool;

View File

@ -123,6 +123,10 @@ msgctxt "idedebuggerstringconstants.dispformatdlgbtnenum"
msgid "Enum"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnenumval
msgid "Enum(Identifier)"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnfloat
msgctxt "idedebuggerstringconstants.dispformatdlgbtnfloat"
msgid "Float"

View File

@ -124,6 +124,10 @@ msgctxt "idedebuggerstringconstants.dispformatdlgbtnenum"
msgid "Enum"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnenumval
msgid "Enum(Identifier)"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnfloat
msgctxt "idedebuggerstringconstants.dispformatdlgbtnfloat"
msgid "Float"

View File

@ -126,6 +126,10 @@ msgctxt "idedebuggerstringconstants.dispformatdlgbtnenum"
msgid "Enum"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnenumval
msgid "Enum(Identifier)"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnfloat
msgctxt "idedebuggerstringconstants.dispformatdlgbtnfloat"
msgid "Float"

View File

@ -130,6 +130,10 @@ msgctxt "idedebuggerstringconstants.dispformatdlgbtnenum"
msgid "Enum"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnenumval
msgid "Enum(Identifier)"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnfloat
msgctxt "idedebuggerstringconstants.dispformatdlgbtnfloat"
msgid "Float"

View File

@ -129,6 +129,10 @@ msgctxt "idedebuggerstringconstants.dispformatdlgbtnenum"
msgid "Enum"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnenumval
msgid "Enum(Identifier)"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnfloat
msgctxt "idedebuggerstringconstants.dispformatdlgbtnfloat"
msgid "Float"

View File

@ -130,6 +130,10 @@ msgctxt "idedebuggerstringconstants.dispformatdlgbtnenum"
msgid "Enum"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnenumval
msgid "Enum(Identifier)"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnfloat
msgctxt "idedebuggerstringconstants.dispformatdlgbtnfloat"
msgid "Float"

View File

@ -130,6 +130,10 @@ msgctxt "idedebuggerstringconstants.dispformatdlgbtnenum"
msgid "Enum"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnenumval
msgid "Enum(Identifier)"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnfloat
msgctxt "idedebuggerstringconstants.dispformatdlgbtnfloat"
msgid "Float"

View File

@ -130,6 +130,10 @@ msgctxt "idedebuggerstringconstants.dispformatdlgbtnenum"
msgid "Enum"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnenumval
msgid "Enum(Identifier)"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnfloat
msgctxt "idedebuggerstringconstants.dispformatdlgbtnfloat"
msgid "Float"

View File

@ -128,6 +128,10 @@ msgctxt "idedebuggerstringconstants.dispformatdlgbtnenum"
msgid "Enum"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnenumval
msgid "Enum(Identifier)"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnfloat
msgctxt "idedebuggerstringconstants.dispformatdlgbtnfloat"
msgid "Float"

View File

@ -130,6 +130,10 @@ msgctxt "idedebuggerstringconstants.dispformatdlgbtnenum"
msgid "Enum"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnenumval
msgid "Enum(Identifier)"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnfloat
msgctxt "idedebuggerstringconstants.dispformatdlgbtnfloat"
msgid "Float"

View File

@ -126,6 +126,10 @@ msgctxt "idedebuggerstringconstants.dispformatdlgbtnenum"
msgid "Enum"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnenumval
msgid "Enum(Identifier)"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnfloat
msgctxt "idedebuggerstringconstants.dispformatdlgbtnfloat"
msgid "Float"

View File

@ -130,6 +130,10 @@ msgctxt "idedebuggerstringconstants.dispformatdlgbtnenum"
msgid "Enum"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnenumval
msgid "Enum(Identifier)"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnfloat
msgctxt "idedebuggerstringconstants.dispformatdlgbtnfloat"
msgid "Float"

View File

@ -130,6 +130,10 @@ msgctxt "idedebuggerstringconstants.dispformatdlgbtnenum"
msgid "Enum"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnenumval
msgid "Enum(Identifier)"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnfloat
msgctxt "idedebuggerstringconstants.dispformatdlgbtnfloat"
msgid "Float"

View File

@ -130,6 +130,10 @@ msgctxt "idedebuggerstringconstants.dispformatdlgbtnenum"
msgid "Enum"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnenumval
msgid "Enum(Identifier)"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnfloat
msgctxt "idedebuggerstringconstants.dispformatdlgbtnfloat"
msgid "Float"

View File

@ -126,6 +126,10 @@ msgctxt "idedebuggerstringconstants.dispformatdlgbtnenum"
msgid "Enum"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnenumval
msgid "Enum(Identifier)"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnfloat
msgctxt "idedebuggerstringconstants.dispformatdlgbtnfloat"
msgid "Float"

View File

@ -129,6 +129,10 @@ msgctxt "idedebuggerstringconstants.dispformatdlgbtnenum"
msgid "Enum"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnenumval
msgid "Enum(Identifier)"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnfloat
msgctxt "idedebuggerstringconstants.dispformatdlgbtnfloat"
msgid "Float"

View File

@ -120,6 +120,10 @@ msgctxt "idedebuggerstringconstants.dispformatdlgbtnenum"
msgid "Enum"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnenumval
msgid "Enum(Identifier)"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnfloat
msgctxt "idedebuggerstringconstants.dispformatdlgbtnfloat"
msgid "Float"

View File

@ -137,6 +137,10 @@ msgctxt "idedebuggerstringconstants.dispformatdlgbtnenum"
msgid "Enum"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnenumval
msgid "Enum(Identifier)"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnfloat
msgctxt "idedebuggerstringconstants.dispformatdlgbtnfloat"
msgid "Float"

View File

@ -130,6 +130,10 @@ msgctxt "idedebuggerstringconstants.dispformatdlgbtnenum"
msgid "Enum"
msgstr "Перечислимый"
#: idedebuggerstringconstants.dispformatdlgbtnenumval
msgid "Enum(Identifier)"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnfloat
msgctxt "idedebuggerstringconstants.dispformatdlgbtnfloat"
msgid "Float"

View File

@ -135,6 +135,10 @@ msgctxt "idedebuggerstringconstants.dispformatdlgbtnenum"
msgid "Enum"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnenumval
msgid "Enum(Identifier)"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnfloat
msgctxt "idedebuggerstringconstants.dispformatdlgbtnfloat"
msgid "Float"

View File

@ -136,6 +136,10 @@ msgctxt "idedebuggerstringconstants.dispformatdlgbtnenum"
msgid "Enum"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnenumval
msgid "Enum(Identifier)"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnfloat
msgctxt "idedebuggerstringconstants.dispformatdlgbtnfloat"
msgid "Float"

View File

@ -138,6 +138,10 @@ msgctxt "idedebuggerstringconstants.dispformatdlgbtnenum"
msgid "Enum"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnenumval
msgid "Enum(Identifier)"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnfloat
msgctxt "idedebuggerstringconstants.dispformatdlgbtnfloat"
msgid "Float"

View File

@ -137,6 +137,10 @@ msgctxt "idedebuggerstringconstants.dispformatdlgbtnenum"
msgid "Enum"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnenumval
msgid "Enum(Identifier)"
msgstr ""
#: idedebuggerstringconstants.dispformatdlgbtnfloat
msgctxt "idedebuggerstringconstants.dispformatdlgbtnfloat"
msgid "Float"