Make register view entry format settings persist through debug session / Patch by ccrause

git-svn-id: trunk@62591 -
This commit is contained in:
martin 2020-01-26 20:14:59 +00:00
parent dff0c471bc
commit 7e1fb75015
2 changed files with 32 additions and 17 deletions

View File

@ -1021,6 +1021,7 @@ type
function GetEntryByIdx(AnIndex: Integer): TRegisters;
protected
public
procedure InvalidateItems;
property EntriesByIdx[AnIndex: Integer]: TRegisters read GetEntryByIdx;
property Entries[AThreadId, AStackFrame: Integer]: TRegisters read GetEntry; default;
end;
@ -3365,6 +3366,19 @@ begin
Result := TRegisters(inherited EntriesByIdx[AnIndex]);
end;
procedure TRegistersList.InvalidateItems;
var
i, j: Integer;
begin
Assert(not Immutable, 'TRegisterList.InvalidateItems Immutable');
if Count = 0 then
exit;
for i := 0 to Count-1 do begin
EntriesByIdx[i].DataValidity := ddsUnknown;
end;
DoCleared;
end;
{ TWatchesBase }
function TWatches.GetItemBase(const AnIndex: Integer): TWatch;

View File

@ -1045,6 +1045,7 @@ type
constructor Create;
destructor Destroy; override;
procedure Clear;
procedure InvalidateItems;
procedure AddNotification(const ANotification: TRegistersNotification);
procedure RemoveNotification(const ANotification: TRegistersNotification);
property CurrentRegistersList: TCurrentIDERegistersList read GetCurrentRegistersList;
@ -5941,22 +5942,17 @@ end;
function TCurrentIDERegisters.Count: Integer;
begin
case DataValidity of
ddsUnknown: begin
AddReference;
try
Result := 0;
DataValidity := ddsRequested;
FMonitor.RequestData(Self); // Locals can be cleared, if debugger is "run" again
if DataValidity = ddsValid then Result := inherited Count();
finally
ReleaseReference;
end;
end;
ddsRequested, ddsEvaluating: Result := 0;
ddsValid: Result := inherited Count;
ddsInvalid, ddsError: Result := 0;
if DataValidity = ddsUnknown then begin
AddReference;
try
Result := 0;
DataValidity := ddsRequested;
FMonitor.RequestData(Self); // Locals can be cleared, if debugger is "run" again
finally
ReleaseReference;
end;
end;
result := TDbgEntityValuesList(self).Count;
end;
{ TCurrentIDERegistersList }
@ -5989,14 +5985,14 @@ procedure TIdeRegistersMonitor.DoStateEnterPause;
begin
inherited DoStateEnterPause;
if CurrentRegistersList = nil then exit;
Clear;
InvalidateItems;
end;
procedure TIdeRegistersMonitor.DoStateLeavePauseClean;
begin
inherited DoStateLeavePauseClean;
if CurrentRegistersList = nil then exit;
Clear;
InvalidateItems;
end;
procedure TIdeRegistersMonitor.DoEndUpdate;
@ -6052,6 +6048,11 @@ begin
CurrentRegistersList.Clear;
end;
procedure TIdeRegistersMonitor.InvalidateItems;
begin
CurrentRegistersList.InvalidateItems;
end;
procedure TIdeRegistersMonitor.AddNotification(const ANotification: TRegistersNotification);
begin
FNotificationList.Add(ANotification);